✕ CLOSE Noma Da Kiwo Hotuna Kiwon Lafiya Girke-Girke Sana'o'i Kimiyya da Kere-Kere Ra'ayin Aminiya Ra’ayoyi Rahoto

System Design Cheat Sheet -

| Characteristic | What it means | How to achieve | |----------------|---------------|----------------| | | System stays up | Redundancy, failover, replication | | Consistency | All nodes see same data | Quorums, transactions, locks | | Partition Tolerance | Works despite network splits | Distributed architecture (CAP theorem) | | Scalability | Handle more load | Horizontal scaling, sharding, caching | | Latency | Response time | Caching, CDN, efficient indexes | | Throughput | Requests/second | Parallelism, async processing, batching | | Durability | Data persists after failure | Replication, WAL, backups |

| Failure | Mitigation | |---------|-------------| | | Read replicas, caching, connection pooling | | Cache stampede | Request coalescing, probabilistic early expiration | | Queue backlog | Auto-scaling consumers, backpressure, dead-letter queues | | Network partition | Retry with backoff, circuit breakers, idempotency | | Single point of failure | Redundancy at every layer (LB, DB, cache, queue) | | Slow downstream service | Timeouts, circuit breakers, bulkheading |

Use "back-of-the-envelope" math to calculate expected QPS (Queries Per Second) and storage needs over 1–5 years. system design cheat sheet

→ APIs, data flow Non-functional → Availability, latency, durability, consistency

| Pattern | Description | Use case | |---------|-------------|----------| | | Producer → queue → consumer | Task distribution, load smoothing | | Pub/Sub | One-to-many fanout | Event-driven updates, notifications | | Event sourcing | Store state as event log | Audit, replay, CQRS | | CQRS | Separate read/write models | Complex domains, high read/write asymmetry | | Saga | Distributed transaction via compensating events | Cross-service consistency | | Characteristic | What it means | How

LRU, LFU, TTL, FIFO.

| Strategy | How it works | Best for | |----------|-------------|-----------| | | App checks cache → misses DB → writes cache | Read-heavy workloads | | Read-through | Cache sits in front of DB | Consistent data, complex queries | | Write-through | Write to cache + DB synchronously | Write-heavy, need consistency | | Write-behind | Write to cache → async write to DB | High write throughput, eventual consistency | | Refresh-ahead | Cache auto-refreshes near-expiry data | Predictable access patterns | Medium +6 Common Design Patterns & Templates Modern

: Justify decisions, such as sacrificing consistency for higher availability. Medium +6 Common Design Patterns & Templates Modern cheat sheets often include templates for specific real-world applications to help engineers recognize recurring problems: LockedIn AI +1 System Type Key Components/Challenges Recommended Cheat Sheet Solution URL Shortener Collision risk, high read traffic Base62 encoding, LRU caching Messaging App Real-time delivery, message order WebSockets, Kafka message queues News Feed Large-scale data, personalization Hybrid push/pull models, fan-out Video Streaming Large file handling, latency CDNs, Adaptive Bitrate Streaming Popular Resources Several industry-standard cheat sheets are widely referenced: ByteByteGo System Design Cheat Sheet : Focuses on high-level availability and throughput solutions. GitHub - System Design Primer : A massive repository of patterns and interview questions. Grokking Modern System Design