System Design · Senior · Question 12 of 75

How do you implement an "online" status for millions of users?

Explanation

The client sends a signal every N seconds, and the server stores a key with a TTL in fast storage (Redis). A disconnect without an explicit logout is detected by expiration. Status changes are broadcast only to those who can see them.

Further reading

Problem with a question

System Design · Senior · question 12

Test yourself

Take the System Design · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz