System Design Patterns

Architecture patterns every engineer needs for system design interviews. Diagrams, tradeoffs, real-world examples, and back-of-envelope math — not just buzzwords.

⚠️ These guides are AI-generated and may contain inaccuracies. Always verify against authoritative sources and real-world documentation.
20
Patterns
SVG
Diagrams
100%
Interview-Ready
⚖️

Load Balancing

Distribute traffic across servers — Round Robin, Least Connections, Consistent Hashing. The first thing to mention in any design.

Easy Very High Frequency
🗄️

Caching

Store hot data in memory to slash latency. Cache-aside, write-through, write-behind — and the hardest problem: invalidation.

Easy Very High Frequency
🗂️

Database Sharding

Split data across multiple databases by shard key. Horizontal partitioning for write scale and data volume beyond one machine.

Medium Very High Frequency
💍

Consistent Hashing

Minimize key redistribution when nodes join or leave. Virtual ring, virtual nodes — the backbone of distributed caches and databases.

Medium High Frequency
📨

Message Queues

Decouple producers from consumers with async messaging. Kafka, RabbitMQ, SQS — load leveling, fault isolation, event-driven architecture.

Medium Very High Frequency
📨

Kafka Deep Dive

Kafka internals — partitions, replication, consumer groups, producer guarantees, exactly-once semantics, and why it's a commit log, not a queue.

Medium-Hard Very High Frequency
🧪

Kafka Lab

Hands-on playground — 3-broker KRaft cluster, Kotlin producer/consumer, 7 guided experiments. Download, run, break things.

Hands-On Kotlin + Docker
🚦

API Rate Limiting

Control request rates with Token Bucket, Sliding Window, and Leaky Bucket. Protect services from abuse and ensure fair usage.

Easy-Medium High Frequency
📋

Database Replication

Leader-follower, multi-leader, leaderless — maintain copies across instances for availability, fault tolerance, and read scale.

Medium High Frequency
🔺

CAP Theorem

Consistency vs Availability during network partitions. The fundamental tradeoff driving every distributed database decision.

Medium Very High Frequency
🔌

Microservices Communication

Sync vs async, API Gateway, Circuit Breaker, Saga pattern — how services talk without cascading failures.

Medium High Frequency
🌐

CDN & Content Distribution

Edge servers worldwide caching content close to users. Pull vs Push CDN, cache invalidation, origin shield.

Easy-Medium High Frequency
🎲

Bloom Filters

Probabilistic membership testing — "definitely not" or "probably yes." Space-efficient at the cost of false positives.

Medium Medium Frequency
🗺️

MapReduce

Batch and stream processing of massive datasets. Map → Shuffle → Reduce, Lambda vs Kappa architecture.

Medium-Hard Medium Frequency
📇

Database Indexing

B-tree, LSM Tree, inverted indexes — the data structures that make queries fast. ESR rule for compound index design.

Medium High Frequency
🆔

Distributed ID Generation

Snowflake, ULID, UUID — generating unique, sortable IDs across distributed nodes without coordination.

Medium Medium-High Frequency
👑

Leader Election

Raft, Paxos, ZooKeeper — ensuring exactly one node is in charge. Consensus algorithms for distributed coordination.

Medium-Hard Medium Frequency
📦

Data Compression

Lossless vs lossy, columnar storage, data tiering — reducing storage costs and network bandwidth at scale.

Medium Medium Frequency
🔐

OAuth & Authentication

JWT, OAuth 2.0, session-based auth — identity and access patterns for distributed systems.

Medium Medium-High Frequency
🔔

Notification Systems

WebSocket, SSE, push notifications — real-time delivery at scale with fan-out and aggregation.

Medium Medium-High Frequency
👁️

Observability

Logging, metrics, distributed tracing — the three pillars of understanding production systems. RED and USE methods.

Medium Medium Frequency

More patterns are being built. Check back soon!

← Back to memset.dev