azure
System Design
intermediate
Real-time messaging application

Chat Application System

System Design Classic

A chat application requires real-time message delivery with strong ordering guarantees per conversation, supporting 1-on-1 and group messaging with typing indicators, read receipts, and offline queuing. Azure SignalR Service provides real-time WebSocket delivery at scale while an HTTP fallback ensures messages are never lost even during connectivity gaps. Ideal for teams building messaging apps that need real-time delivery, persistent history, and group chat at consumer scale.

Data Flow

Chat Gateway
Chat Service
SignalR Service
Message Store
Session Store
Group Fan-out Queue
Media Attachments
Push Notifications

Share this architecture with your network

Service Breakdown (8 services)

Other8 services
Chat Gateway
  • Exposes backend services through managed API endpoints
  • Enforces authentication, throttling, and quotas
  • Provides developer portal and API analytics
Chat Service
  • Manages real-time message delivery between users
  • Supports group conversations and typing indicators
  • Persists messages for offline delivery and history
SignalR Service
  • Pushes real-time messages via WebSocket connections
  • Scales to millions of concurrent connections
  • Falls back to SSE and long-polling for compatibility
Message Store
  • Provides globally distributed multi-model database
  • Guarantees single-digit ms reads worldwide
  • Supports five consistency levels
Session Store
  • Caches frequently accessed data in-memory
  • Reduces database round-trips and latency
  • Supports TTL-based expiration policies
Group Fan-out Queue
  • Provides reliable enterprise message brokering
  • Supports topics and queue-based messaging
  • Guarantees at-least-once delivery
Media Attachments
  • Stores shared images, files, and voice messages
  • Generates secure access tokens for downloads
  • Supports tiered storage for old vs. active media
Push Notifications
  • Executes event-driven functions without managing servers
  • Scales based on event volume with consumption billing
  • Supports durable functions for stateful workflows

Scaling Strategy

Azure SignalR Service handles millions of concurrent WebSocket connections with built-in scaling. Messages are written to Cosmos DB with conversation-partitioned partition keys for efficient pagination. Group chat messages fan out asynchronously via Service Bus to avoid blocking the sender. Media attachments upload directly to Blob Storage with SAS tokens, keeping the message path lightweight.

Related Architectures