Presence status service

DesignMedium40 minMeta style

Your task

Design a presence / online-status service (the 'green dot', online / away / offline / typing) for a social or chat app with 100M users, where each user's status must propagate to their friends/contacts within ~2 s. Status changes are extremely high-volume (every connect/disconnect/idle), reads are even higher (rendering buddy lists). How do you track who's online, detect disconnects, and fan status changes out to watchers efficiently?

It covers

  • Presence
  • Heartbeat
  • Fan out
  • Eventual consistency