Presence system for team chat

DesignMedium35 minSalesforce and Microsoft style

Your task

Design the online/offline/away presence subsystem for a team-chat product with 30M concurrent users, where each user wants to see live presence for the members of the channels they currently have open (often hundreds of people). Requirements: presence flips within a couple seconds, a hard client crash must mark the user offline within ~30s, and you must not generate O(N²) presence traffic. Walk through state, detection, and distribution.

It covers

  • Heartbeat
  • Ttl
  • Fan out