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 stores computed results for your analytics in an internal cache. However, as new data arrives to the database, you expect your visualizations to be refreshed to include the latest data.

To notify GoodData that new data has been uploaded to the database, send a notification to the data source that represents the database. Once GoodData received the notification, it invalidates the cache related to the data source. Next time you open a visualization, 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/v1/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

PowerShell 7
curl $HOST_URL/api/v1/actions/dataSources/demo-ds/uploadNotification -X POST \
  -H "Authorization: Bearer $API_TOKEN"
Invoke-RestMethod -Method Post -Uri "$HOST_URL/api/v1/actions/dataSources/demo-ds/uploadNotification" `
  -H @{ 'Authorization' = "Bearer $API_TOKEN" }