Architecture patterns every engineer needs for system design interviews. Diagrams, tradeoffs, real-world examples, and back-of-envelope math — not just buzzwords.
Distribute traffic across servers — Round Robin, Least Connections, Consistent Hashing. The first thing to mention in any design.
Store hot data in memory to slash latency. Cache-aside, write-through, write-behind — and the hardest problem: invalidation.
Split data across multiple databases by shard key. Horizontal partitioning for write scale and data volume beyond one machine.
Minimize key redistribution when nodes join or leave. Virtual ring, virtual nodes — the backbone of distributed caches and databases.
Decouple producers from consumers with async messaging. Kafka, RabbitMQ, SQS — load leveling, fault isolation, event-driven architecture.
Kafka internals — partitions, replication, consumer groups, producer guarantees, exactly-once semantics, and why it's a commit log, not a queue.
Hands-on playground — 3-broker KRaft cluster, Kotlin producer/consumer, 7 guided experiments. Download, run, break things.
Control request rates with Token Bucket, Sliding Window, and Leaky Bucket. Protect services from abuse and ensure fair usage.
Leader-follower, multi-leader, leaderless — maintain copies across instances for availability, fault tolerance, and read scale.
Consistency vs Availability during network partitions. The fundamental tradeoff driving every distributed database decision.
Sync vs async, API Gateway, Circuit Breaker, Saga pattern — how services talk without cascading failures.
Edge servers worldwide caching content close to users. Pull vs Push CDN, cache invalidation, origin shield.
Probabilistic membership testing — "definitely not" or "probably yes." Space-efficient at the cost of false positives.
Batch and stream processing of massive datasets. Map → Shuffle → Reduce, Lambda vs Kappa architecture.
B-tree, LSM Tree, inverted indexes — the data structures that make queries fast. ESR rule for compound index design.
Snowflake, ULID, UUID — generating unique, sortable IDs across distributed nodes without coordination.
Raft, Paxos, ZooKeeper — ensuring exactly one node is in charge. Consensus algorithms for distributed coordination.
Lossless vs lossy, columnar storage, data tiering — reducing storage costs and network bandwidth at scale.
JWT, OAuth 2.0, session-based auth — identity and access patterns for distributed systems.
WebSocket, SSE, push notifications — real-time delivery at scale with fan-out and aggregation.
Logging, metrics, distributed tracing — the three pillars of understanding production systems. RED and USE methods.
More patterns are being built. Check back soon!
← Back to memset.dev