Problems, when using a separate module to keep internal state?

Hi,

for my application, multi-user functionality is not a requirement. Each user will start their own Dash application!!!

In order to avoid unnecessary traffic between frontend and backend, I would like to store some computed data in the backend python code, so that all neccessary components can access it. As I realized, that Dash starts several workers in parallel, I created a separate module without any dash components, which I use to store my data in:

run.py
data.py (here are all my data and intermediate steps)
component1.py (dash component with access to data.py)
component2.py (dash component with access to data.py)

The data.py should therefore have one ground truth for all other components.

Right now, it works as expected. Are there any problems with this solution, that I don’t see yet?

The main reason, why I don’t want to transfer everything via app.callback to the frontend is, because it is a pandas-dataframe-groupby result, which does not serialize by default and it is pretty big. Therefore, I want to store it solely in the backend and perform some computations on it just on request.

Thanks,
Martin