Realtime messaging with delivery guarantees and presence.
Messenger / WhatsApp: realtime messaging with delivery guarantees and presence
compose the pieces into a design story
Connection servers are stateful; pin and replicate.
Messenger systems use a fleet of connection servers (WebSocket/QUIC) routing messages between users via brokers, with durable storage for offline delivery and explicit ordering per conversation.
Connection server: terminates user sessions; pinned by user_id hash.
Routing: lookup target's connection server via registry.
Persistence: messages durable per conversation; ordered by clock or sequence.
Presence: TTL on Redis key; coarse 'online within last N seconds'.
Send a message between users in different regions.