Pattern library
26 named solutions to recurring distributed-systems problems. When you notice you're inventing a pattern, someone has named it — use theirs.
Cache-aside (Lazy loading)
Reads dominate your workload, and every read hits a slow store (database, disk, network). Latency and load on the primary storage climb until the primary becomes the bottleneck.
OpenRead-through cache
Your application logic has to duplicate cache-management code everywhere it reads — check cache, on miss read DB, populate cache, return.
OpenWrite-through cache
In cache-aside, cache and DB can diverge briefly on writes. You need stronger cache-consistency.
OpenWrite-back (write-behind) cache
Write throughput is high; every write hitting the DB creates load. But you don't need writes to be durable in the DB immediately.
OpenWrite-around cache
Cache-aside with writes populating the cache can pollute the cache with never-read data (write-heavy but read-rare content).
OpenPub/Sub
You want to broadcast an event to multiple consumers without coupling the producer to the list of consumers.
OpenEvent-driven architecture
Tight coupling between services makes evolution painful. When service A directly calls service B, they must deploy together, know each other's contracts, and B's failures propagate to A.
OpenCQRS (Command Query Responsibility Segregation)
Your write model and read model have very different needs. Optimizing for one hurts the other.
OpenEvent sourcing
Traditional state-based storage loses history: you know the current balance, but not why it's that value. Auditing, replay, and temporal queries are hard.
OpenSaga (Long-running distributed transaction)
You have a business transaction that spans multiple services or databases (place order → charge payment → reserve inventory → send confirmation). Two-phase commit is too slow, too coupling, and often not available across service boundaries.
OpenTransactional outbox
You need to atomically update your database AND publish an event to Kafka. Two-phase commit isn't available; publishing before the DB commit risks phantom events; publishing after risks lost events on crash.
OpenChange Data Capture (CDC)
You want to derive downstream systems (search index, cache, analytics) from your primary database — but polling for changes is expensive and misses deletes.
OpenSharding (Horizontal partitioning)
Your dataset or write throughput has outgrown a single node. A single primary DB or single cache node can't hold the data or handle the QPS.
OpenConsistent hashing
You need to shard keys across N nodes, but N changes over time (nodes added, removed, or failed). Naive hash-mod-N reshuffles almost everything on every change — cache is wiped, migration cost is huge.
OpenLeader–follower replication
One node can't handle all reads. And if the node dies, you lose everything.
OpenActive–active
You need HA and scale in multiple regions. Passive standby wastes capacity; leader-follower has one region doing all the writes.
OpenActive–passive
You need HA but don't want the complexity or cost of active-active.
OpenFan-out
One event or write must be distributed to many consumers or write destinations.
OpenScatter–gather
You need to answer a query that requires data from multiple shards/services, and you need the aggregate result.
OpenBulkhead
One misbehaving caller or workload consumes all your resources (threads, connections, memory) and starves everyone else.
OpenCircuit breaker
A downstream service is unhealthy. Your service keeps calling it, waiting the full timeout on every call, exhausting your thread pool, and cascading the failure back to your callers.
OpenRetry with exponential backoff + jitter
Transient failures (network hiccup, brief overload) succeed on retry. Retrying immediately makes overload worse (retry storm).
OpenBackpressure
Producers publish faster than consumers can process. Queues grow unbounded, memory fills up, and everything crashes.
OpenRate limiting
One bad actor can consume all your capacity. And even good actors need bounds so you can capacity-plan.
OpenLoad shedding
Your system is overloaded. Continuing to accept work makes it worse (all requests get slow, none complete on time).
OpenStrangler-fig
You have a legacy monolith you want to replace, but a big-bang rewrite is too risky.
Open