Sync app.storage between multiple instances #1606
Replies: 7 comments 6 replies
-
The most popular solution to sync state between multiple instances is Redis. Maybe we could make the storage solution configurable? Then, instead of writing to disk a Redis database can be used as a shared storage across all instances. |
Beta Was this translation helpful? Give feedback.
-
Anyone interested in creating a draft? |
Beta Was this translation helpful? Give feedback.
-
This feature is already quite highly voted (add your's if you need it). There was also a discussion on Discord. If there are not a lot of data, a workaround could be to use the |
Beta Was this translation helpful? Give feedback.
-
I was looking online for a way to configure NiceGUI's storage centrally using something like Redis, and came across this discussion. Would definitely be a plus for any multi-instance configuration. |
Beta Was this translation helpful? Give feedback.
-
Just came across this, I have the same problem where I want to scale out the app servers and have user storage. I figured I could just mount a shared volume, but then checking out This is probably a very high priority improvement for anyone looking to do serious deployments at some scale. I like the idea of the user instantiating their own storage class, but also having some built-in ones (the existing file-based one for simplicity, plus Postgres, Redis etc). I'd be tempted to have a stab at one but I'm nowhere near familiar enough with the code. 😞 |
Beta Was this translation helpful? Give feedback.
-
How would be go about to sponsor such an improvement @rodja ? We would be happy to instantiate a storage class if that was an option. Any way of overcoming multiple workers/threads issues for app.storage.user is very interesting to us and we would be willing to put some money behind this. |
Beta Was this translation helpful? Give feedback.
-
redis storage which syncs between multiple instances (see #4074) has been released with v2.10.0. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
With Fly.io, Google Cloud Run, Docker Swarm, Kubernetes etc. a NiceGUI app can be deployed to multiple instances which get fed requests by load balancer. In this scenario each instance will create their own
.nicegui
directory for storage. Depending on where a user requests are placed the storage data created by one instance may not be available to the other.NiceGUI should allow a simple way to keep multiple instances in sync.
Beta Was this translation helpful? Give feedback.
All reactions