Architectural Decision Patterns
Connect recurring system design problems to proven structural solutions. Evaluate problem fit, operational trade-offs, failure modes, and alternatives.
Cache-Aside & Read-Through Pattern
Mitigating high database latency under read-heavy workloads while maintaining consistency.
Caching stores high-frequency read data in fast RAM instead of slow disk/network databases. Redis achieves sub-millisecond QPS by operating a single-threaded event loop paired with OS epoll I/O multiplexing, completely eliminating thread locking contention.
- βRead-heavy workloads (>80% reads, <20% writes).
- βSession storage, rate-limiting counters, and leaderboards.
Use probabilistic early expiration (XFetch algorithm) or distributed lock mutex (SETNX).
Token Bucket Rate Limiting Pattern
Preventing service degradation and cascading resource exhaustion under sudden bursts of incoming client traffic.
Rate limiting controls the incoming request rate per client or IP address to prevent server overload, DDoS attacks, and resource starvation.
- βPublic API endpoints exposed to third-party developers.
- βAuthentication / login routes.
Execute Redis Lua scripts for atomic counter updates.
Probabilistic Membership Testing (Bloom Filter)
Eliminating expensive authoritative database round-trips for non-existent keys with zero false negatives.
Hash Tables & Probabilistic Bloom Filters provides core foundational patterns in Algorithms & Data Structures. Achieve O(1) constant time lookups and test set membership with zero false negatives using space-efficient Bloom filters.
- βHigh-scale enterprise production systems in Algorithms & Data Structures.
- βPerformance-critical services requiring predictable latency bounds.
Use observability metrics and automated canary validation.
Circuit Breaker Fault Isolation Pattern
Failing fast and isolating cascading downstream service latency before exhaustion of connection pools.
Circuit Breakers monitor remote service call failure rates. If downstream failures exceed a threshold (e.g. 50%), the breaker trips to OPEN, instantly returning fallback responses instead of stalling threads.
- βMicroservice HTTP calls to third-party APIs.
- βDatabase connection attempts.
Add evaluation sliding window size and recovery cooldown timeouts.
Horizontal Database Sharding Pattern
Scaling relational storage throughput and capacity beyond the physical constraints of a single database node.
Sharding splits a monolithic database into independent database nodes (shards). Each row is routed to a shard based on a shard key.
- βTables exceeding 1TB or 50,000 write QPS.
- βGlobal multi-region data residency compliance.
Salt shard keys or use composite keys (user_id + date).
Distributed Locking with Fencing Tokens
Enforcing mutual exclusion across distributed stateless workers accessing shared non-atomic resources.
Distributed Locking & Redlock Algorithm provides core foundational patterns in Security & Distributed Concurrency. Synchronize atomic operations across distributed nodes using Redis SETNX, TTL fencing tokens, and Redlock consensus.
- βHigh-scale enterprise production systems in Security & Distributed Concurrency.
- βPerformance-critical services requiring predictable latency bounds.
Use observability metrics and automated canary validation.
Log-Structured Merge-Tree (LSM) Write Buffering
Optimizing high-throughput sequential write ingestion without stalling on random disk seeks.
B-Trees vs LSM-Trees Storage Engines provides core foundational patterns in Algorithms & Data Structures. Compare B+ Tree read-optimized node layouts against LSM-Tree append-only SSTable write buffers.
- βHigh-scale enterprise production systems in Algorithms & Data Structures.
- βPerformance-critical services requiring predictable latency bounds.
Use observability metrics and automated canary validation.
Need an ordered sequence for a specific engineering goal?
Generate an end-to-end learning path with prerequisites based on your target role or topic.
