Caching Data Structures
- 19 Oct 2021
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Caching Data Structures
- Updated on 19 Oct 2021
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
Through the use of the Caching tools provided by Decisions Studio, users are given the option to Cache data for a specified Custom Data Structure of their desire.
Doing so allows users to keep an additional copy of the data that can be quickly fetched from the Data Cache rather than utilize the additional system resources required to pull information directly from an Object's Database Table. The following document demonstrates and explains how to enable and utilize Caching on a Data Structure.
Example
Enabling Caching on a Data Structure
To Cache a Data Structure:
- From a Designer Folder, CREATE a new Custom DataType by clicking the CREATE DATATYPES/INTEGRATION button, selecting one of the options under User Defined Types, and clicking CREATE.
- From the resulting window, provide a Structure Type Name, then define the desired Properties by providing a Name and selecting a Type for each one. Additional InformationNote the Properties of this Data Structure may be whatever the user desires; this example just utilizes a single StringType.
Navigate to the Advanced category under the Custom Data Structure's Properties. Check the Enable Caching checkbox. Then click SAVE.
Post Data Structure Creation
After Caching has been enabled on a Custom Data Structure, and the Data Structure has been saved, users will need to create data affiliated with the Data Type. To do so:- From a Designer Folder, select the CREATE FLOW step, then CREATE a new Flow.
- From the Flow Designer, navigate to Steps > User Defined Types > [Corresponding Data Type] > [Name of Custom Data Structure], and attach a Create [Name of Custom Data Structure] step to the Start and End step.
- From the Properties of the Create step under Inputs > Item to Create, map a respective Value for the Custom Data Structure.
- Save the Flow, then click the Debug link on the top Action Bar, then click FULL.
- After the Flow runs, select Create [Name of Custom Data Structure] > Execution 1 > View Input/Output Data and verify that the Flow has created the data value as expected.About Debug ResultsSince Enable Caching has been established on the Custom Data Structure, the resulting saved value will be saved to the Database Table of the Data Structure, as well as into a Cache.
About Entities Steps
Once Enable Caching is established on a Custom Data Structure, any data retrieved via a Fetch Entities step, will be retrieved from the Data Cache rather than the Database Table itself. This helps to reduce the amount of resources expended to retrieve the data and reduces the amount of time required the fetch the data.Additionally utilizing the other Entity steps (from Steps > Integration > Entity Framework) such as Save Entities or Update Entity/Entities for a Data Structure with Caching enabled, will save the changes to the Cache first, and then push the changes to Database Table to keep both of them in sync. with one another.
Alternate Caching Method
In addition to the previously discussed method, Data Structures can also be Cached by specifying a value directly into a Put In Cache step, and retrieved via a Get From Cache step and a Key value.Additional Resources
For more information on how to use Cache steps including the Put In Cache step, see Cache Steps.
Was this article helpful?