Performance Practices in Dashboards

The dashboard logic is executed only once, so you do not have to take care of caching. Storing data in api.global or api.local makes no difference, which is why those options are not used. Therefore, the dashboard design focuses primarily on efficient data querying.

Data Querying

Dashboards usually query Data Sources or Datamarts. Those are usually big data, so efficient querying of e.g. sales transactions is a key here. It is usually not possible and not even desired to read the whole table in the memory, therefore the data being queried should ideally be aggregated. Also a good filtering using inputs comes into play here.

If you need to link the main table with other tables, the best way is to utilize the database engine to do that. Joining the data by Groovy is less performant since the data need to be transferred from the database to the node over a network. So it is best to use a Datamart that links the needed tables, such as Customer or Product information, potentially also extension tables or company tables (countries, sales orgs or other code tables). For these tables you can utilize creation of Data Sources using templates that will create system Data Loads that will allow you to copy the Master tables data automatically. For other tables such as Price records, quote lines etc. you can utilize a custom Calculation Data Load – the element with the boilerplate code can be generated in Studio using an element template.

If the Datamart cannot be used, e.g. because of different field names or a date type column such as “Valid From”, then you can utilize DatamartContext.executeQuery or DatamartContext.executeSqlQuery() functions. https://pricefx.atlassian.net/wiki/spaces/KB/pages/2274558321 in Studio can help you to design those queries and will give you an idea about how long they run.

Data Growth

Analytical data, such as sales transactions, grow significantly over time. It is not uncommon that a dashboard created and approved during the project development may start timing out after a few months – because the data grew in volume. So keep that in mind when designing the dashboard. Good filtering capabilities using inputs may help keep the dashboard functional when users use more strict filters. Also making more inputs mandatory helps enforce data reduction.

 

Found an issue in documentation? Write to us.