Skip to main content

Caching

Transform has caching features that improve the performance of querying metrics. There are three different types caching features available to speed up requests and ensure that, if possible, every request doesn't compute the metrics from the source tables since that causes latency.

Aggregation Cache#

Transform's semantic layer has a powerful Aggregation Cache. The Aggregation Cache speeds up requests by saving previous intermediate states of datasets for certain measures so that subsequent and similar requests are sped up significantly. The Aggregation Cache relies on information in the data warehouse, and items in it expire based on the mutability configuration as defined in the corresponding data source, as well as the age of the item.

In-Memory Cache#

This cache lives outside of the semantic layer and ensures user interface queries are fast after the first run. This is independent of any other layers of caching; it attempts to serve data that already exists in memory for a particular request if the query was run recently before. There is a time-based expiration on these queries. If a user queries the Transform UI at the start of their day, it's likely to be a little slower because queries aren't in the In-Memory Cache. They should notice a speed up once people start using the application and making similar requests because of this cache.

Fast Cache#

Transform'a Fast Cache builds upon our Materialization capabilities. The Fast Cache allows you to store materializations in a database cache (e.g., MySQL) for faster access. This is in contrast to the default for materializations, which store data in your data warehouse, and can have latency of many seconds for basic requests. This feature is most useful for organizations that need extremley low latency access to metrics.

How Results are Returned#

When a query is run against Transform, the following steps occur:

  1. If the query is issued from the UI, Transform checks the In-Memory cache to return a result from memory if possible.
  2. If the data isn't in the In-Memory cache, or the query was executed outside of the UI, Transform will first check the materialized tables in the data warehouse and Fast Cache for the data. If it can return the data from any of these sources, it will.
  3. If it cannot find the data from Step 1, it will check the Aggregation Cache and attempt to return a result.
  4. If it cannot find the result from Step 1 or 2 or 3, we will compute the data from scratch: