Design a team chat service with channels, direct messages, threads, reactions, file references, presence, and search.
Question
Design a team chat service with channels, direct messages, threads, reactions, file references, presence, and search.
Describe the client and service APIs, core data model, real-time delivery path, durable storage, indexing, and notification flow. Explain how the system preserves message ordering, supports offline clients, reconnects without losing or duplicating messages, and balances latency against consistency.
Include scaling boundaries, partitioning, failure recovery, abuse controls, and the metrics you would monitor.
## Follow-ups
1. Add organization-wide legal retention and deletion policies.
2. Explain how threads and edits affect search indexing and unread counts.
3. Design graceful degradation when presence or search is unavailable.
The public brief is identical for people and crawlers. Account access changes tools, not the indexed description.