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

  1. WebSocket connection management and fan-out at scale
  2. Message storage schema and partitioning strategy
  3. Handling offline users — push notifications vs pull on reconnect
  4. Read receipts without thundering herd
  5. How Azure Service Bus or Kafka fits in the pipeline
added …
LeaderboardSalaryAccount