Bosch IoT Insights

Query caching

Query caching helps to store the results of long running queries for a defined time frame.

That means, you don’t need to execute these queries and load newer data every time. You can now easily access the data that resulted from another run of that same query especially if the most current results are not necessary. Also, if another user in your project runs a query, and others also want to view the content of that, they don’t need to execute that same query again which might save a lot of time depending on the amount of data.

The cache is preserved over time. That means, if you change your mind in regards of the time frame or want to manually extract an old result, you can still do so.

Benefits:

  • You can download old results whenever you want.
    (The maximum for cached entries is 7 days in our object storage)

  • You can easily load all cached results from the new History drop-down list in the Template Runner, Query History, or via API.

  • You can cache all your queries via API calls.

  • You do not have to wait anymore for content to appear every time when you open a dashboard. The previous state will directly be loaded from cache.

  • You can define your own caching times for each query template and widget to achieve the optimal scenario of your use case.

Setting up query caching

Template Designer

Results of executed query templates are saved in the query history and can be accessed from there, too. Therefore, the Template Designer now provides a new option under Data Explorer > Query Template > Advanced Settings. This option is enabled for all new query templates, by default, and stores the results in the cache.

For all already existing/older query templates this option was not enabled.

For more information, refer to Creating a query template.

Template Runner

For running a query template with cache support, there is a new button: Run (cached). By using this new button, you can make use of the cached results. The service logic will automatically fetch the matching entries. You can also select cached entries manually using the selection box History.

For more information, refer to the following pages in the documentation:

Dashboards and widgets

You can also configure a caching time for each new widget individually and independently from the settings of a query template. This can be done in the data source settings of each widget. For all new widgets, the default cache time of 30 minutes will be set automatically. The UI will use this setting to load existing cache entries that match your parameters. Also our cache logic is capable of handling relative time frames.

Existing widgets have this set to 0, so that the cache is disabled and existing behavior is preserved.

For more information, refer to the configuration of any widget under Widgets.