Connection Dash to MongoDB

Hello everyone,

I’m currently working on a MongoDB database on which I’m connected via PyMongo. I want to create a KPI tracking dashboard with Dash.

My question: what is the best way to link Dash and my database? Where in Dash should we retrieve our data (in MongoDB) so that the data is updated correctly? At the beginning of the page or in the callback ?

Thanks a lot