System Design mind map

Design data structures and APIs for real-world systems.

Core idea: Turn requirements into operations, then choose state and indexes that meet their cost.

Mnemonic: Contract → state → policy → scale · Cost: Complexity is an API promise

Contract: Operations & guarantees

Signal: Before choosing structures, reads, writes, scale, and failure behavior must be explicit.

Move: Name the API and workload; state latency, consistency, capacity, and edge-case guarantees.

Examples: TinyURL, File System, Phone Directory

Index: Source of truth & views

Signal: One write model must support several fast lookup paths.

Move: Keep canonical state plus derived indexes; define how every mutation keeps them synchronized.

Examples: Twitter Feed, Calendar, Range Module

Policy: Ordering, eviction & time

Signal: Correctness depends on which item leaves, wins, or expires.

Move: Encode the policy directly with linked order, heaps, counters, and an explicit clock.

Examples: LRU / LFU Cache, Logger Limiter, Median Tracker

Scale: Partition, replicate & queue

Signal: One machine or synchronous write path no longer meets the workload.

Move: Split ownership, copy for reads, queue slow work, and protect writes with idempotency.

Examples: Task Servers, Distributed Counter, Snapshot Service

Every mind map