Design Microsoft Teams' Real-Time Messaging System
Problem
Design the core messaging backend for Microsoft Teams supporting real-time chat in channels and 1:1 DMs.
Requirements
Functional:
- Send and receive messages in real time
- Support channels (up to 10,000 members) and DMs
- Message history (infinite scroll, paginated)
- Read receipts and typing indicators
- File/image attachment support
Non-functional:
- 300M daily active users
- Message delivery p99 < 200ms
- 99.99% availability
- Messages must never be lost
Discussion points
- WebSocket connection management and fan-out at scale
- Message storage schema and partitioning strategy
- Handling offline users — push notifications vs pull on reconnect
- Read receipts without thundering herd
- How Azure Service Bus or Kafka fits in the pipeline
added …