Table of Contents

Time-to-Live (TTL) and Caching

Ramya Priya Updated by Ramya Priya

Introduction to TTL and Caching

Caching plays a crucial role in improving the performance of queries by temporarily storing dataset results in memory, allowing faster access to data. The Time-to-Live (TTL) determines how long these cached results remain before being automatically cleared.

Under Settings --> Application Settings --> Data --> Cache TTL, you can provide caching for two types of datasets: in-memory datasets, which are stored for quick access, and live datasets, which are retrieved directly from the source system. Click on Update to save the settings. Understanding how TTL works and how it interacts with cache size limitations can help you optimize data retrieval.

In-memory datasets

The results of in-memory datasets are stored in cache and managed by Tellius. The data within these datasets live in memory, making it accessible quickly for future queries.

Limitations to note

  • You can specify the TTL (Time-to-Live) for in-memory datasets in minutes. The maximum TTL is 30 days (43,200 minutes). After this time, the cache will expire, and the data will be cleared, even if it has been accessed during that time. Accessing the data does not extend the TTL. For example, if data is cached at 2:00 PM with a TTL of 120 minutes, it will expire at 4:00 PM regardless of how often it is accessed.
  • In addition to TTL, there’s a 2 GB size limit on the cache. This limit works on a Least Recently Used (LRU) basis. If the cache reaches 2 GB, the least used data will be cleared to make room for new data, even if the TTL hasn't expired.
  • The cache will also be invalidated if the data is updated as a result of Business View refresh or changes. This ensures that when the data changes, the cached results are cleared and replaced with the most recent version.
  • Example: If you set the TTL to 44 minutes and the data is cached at 2:00 PM, the data will remain in the cache until 2:44 PM, regardless of how often it’s accessed. Even if the data is accessed at 2:30 PM and 3:30 PM, it will expire at 2:44 PM unless refreshed by a new query or an update to the data. Additionally, if the cache reaches the 2 GB limit before the 44 minutes are up, the least used data will be cleared first to make space.

Live datasets

Live datasets refer to data that is actively pulled from the source system. Tellius caches the results of queries for a specified TTL, but it does not control the underlying data. Since the source data can change independently, the cached data may not always reflect the latest updates. Therefore, a shorter TTL is often recommended for live datasets to keep the cached data relatively up-to-date.

Example: If you set the TTL to 120 minutes, the cached results will be retained for 120 minutes before being cleared. However, if the source data changes within those 120 minutes, the cache will not reflect these changes. For this reason, setting a shorter TTL (e.g., 30 minutes) might be more appropriate if you expect frequent changes in the source data.

By default, TTL for in-memory datasets is set to 30 days and TTL for live datasets is set to 120 minutes.

Did we help you?

Amazon S3

Loading Excel sheets

Contact