Functional
- Send messages to one-to-one and group conversations.
- Synchronize history across a user's devices.
- Expose delivery/read state and best-effort presence.
Preserve conversation order and deliver messages across connected and offline devices.
Connections require a dedicated gateway tier.
Partition conversation logs and batch writes.
Use different strategies for ordinary and huge groups.
Hot recent history and archival storage need separate tiers.
These are reference assumptions, not universal facts. In an interview or architecture review, change them when the product context changes.
/v1/conversations/{id}/messagesSend with client_message_id for retry-safe submission./v1/conversations/{id}/messages?after=Page ordered history after a sequence./v1/connectReceive messages, receipts, and presence updates.conversation_id+sequence PK, message_id, sender, body_ref, created_atConversation sequence defines visible order.user+device+conversation, delivered_through, read_throughCursors compress receipt state.Maintain long-lived client sessions
Order and persist messages
Track ephemeral device reachability
Deliver and retry device updates
Route a conversation to one logical sequencer or shard leader. Assign sequence, replicate the message, then acknowledge. Client-generated IDs deduplicate retries after ambiguous timeouts.
Fanout-on-write works for ordinary conversations; enormous groups store once and let recipients pull from the shared log. Hybrid thresholds avoid millions of per-user writes for celebrity groups.
Gateways are disposable. On reconnect, a device presents durable cursors, fetches missing history, then resumes live delivery. Presence may be stale; history cannot depend on it.
Resume from the last acknowledged conversation sequence.
Shard fanout, batch membership reads, and degrade presence first.
Move here when: Moderate connections and traffic.
Move here when: Write and connection scale exceed one cluster.
Move here when: Cross-region latency and residency requirements.
Strong answer signal: Differentiate accepted, durably stored, delivered, and read.
Strong answer signal: Transfer sequence authority with fencing and a brief write pause/buffer.
Strong answer signal: Clock skew and concurrent sends require logical sequencing.