QA
Intermediate LevelSystem Design & Architecture

How do you design a real-time Chat Application (like WhatsApp or Slack)?

❓ Interview Prompt: Explain designing a Chat Application, WebSockets connection gateway, message status tracking (sent, delivered, read), and NoSQL message history storage.

Designing a high-concurrency real-time Chat Application (WhatsApp/Slack):

Core Architecture:

1
Connection Gateway: Manages millions of long-lived WebSocket connections across server clusters.
2
Presence & Routing: Tracks online status in Redis ('user:100 -> gateway_node_3'). Directs messages to active WebSockets or pushes notifications for offline users.
3
Message History: Stores chat messages in an append-only NoSQL database (Cassandra / HBase) partitioned by 'chat_id'.

Code Implementation Example

markdown
Real-Time Chat App Architecture:

[Sender Client] ──(WebSocket)──> [WS Gateway Node 1]
                                       β”‚
                             (Lookup Recipient WS Node)
                                       β”‚
                                       β–Ό
[Receiver Client] <──(WebSocket)── [WS Gateway Node 2]
                                       β”‚
                              (Persist Message)
                                       β–Ό
                             [Cassandra Message DB]
πŸ’‘Real-Time Chat Application architecture using WebSocket gateways and Cassandra.
🎯 Interview Key Takeaway

Design chat applications using WebSocket connection gateways, Redis presence tracking, and Cassandra message history.

#System Design#Chat Application#WebSockets#Cassandra#Intermediate
Back to all System Design & Architecture Questions→

More System Design & Architecture Interview Questions

Beginner LevelSystem Design & Architecture

Explain the CAP Theorem and PACELC Theorem with real-world database examples.

Beginner LevelSystem Design & Architecture

What is Vertical Scaling (Scale Up) vs Horizontal Scaling (Scale Out)?

Beginner LevelSystem Design & Architecture

How do Load Balancers distribute traffic (Round Robin, Least Connections, IP Hash)?