Real-Time Systems
Welcome to Module 13. This module focuses on systems where latency is the enemy.
In standard web applications (e.g., e-commerce, blogs), a latency of 200ms-500ms is acceptable. In Real-Time Systems (Gaming, Trading, Live Streaming), anything above 50ms feels broken.
1. Core Concepts
- Push vs. Pull: Moving from “Client asks” (Polling) to “Server tells” (WebSockets/SSE).
- In-Memory Architecture: Why Disk I/O is too slow and Redis is mandatory.
- Concurrency Control: How to handle 1 million updates per second without race conditions.
- Event Streaming: Using Kafka/Pulsar to decouple ingestion from processing.
2. Chapters
| Chapter | Title | Key Concepts |
|---|---|---|
| 01 | Distributed Counter | Sharding, Redis, Write-Back Cache, CRDTs. |
| 02 | Live Notification System | WebSockets, Long Polling, SSE, Pub/Sub. |
| 03 | Real-Time Gaming Leaderboard | Redis Sorted Sets, Skiplists, Rank Approximation. |
| 04 | Flash Sale System | Atomic Counters, Queueing, Overselling Prevention. |
| 05 | Slack / Discord Real-Time Messaging [NEW] | Pub-Sub at Scale, Presence Management, Gateway Clusters. |
3. Why this matters?
Interviews often ask:
- “Design Facebook Messenger”
- “Design a Stock Ticker”
- “Design a Multiplayer Game Backend”
These are all Real-Time Systems. Understanding the shift from Stateless HTTP to Stateful TCP/WebSocket connections is the key to passing these rounds.
Module Chapters
Chapter 01
Distributed Counter (YouTube Likes)
Distributed Counter (YouTube Likes)
Start Learning
Chapter 02
Live Notification System (Facebook/Slack)
Live Notification System (Facebook/Slack)
Start Learning
Chapter 03
Real-Time Gaming Leaderboard
Real-Time Gaming Leaderboard
Start Learning
Chapter 04
Flash Sale System (Ticketmaster)
Flash Sale System (Ticketmaster)
Start Learning
Chapter 05
Design Slack/Discord (Real-Time Messaging)
Design Slack/Discord (Real-Time Messaging)
Start Learning
Chapter 06
Module Review: Real-Time Systems
Module Review: Real-Time Systems
Start Learning