IndexedDB Client-side storage

Hi there! I’ve been instructing myself about the current Client-side storage options compatible with the Dash environment.

Most (if not all) of them explained in the Sharing Data Between Callbacks page. I was wondering if a solution like this which uses IndexedDB could be implemented or even is possible to adopt for Dash?

Also, and very relevant, take a look at this:

I guess it could be done. Do you have any particular use case in mind?

Yes. Let’s say i want to create a Dash app where each user can create a project and that project can contain several objects (e.g. Tables stored as Pandas DataFrames) which the user filled via DataTable and saved (stored) to the project, essentially creating a sort of Database where each Table has an unique ID.

The user should be able to explore the entirety or a selection of this tables grouped in a visual form in something like a plotly express figure. Hence why i need the possibility to store and access all of them.

In my particular case i don’t want or need to store the users Database server-side because currently i’m thinking about free deployment to test it and free means limited server-side storage. My app would only handle the reading and writing from/to each user client-side storage (DataBase) which can become really big in size and perform calculations or visualizations based on each individual table or a group of them (as explained above).

Since the storage would be client-side, the app should be able to read and edit any of the user already created Database tables. Ideally, the user should be able to migrate this Database as a downloadable file for use in any other device.

Doing this with dcc.Storage LocalStorage is impossible due to the storage limitation size.

Can something like this be currently achieved with Dash?

For that kind of use case, I guess it could make sense. One option would be to create a custom component based on the react component,

Have you thought about how you intend to interact with the database?

1 Like

This seems like a useful extension. Has anyone worked on it?

What are the disadvantages of storing the dataframe(s) in memory, which doesn’t have the 5 MB limit?