P
P
PRIYD2020-08-28 16:38:24
Node.js
PRIYD, 2020-08-28 16:38:24

How to store users who are online?

Hello.

Problem: Need to store/retrieve users who are currently online. Also, there is a database with all registered users.

Question: how to properly store users who are online? Add another field in the database of registered users (current state) and change it to connect/disconnect? Create a separate database for users who are now online and add/remove on connect/disconnect? Or another way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-08-28
@PRIYD

If not a cluster, then make a separate array. This is a node where you can do statefull services.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question