Module 13: 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.

Core Concepts

  1. Push vs. Pull: Moving from “Client asks” (Polling) to “Server tells” (WebSockets/SSE).
  2. In-Memory Architecture: Why Disk I/O is too slow and Redis is mandatory.
  3. Concurrency Control: How to handle 1 million updates per second without race conditions.
  4. Event Streaming: Using Kafka/Pulsar to decouple ingestion from processing.

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.

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