italia/daf-dataportal

Create a microservice to cache Metabase plots

Opened this issue · 3 comments

ruphy commented

Create a microservice which goes through the various plots, takes a screenshot, and caches them.

You can fork this repository as a starting point.

Metabase plots are interactive javascript visualizations, the only way to cache them is therefore via spinning up a headless browser and taking a screenshot.

On the other hand, metabase has a caching facility in itself that operates at the query result level. It caches the data to be fed into the js plotting library.

Are you sure the first option is less computationally expensive and therefore worth it in terms of caching?

If yes, how is the cache supposed to be invalidated?

  • TTL
  • Polling metabase for changes

Caching and using the data to feed a js plotting library is a useful feature, but how can you know which dataset type to plot with the data automatically? If it is possible to automatize the rendering, the issue could be rewritten accordingly.
In any case other tools as superset do not have such a nice feature and the code of this issue can be
useful in other context with other business intelligence system. In the end we are not strict and any solution can be accepted

Happy to take a stab at it. Selenium to the rescue plus viewport screenshot and cropping?