[Question] How to manage states correctly and efficiently? #3392
-
I hava three questions about how to use states management in Reflex:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, each user tab has a token that maintains a state on the backend. So even through reconnects / refreshes the state should maintain. See the architecture post for more info.
You will want to use Redis in this case, and set the
How many users are you expecting? How large is your state? The states expire after 1 hour so it won't accumulate, generally it shouldn't take too much memory in Redis. At the end of the day, we will have to store the same data whether it's in Redis or another store. |
Beta Was this translation helpful? Give feedback.
Yes, each user tab has a token that maintains a state on the backend. So even through reconnects / refreshes the state should maintain. See the architecture post for more info.
You will want to use Redis in this case, and set the
redis_url
in therxconfig.py
or as an environment variable. This will use Redis as the state manager instead of the in-memory one. See here - we need to link this in our main website docs.