Real-time OLTP-style OData4 requests for Power Apps and other interactive website builders

Go to Dutch version

By default, OData4 consumers are used to extract large volumes of data for analytical processing, such as a report on last year’s sales across all regions in Power BI or Qlik. Invantive Cloud provides this data in real time, but repeats the same answers on the same question after that moment for a configurable amount of time. This improves performance considerably on some reporting products which tend to download the same data after every change in a report by a report designer.

The minimum amount of lifetime for cache entries is established by the subscription type and is typically in the range 15 minutes…1 hour for paid subscriptions and longer for free plans. See Differentiate OData4 for Power BI Cache Behavior.

Such requests are named “OLAP OData requests”.

However, for use with Power Apps and other interactive applications, the need has arisen for real-time queries that contain current data. For this purpose, Invantive Cloud has been extended to allow OData queries with real-time to close to real-time current data on every invocation. This enables users to create operational reports, interactive applications and list-of-values for operational use.

Such short-lifed and real-time requests are named “OLTP OData requests”.

By adding a Cache-Control header, a OData request is changed from an OLAP to OLTP request. This header allows specification of a different requested maximum age as shown below in the first red box using a sample from https://developer.invantive.com:

The configured subscription has a minimum cache lifetime value of 30 seconds for OLTP OData requests, which is displayed in the answer in the second red box. The value for your subscription can be found as the metric “MaxCacheLifetimeBOLOLTP”. It can be seen that this answer was real-time calculated, as indicated by the “Miss from Invantive Response Cache” in the x-cache-header.

When another request is executed within the minimum value (depending on the subscription type), the answer will be coming from cache as shown below. Otherwise another “Miss from Invantive Response Cache” with fresh data will be returned:

The maximum runtime of OLTP OData requests using Cache-Control to get more current data under all circumstances is limited to a fixed value. Currently, a request must finish with 60 seconds. A traditional OLAP OData request may run up to 6 hours.

Configure Real-time OLTP-style Requests on Power BI

A real-time OLTP-style requests can be configured in Power BI by changing the OData.Feed statement.

For example, the following in the following OData.Feed, the cache control requests a maximum age of 0 seconds using #"Cache-Control" = "private,max-age=0":

let
    Source = OData.Feed("https://server/prefix/odata4", null, [Implementation="2.0", ODataVersion=4, OmitValues=ODataOmitValues.Nulls, Headers=[Referer = "MyReport", #"Cache-Control" = "private,max-age=0" ], Timeout=#duration(0,6,0,0)]),
...

See OData.Feed - PowerQuery M | Microsoft Learn for all details on OData.Feed.

In the same way you can increase the maximum allowed age of the data to be retrieved above on the database level in Invantive Cloud, for instance to multiple days, for instance to one week using:

let
    Source = OData.Feed("https://server/prefix/odata4", null, [Implementation="2.0", ODataVersion=4, OmitValues=ODataOmitValues.Nulls, Headers=[Referer = "MyReport", #"Cache-Control" = "private,max-age=604800" ], Timeout=#duration(0,6,0,0)]),
...