Distributed-system Patterns Reference

Patterns for reliable communication and coordination across services.

Distributed-system Patterns Reference

Intent, fit, trade-offs, and relationships for resilient distributed systems.

Updated 2026-07-22

Timeout

Bound how long a caller waits for an operation.

AspectGuidance
Use whenRemote or resource-bound work may stall beyond useful latency.
Trade-offsA timeout does not cancel server work and poor thresholds create false failures.
RelatedRetry, Circuit Breaker

Retry

Repeat transiently failed operations with a limit, backoff, and jitter.

AspectGuidance
Use whenFailures are temporary and operations are safe to repeat.
Trade-offsRetries amplify overload and can duplicate non-idempotent effects.
RelatedTimeout, Circuit Breaker, Idempotent Consumer

Circuit Breaker

Fail fast after repeated dependency failures, then probe for recovery.

AspectGuidance
Use whenContinuing calls would waste resources or worsen a failing dependency.
Trade-offsThresholds and recovery states add complexity and can reject healthy calls.
RelatedRetry, Bulkhead

Bulkhead

Partition capacity so one workload or dependency cannot exhaust all resources.

AspectGuidance
Use whenFailures need isolation by tenant, endpoint, or dependency.
Trade-offsReserved capacity may sit idle and limits require tuning.
RelatedRate Limiting, Circuit Breaker

Rate Limiting

Control how much work a caller or system may submit over time.

AspectGuidance
Use whenCapacity, fairness, cost, or abuse must be bounded.
Trade-offsBursts and distributed counters complicate accuracy; rejected clients need guidance.
RelatedBackpressure, Bulkhead

Backpressure

Propagate saturation toward producers so demand follows available capacity.

AspectGuidance
Use whenAsynchronous pipelines can otherwise accumulate unbounded work.
Trade-offsRequires an end-to-end signal and a policy for slowing, buffering, or dropping.
RelatedRate Limiting, Load Balancing

Service Discovery

Resolve a logical service name to currently healthy instances.

AspectGuidance
Use whenInstances change dynamically under deployment, scaling, and failure.
Trade-offsRegistry freshness, startup ordering, and split-brain behavior matter.
RelatedHealth Check, Load Balancing

Load Balancing

Distribute work across eligible instances using a routing policy.

AspectGuidance
Use whenMultiple instances provide scale or availability.
Trade-offsUnequal work, session state, and stale health information reduce balance quality.
RelatedService Discovery, Health Check

Leader Election

Select one participant to coordinate an operation for a bounded term.

AspectGuidance
Use whenExactly one active coordinator is required at a time.
Trade-offsLeases, fencing, and network partitions must prevent stale leaders from acting.
RelatedQuorum, Consensus

Sidecar

Deploy supporting capabilities in a companion process beside each service instance.

AspectGuidance
Use whenNetworking, telemetry, or policy should be shared without changing application code.
Trade-offsAdds resource use, deployment coupling, and another failure boundary.
RelatedService Mesh, Ambassador

Strangler Fig

Replace a legacy system incrementally by redirecting slices of behavior.

AspectGuidance
Use whenA big-bang rewrite is too risky.
Trade-offsThe transition boundary and duplicate models may persist longer than planned.
RelatedAnti-corruption Layer, Facade

Replication

Maintain copies of data on multiple nodes.

AspectGuidance
Use whenReads need scale, locality, or tolerance of node failure.
Trade-offsConsistency, conflict resolution, lag, and failover become explicit concerns.
RelatedQuorum, Sharding

Sharding

Partition a data set across nodes according to a routing function.

AspectGuidance
Use whenOne node cannot hold or process the full data set.
Trade-offsCross-shard operations, rebalancing, and hot keys are difficult.
RelatedReplication, Consistent Hashing

Quorum

Require overlapping subsets of replicas for reads, writes, or decisions.

AspectGuidance
Use whenThe system balances consistency and availability across replica failures.
Trade-offsHigher quorum sizes increase latency and partitions can prevent progress.
RelatedReplication, Leader Election

Saga

Coordinate a business transaction as local commits followed by messages and compensations.

AspectGuidance
Use whenA transaction spans services that cannot share an ACID transaction.
Trade-offsIntermediate states are visible and compensations are domain-specific, not true rollback.
RelatedTransactional Outbox, Process Manager

CQRS

Use separate models for commands that change state and queries that read it.

AspectGuidance
Use whenRead and write needs differ materially in shape, scale, or consistency.
Trade-offsDuplication, synchronization, and eventual consistency add operational cost.
RelatedEvent Sourcing, Materialized View

Event Sourcing

Persist state as an ordered history of domain events.

AspectGuidance
Use whenAudit history, temporal reconstruction, or event-driven projections are core needs.
Trade-offsEvent evolution, replay, storage growth, and debugging require discipline.
RelatedCQRS, Snapshot

Transactional Outbox

Write business state and an outgoing-message record in the same local transaction.

AspectGuidance
Use whenDatabase changes and message publication must not diverge.
Trade-offsA relay, cleanup, ordering, and duplicate delivery still need handling.
RelatedSaga, Idempotent Consumer

Idempotent Consumer

Ensure repeat deliveries produce the same logical outcome as one delivery.

AspectGuidance
Use whenA broker or retry policy can deliver messages more than once.
Trade-offsDeduplication state, identity, and retention windows add storage and design cost.
RelatedTransactional Outbox, Retry

Health Check

Report whether an instance is alive and ready to receive work.

AspectGuidance
Use whenOrchestrators and routers must avoid unhealthy or unready instances.
Trade-offsOverly shallow checks lie; deep checks can cascade dependency failures.
RelatedService Discovery, Load Balancing

Correlation ID

Attach one identifier to related work across process and message boundaries.

AspectGuidance
Use whenLogs, traces, and support workflows must reconstruct a distributed operation.
Trade-offsEvery boundary must propagate it safely without treating it as authentication.
RelatedDistributed Tracing, Request ID

Description

Patterns for reliable communication and coordination across services.

References

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies