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 duration for each new widget individually provided that the selected query template enables caching (see section "Template Designer" above). This can be done in the data source settings of each widget. For all new widgets, the default caching duration of 1800 seconds (30 minutes) will be set automatically. The UI will use this setting to load existing cached entries that match your parameters. Moreover, our caching logic is capable of handling different caching durations.

The caching enables loading widgets faster with relevant data. Nevertheless, the query template will still be run in the background in order to ensure that widgets are always updated with the latest data.

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