[Solved] Can we use Postgres as a data source for the Plots?

Hi
Sorry for the NOOB question. We’re evaluating different possibilities for creating dashboards. Our data is stored in different databases on AWS - Postgres and Mongo mostly. I’m wondering if we can use Plotly / Dash to access the data from the DBs directly for display.
Most examples in the documentation show data uploaded from CSV or directly input in form of lists, etc. Are there any examples to show accessing data from databases?
Thanks!

You certainly can use databases such as Postgres and MongoDB. You won’t be using any Dash/Plotly specific APIs to access them however, instead you’d use whatever standard Python client/connectors is used with them. In general, once you’re inside a Dash callback, you have the full power of whatever you can normally do in Python to get new/updated data, and serialise it into the format required by the callback. That’s why there isn’t really much in the way of documentation on this front – because there’s plenty of resources online for getting data out of Postgres/Mongo in Python.

Ah! I see. Thank you.

1 Like