Refresh the Analytics after Loading New Data to a Database
To avoid processing the same data by querying your database over and over again, GoodData Cloud Native (GoodData.CN) stores computed results for your analytics in an internal cache. However, as new data arrives to the database, you expect your insights to be refreshed to include the latest data.
To notify GoodData.CN that new data has been uploaded to the database, send a notification to the data source that represents the database. Once GoodData.CN received the notification, it invalidates the cache related to the data source. Next time you open an insight, it is re-computed with the latest data from the database, and the cache is populated with the recent data.
To send a notification, submit a POST
request to /api/actions/dataSources/<data-source-id>/uploadNotification
.
We recommend that you automate the notification process so that every time your database is updated, the API is executed automatically.
Example: Sending a notification to the demo-ds
data source that represents the pre-installed PostgreSQL database with the sample data prepared in the GoodData.CN Community Edition image
curl $ENDPOINT/api/actions/dataSources/demo-ds/uploadNotification -X POST \
-H "Authorization: Bearer $GDC_API_TOKEN"
Invoke-RestMethod -Method Post -Uri "$ENDPOINT/api/actions/dataSources/demo-ds/uploadNotification" `
-H @{ 'Authorization' = "Bearer $GDC_API_TOKEN" }