PastVu / pastvu

PastVu is an online platform for curating, annotating, attributing, and discussing vintage pictures around the world
https://pastvu.com
GNU Affero General Public License v3.0
111 stars 18 forks source link

Store user object hash at Redis #435

Open aeifn opened 2 years ago

aeifn commented 2 years ago

Now we keep user state in RAM; it may be useful for distributed model to save user state in caching database.

As a first step, we can try to sync user's online/offline status.

kabalin commented 2 years ago

I had more detailed look. I think we could store whole user objects hash in Redis (usLogin, usId defined in session controller) so changes in user object are shared among instances. This will make login status shared, but more important user stats and limits will be shared among instances too. With regard to sessions, since sessions are "sticky" at the moment, they could stay at node instances as they are now.