Sometimes you need to use some dynamic data from the database, but you need it so often, so retrieving data process becomes a big performance issue.
What you need to do? Cache the data? But your date is dynamic and can be modified by the user. So you need to implement some mechanism to reset your cache? Another bicycle…
Acumatica Framework can address this issue with Database Slots Technology:
- Framework stores your data in the HttpContext in special dictionaries.
- Framework automatically calls Prefetch method on first access to cached data.
- Framework automatically monitors dependant tables and will reset cache when someone has updated it.
- Framework automatically handles cluster mode.
- Access to the cached values is significantly faster.
lots are subscribed to database changes and with be automatically reset with any update/insert/delete operation to your table, so you don’t need to care about changes.
On the first request system will automatically call your method to fetch data from the database, so you don’t need to care about it too.
Example of slots usage:
After defining this class you can use it in your code like this:
var ret = ValuesCacheClass.Values;