In-Memory Data Sources
An In-Memory Data Source works in much the same way as a standard data source, except that it only exists in the local session memory and is managed entirely by using expressions.
This means that an in-memory data source will only persist until the current session ends, or when a new model is loaded into the session. When this happens, the data source—including its structure and all data saved to it—will be permanently deleted.
If you need to keep any data saved to an in-memory data source you should always make sure to save it to a permanent data source.
In-memory data sources enable you to work with structured data without the need to access a database or needing to make frequent calls to an external data source. For example, any time a standard data source refreshes, your application makes a call to the database in order to pull down all requested data again. This can be very resource intensive, especially if you are working with large amounts of data.
In contrast, an in-memory data source does not require any external calls, which helps you speed up your application and cut down on resource usage. You could even take an external data source and create an in-memory copy, enabling you to use and work with its data without staying connected to the original database.
Working with in-memory data is done entirely by using a series of in-memory functions. To start, you need to use CreateMemoryDataStore, which simply creates and names the in-memory data source:
CreateMemoryDataStore( DataSourceName );
After this runs, the data source will be active and you can then use functions to add columns and rows to the data source. In addition, there are several functions that enable you to sort or filter the data, update rows, and even connect the data source to a data grid.
For some examples of what you can do with in-memory data, refer to the following topics:
Description | Further Reading |
---|---|
Create an in-memory data source and give it a unique keyword. | Creating an In-Memory Data Source |
Add a temporary in-memory column to an existing data source. | Adding an In-Memory Column to a Data Source |
Add a temporary in-memory row of data to an existing data source. | Adding an In-Memory Row to a Data Source |
Use an expression to filter a data source. | Filtering a Data Source Using an Expression |
Copying a data source to create a new in-memory data source. | Creating an In-Memory Copy of a Data Source |
Connecting a data source to a data source grid with an expression. | Linking a Data Source to a Grid Using an Expression |
Using an aggregate function to return a value based on a column in a data source. | Performing a Calculation Against a Data Source Column |