Menu
Back to Discussions

Building a presence system: who's online, and how to know at scale?

Mateo Ivanova
Mateo Ivanova
·144 views
we're trying to build out a robust presence system, something like what slack has, where you can see who's online and actively using the app. it sounds simple, but scaling it beyond a few thousand users gets really tricky. we're aiming for 500k+ concurrent users and need pretty low latency for presence changes. our current approach involves heartbeats from clients to a central service, but we run into issues with mobile clients constantly dropping and reconnecting, causing 'flicker' where a user appears online then offline rapidly. then there's the challenge of users with multiple tabs or devices; do they count as one presence or multiple? and how do you efficiently propagate presence updates to all relevant subscribers without fan-out storming? we've considered redis for state, kafka for event propagation, but the edge cases like quick disconnects, network partitions, and ensuring consistency across a globally distributed system are proving to be quite the challenge. how have others tackled presence systems at this scale, especially with mobile users in mind? any horror stories or triumphant wins?
16 comments

Comments

Sign in to join the conversation.

Loading comments...