Distributed Pattern Diagrams
Four Communication Patterns
FlowRequest-response, scatter-gather, publish-subscribe, and event streaming.
Fan-Out and Competing Consumers
FlowEvery subscription gets a copy; one instance per subscription takes it.
Transactional Outbox
FlowThe event commits with the data, and a relay publishes it afterward.
Claim Check
C4 · DynamicThe payload goes to storage; only a reference crosses the broker.
Dead Letter Queue
FlowA message that keeps failing moves aside so the queue keeps flowing.
Priority Queues
FlowThree queues, drained by priority rather than arrival order.
Database per Service Versus Shared Database
StructureThree services with their own databases, or one database for all.
The Eventual Consistency Window
ChartTwo copies disagree between a write and convergence.
State-Based Storage Versus Event Sourcing
StructureCurrent state stored, or derived by replaying every change.
Snapshots in an Event Store
StructureReplay starts from the latest snapshot, not from event one.
CQRS
FlowWrites and reads go to separate models, synced after commit.
Orchestration and Choreography
FlowOne service calling the others in order, or services reacting to an event.
One Transaction Versus Separate Databases
StructureOne all-or-nothing commit, or three local commits with nothing tying them.
A Saga Succeeding and Compensating
FlowEach step commits locally; a failure runs compensations in reverse.
Compensatable, Pivot, and Retriable Steps
FlowThe pivot is the point of no return in a saga.
An Orchestrated Saga
C4 · DynamicThe orchestrator holds saga state and calls the compensations itself.
A Choreographed Saga
FlowA failure event travels upstream and each service compensates itself.
Leader Failover
State machineThe leader fails, followers notice, and a new leader is chosen.
Leader Lease
ChartA crashed leader's lease runs out before anyone else leads.
Lost Update Without a Lock
FlowTwo read-modify-writes race, and a distributed lock serializes them.
Lock Expiry Under a Paused Holder
FlowA paused holder's lock expires, and it writes anyway.
Fencing Token
FlowThe storage rejects a write whose token is older than one it has seen.
Consensus Write Path
C4 · DynamicA write commits once a majority of the cluster acknowledges it.
Retry Waves and Jitter
ChartClients that fail together retry together, unless jitter spreads them.
Circuit Breaker States
State machineClosed, open, and half-open, and what moves the breaker between them.
Bulkheads
StructureA hung dependency fills one shared pool, or only its own partition.
Resilience Layers
LayeringTotal timeout, retry, circuit breaker, and attempt timeout, outermost first.
Layer 4 and Layer 7 Balancing
FlowOne HTTP/2 connection, balanced as a connection or as requests.
Fixed Window Boundary Burst
ChartTwo full windows back to back let double the limit through.
Cache-Aside and Read-Through
FlowWho talks to the database: the application, or the cache.
Sharding by Key Range
StructureOne overloaded database split into three shards, with queries routed by key.
Consistent Hashing Ring
Dependency graphA new shard takes keys from one neighbor and leaves the rest in place.
Where Each Proxy Sits
C4 · ContainerBFFs per client experience, one gateway, and proxies beside each service.
Sidecar Proxy
C4 · DeploymentAll traffic in and out of the pod passes through the sidecar.
Ambassador
C4 · DeploymentThe application calls localhost, and the ambassador makes the real call.
Mesh Control and Data Planes
C4 · ContainerThe control plane configures proxies, and only the proxies carry requests.
Sidecar and Sidecarless Data Planes
C4 · DeploymentA proxy in every pod, or one per node plus shared layer 7 proxies.
Weighted Traffic Split
FlowThe caller's proxy sends 90% to the stable version and 10% to the canary.
Mesh Ingress and Egress Gateways
Trust boundaryOne controlled path into the mesh and one controlled path out.
Strangler Fig Stages
FlowA router moves capabilities to new code until the legacy system retires.
Anti-Corruption Layer
Trust boundaryOne layer translates between the new model and the legacy one.
Change Data Capture Pipeline
FlowThe legacy database's log feeds a new store that follows it.
Found this useful? Share it:
Share on LinkedIn