Gevawo Patterns
Object-oriented design pattern

Abstract Factory

Supply a factory interface that constructs matching members of a product family.

FamilyGoF · Creational
ScopeRelated object families
Editorial statusDraft

What it buys

A client can obtain a compatible family of products from one selection point.

Apply when

An application switches together between compatible widgets, drivers or rendering resources.

Reconsider when

Only one independent product varies.

Costs and failure modes

Introducing a product category forces every factory implementation to change.

Case file

A worked decision

A diagramming tool requests a matching group of canvas, font, and bitmap objects from a screen or print factory.

Change the condition

If only one product varies independently, a constructor or single factory function is sufficient.

Check the decision

Can a bitmap produced by one backend be passed into the incompatible canvas from another?

Relationships

Catalog note · Can use: Factory Method or Prototype

Referenced by other entries (1)

Sources

Design pattern

Acceptor-Connector

Separate passive acceptance and active connection setup from session handling.

FamilyConcurrency and network I/O
ScopeNetwork endpoint / connection
Editorial statusDraft

What it buys

Connection establishment can vary independently of the protocol handler that takes over an established session.

Apply when

Multiple transports or connection-initiation modes share session logic.

Reconsider when

One fixed connection has no separate setup policy.

Costs and failure modes

Setup failure and handoff require explicit ownership of the socket.

Case file

A worked decision

A gateway accepts device sessions and initiates upstream sessions while reusing the protocol handlers for established connections.

Change the condition

If the program opens one short-lived outbound connection, use the socket API directly.

Check the decision

Can the protocol handler run unchanged when a test peer initiates the connection from the opposite side?

Relationships

Catalog note · Complements: Reactor can dispatch acceptance events.

Sources

Conceptual distinction

Actions and calculations

Distinguish effectful or time-dependent operations from computations entirely determined by their inputs.

FamilyProgramming model and architecture
ScopeExpression, function or workflow
Editorial statusDraft

What it buys

Inputs that must be captured for a reproducible test become visible, including clocks, mutable reads, and external responses.

Apply when

A rule is difficult to test because it implicitly reads a clock, database or external service.

Reconsider when

A trivial adapter with no decision logic has little meaningful calculation to extract.

Costs and failure modes

Moving effects outward introduces explicit data flow and snapshot assumptions.

Case file

A worked decision

A ferry fare calculation quietly reads the current time and exchange rate. Capture both once, then calculate the fare from the trip, timestamp and rate as explicit inputs.

Change the condition

If a function only sends an already prepared passenger notification, no meaningful pricing calculation is hidden in that action.

Check the decision

Using the same captured inputs on another day, does the fare calculation produce the same result without contacting a service?

Relationships

Catalog note · Informs: Functional Core, Imperative Shell

Study this decision

Runnable labs

Sources

Design pattern

Active Object

Queue method requests and schedule them on an execution context owned by the object.

FamilyConcurrency and network I/O
ScopeObject / execution context
Editorial statusDraft

What it buys

A caller can submit work without blocking on a serialized device operation and later observe its completion through the request result.

Apply when

Callers must continue while a resource processes requests serially.

Reconsider when

A short locked method is sufficient and callers need immediate results.

Costs and failure modes

A backlog, cancellation or blocked executor can strand waiting callers.

Case file

A worked decision

A device driver serializes commands on a dedicated execution thread while callers submit requests and receive futures.

Change the condition

If callers already operate on the sole device thread, call methods synchronously.

Check the decision

Can a pending read be cancelled without leaving its future unresolved?

Relationships

Catalog note · Alternative: Monitor Object executes on the caller's thread.

Referenced by other entries (2)

Sources

Persistence pattern

Active Record

A record object combines domain data and behavior with persistence operations.

FamilyEnterprise persistence
ScopeRow-oriented domain object
Editorial statusDraft

What it buys

A small CRUD feature can load, change, and persist a row with little separate mapping or repository code.

Apply when

A simple application closely matches one object to one database row.

Reconsider when

The object model diverges from storage or business rules require storage-independent testing.

Costs and failure modes

Persistence concerns spread into domain objects and complicate isolated tests.

Case file

A worked decision

An internal equipment list has a row per projector and a handful of validations. Each record can validate its serial number and persist itself.

Change the condition

When persistence must span several tables and the equipment model needs historical identity rules, separate mapping may pay off.

Check the decision

Does testing the serial-number rule require creating a database record, and is that cost acceptable?

Relationships

Catalog note · Alternative: Data Mapper

Sources

Concurrency model

Actor Model

Encapsulate state and behavior behind an address and coordinate through asynchronous messages.

FamilyDistributed coordination models
ScopeIndependently addressed actors
Editorial statusDraft

What it buys

State transitions for one owner can be reviewed against its message-handling rules instead of tracing locks across every caller.

Apply when

Many independently changing entities can manage local state and protocols.

Reconsider when

One invariant must be updated atomically across many entities in each operation.

Costs and failure modes

Mailboxes can grow and a cross-actor decision becomes a distributed protocol.

Case file

A worked decision

Each live auction owns its bid state in an actor and handles bid messages one at a time.

Change the condition

If bids are infrequent database transactions, serialize them in the database.

Check the decision

Do two simultaneous bids produce a valid winner under the actor's declared arrival-order policy?

Relationships

Catalog note · Complements: Supervision Tree can supply recovery policy to an actor runtime.

Referenced by other entries (3)

Study this decision

Sources

BPMN construct

Ad Hoc Subprocess

Provide eligible activities that can be selected, repeated or skipped as the case unfolds.

FamilyHuman and case workflows
ScopeCase or investigation
Editorial statusDraft

What it buys

A caseworker can pursue evidence in the order it becomes available while retaining a visible record of the work undertaken.

Apply when

Investigation or remediation depends on facts discovered during execution.

Reconsider when

The domain requires a fixed mandatory sequence with simple completion criteria.

Costs and failure modes

Auditability depends on recording why activities were chosen. Completion and authorization require design.

Case file

A worked decision

A fraud investigator chooses interviews and evidence checks in an order that depends on each case.

Change the condition

If policy mandates the same evidence sequence for every case, model explicit steps.

Check the decision

Can the case close while a mandatory identity check is outstanding?

Relationships

Catalog note · Can contain Human Task when case workers select the next action.

Sources

Object-oriented design pattern

Adapter

Translate the interface expected by a caller into operations on an existing implementation.

FamilyGoF · Structural
ScopeObject or library boundary
Editorial statusDraft

What it buys

An existing component can satisfy a client's expected interface without changing either contract.

Apply when

Existing components offer compatible behavior through incompatible interfaces.

Reconsider when

Both sides are under one team's control and can cheaply adopt the same contract.

Costs and failure modes

Translation can mask incompatible semantics, errors or performance.

Case file

A worked decision

A reporting engine expects a row cursor, so an adapter translates a vendor SDK's paginated records and error model into that interface.

Change the condition

If the caller can naturally consume the SDK contract and no other client needs interoperability, use the SDK directly.

Check the decision

What happens when the cursor advances across a failed or empty page?

Relationships

Catalog note · Can implement a port in: Hexagonal Architecture / Ports and Adapters

Referenced by other entries (3)

Sources

Tactical design pattern

Aggregate

A root controls changes to a cluster of objects whose invariants must hold together.

FamilyDomain modeling
ScopeTransactional consistency boundary
Editorial statusDraft

What it buys

An update can enforce the whole business invariant at one controlled consistency boundary.

Apply when

A business rule must hold at transaction commit despite competing updates.

Reconsider when

A proposed aggregate includes independently changing objects linked only for convenient navigation.

Costs and failure modes

Oversized aggregates create contention and unnecessary loads.

Case file

A worked decision

A conference basket caps the number of discounted tickets per basket. All additions go through its root and concurrency check.

Change the condition

If discounts are independent per ticket and no cross-item invariant exists, separate records avoid contention on one root.

Check the decision

With one discounted slot left in the same basket, can two simultaneous additions both commit?

Relationships

Catalog note · Persisted through: Repository

Referenced by other entries (1)

Sources

Integration pattern

Aggregator

Collect correlated inputs until an explicit completion condition permits an output.

FamilyMessage routing
ScopeIntegration flow
Editorial statusDraft

What it buys

A downstream client can consume one summary of a correlated group instead of tracking each partial response and its completion state.

Apply when

Partial quotes must be combined into a single response.

Reconsider when

Each arrival can be consumed independently without a joint result.

Costs and failure modes

Missing or duplicate parts require timeouts, durable state and a completion policy.

Case file

A worked decision

A flight-search service combines replies from several carriers for one search ID. It completes on a deadline and marks which carriers did not respond instead of treating silence as an empty schedule.

Change the condition

If the UI can display each carrier's independent result as it arrives, keeping a central result set may add unneeded latency and state.

Check the decision

Deliver a duplicate reply and a late reply after the deadline and verify that the final result remains consistent with its completion rule.

Relationships

Catalog note · Composes with Splitter and Scatter–Gather.

Referenced by other entries (2)

Sources

Network helper pattern

Ambassador

Use a helper proxy to issue outbound network requests on an application's behalf.

FamilyCloud infrastructure
ScopeClient-side process boundary
Editorial statusDraft

What it buys

Several client runtimes can share outbound connection behavior and policy through one deployable helper.

Apply when

Legacy or polyglot clients need uniform network behavior without repeated client changes.

Reconsider when

A single client has mature built-in connectivity and little shared policy.

Costs and failure modes

Another hop introduces latency and a new component to diagnose.

Case file

A worked decision

A legacy importer sends outbound requests to a local helper that adds mutual TLS and discovers the current destination.

Change the condition

If a single modern client already owns those functions, a configured client library is simpler.

Check the decision

Can the importer distinguish an unavailable local helper from an unavailable remote endpoint?

Relationships

Catalog note · Can be deployed as: Sidecar

Sources

Integration pattern

Anti-Corruption Layer

Translate behavior and data at the boundary so an external model cannot dictate local meaning.

FamilyDomain boundaries
ScopeBoundary between unlike models
Editorial statusDraft

What it buys

A partner's renamed status codes can be accommodated in one translator while local business rules keep their established meanings.

Apply when

A legacy or vendor model conflicts with important rules or vocabulary in the new system.

Reconsider when

The two sides already share semantics and translation adds only copying.

Costs and failure modes

The translation layer requires semantic tests and ongoing maintenance as either side changes.

Case file

A worked decision

A new hospital scheduling system translates an old billing code called a visit into the new model's encounter, booking or adjustment before scheduling rules see it.

Change the condition

If both teams already use the same definition and change the schema together, a separate translation layer can distort rather than protect meaning.

Check the decision

Give the adapter a billing adjustment and check that no patient appointment is created.

Relationships

Catalog note · Can be introduced with: Strangler Fig

Referenced by other entries (2)

Sources

Network deployment technique

Anycast Service Distribution

Advertise one service address from several sites so routing selects a reachable instance.

FamilyNetwork architecture and protocols
ScopeNetwork routing / service sites
Editorial statusDraft

What it buys

A distributed service can advertise one address at multiple sites and rely on routing changes to direct future traffic to a reachable announcement.

Apply when

Clients can use interchangeable sites and local routing can select a nearby path.

Reconsider when

Long-lived sessions require a stable site and no state migration mechanism exists.

Costs and failure modes

Route changes can move traffic to an instance without the session state.

Case file

A worked decision

A DNS operator announces one service address from several sites so Internet routing can deliver queries to an available route.

Change the condition

If clients require a long stateful session tied to one site, use a stable site-specific endpoint.

Check the decision

After route withdrawal, can a query reach another site without depending on per-client session state?

Relationships

Catalog note · Alternative: application-level load balancing.

Sources

Architecture pattern

API Composition

Ask authoritative services for data and join the results in an API component.

FamilyService data boundaries
ScopeCross-service query
Editorial statusDraft

What it buys

A client receives a joined view of independently owned data without gaining access to each service's internal tables.

Apply when

A low-volume screen combines a few small records from different owners.

Reconsider when

Fan-out, result size or latency makes request-time joins expensive.

Costs and failure modes

Partial failures, skewed read times and slow services affect the result.

Case file

A worked decision

An order-details screen combines shipment status and invoice metadata from separately owned APIs at request time.

Change the condition

If joins dominate a high-volume dashboard and lag is acceptable, maintain a local read view.

Check the decision

What does the order screen display if shipping answers but invoicing times out?

Relationships

Catalog note · Alternative to a CQRS read model for cross-service views.

Referenced by other entries (1)

Sources

Architecture pattern

API Gateway

Put a stable client-facing gateway in front of service-specific endpoints.

FamilyService access and discovery
ScopeClient-facing boundary
Editorial statusDraft

What it buys

Published clients can keep one stable interface while backend teams relocate services or revise internal routing.

Apply when

External clients would otherwise discover many services or perform repeated round trips.

Reconsider when

One stable service already supplies the complete client contract.

Costs and failure modes

The gateway adds a hop and can become a shared deployment bottleneck.

Case file

A worked decision

A mobile checkout needs a stable public endpoint while pricing and fulfillment change independently behind it.

Change the condition

If one application serves the sole client, expose its existing handler.

Check the decision

Can pricing and fulfillment move hosts without changing the mobile contract?

Relationships

Catalog note · Can host API Composition.

Referenced by other entries (2)

Sources

Allocation strategy

Arena allocation

Allocate many related objects from a region and release the region as a unit.

FamilyResource lifetime and ownership
ScopeResource or process lifetime
Editorial statusDraft

What it buys

A parser can release an entire batch of short-lived syntax nodes with one region reset.

Apply when

Objects share a well-defined phase lifetime and individual reclamation has little value.

Reconsider when

A few long-lived objects would pin an otherwise disposable large arena.

Costs and failure modes

Memory cannot be reclaimed individually without extra mechanisms. Cleanup of nonmemory resources is separate.

Case file

A worked decision

A compiler allocates analysis nodes for one translation unit and discards the arena after emission.

Change the condition

A language server retaining selected nodes across edits needs separate ownership or smaller arenas.

Check the decision

Which pointer, if retained after the phase, would refer to released arena memory?

Relationships

Sources

Design pattern

Asynchronous Completion Token

Pass caller-selected context with a request and recover it on completion.

FamilyConcurrency and network I/O
ScopeOperation / callback
Editorial statusDraft

What it buys

Out-of-order completions can reach the correct client without a global assumption about which request finishes first.

Apply when

Many pending operations require different continuations or state.

Reconsider when

One outstanding operation per session already identifies its context.

Costs and failure modes

Stale tokens or early resource release can corrupt a later callback.

Case file

A worked decision

A server issues overlapping disk reads and attaches request context to each operation so completions find the proper client.

Change the condition

If only one read can be outstanding, keep the context in the calling frame.

Check the decision

If the second read finishes first, which client receives its bytes?

Relationships

Catalog note · Complements: Proactor.

Sources

Authorization model

Attribute-based access control

Evaluate subject, resource, action and environment attributes against policies.

FamilySecurity architecture
ScopeApplication or organization
Editorial statusDraft

Also indexed as · ABAC

What it buys

Access can respond to resource ownership or request context without creating a new role for every combination.

Apply when

A decision depends on ownership, classification, purpose or time as well as role.

Reconsider when

A few stable roles capture the actual access rules.

Costs and failure modes

Inconsistent or stale attribute sources can produce wrong decisions.

Case file

A worked decision

A records portal permits access only when the clinician's department, current care relationship, and document classification satisfy policy.

Change the condition

If one small team shares a fixed permission set, a role assignment is easier to audit.

Check the decision

When a care relationship changes mid-session, how quickly does the authorization decision change?

Relationships

Catalog note · Complements: Externalized authorization policy

Referenced by other entries (3)

Sources

Client integration pattern

Backend for Frontend

Provide a backend tailored to one frontend's workflow and delivery needs.

FamilyService architecture
ScopeAPI boundary per client experience
Editorial statusDraft

What it buys

A mobile screen can fetch the fields it needs in one tailored request without forcing desktop clients to adopt the same response.

Apply when

Clients differ materially in payloads, latency budgets, ownership or release cadence.

Reconsider when

Consumers make essentially identical requests under the same team.

Costs and failure modes

Duplicated logic and extra deployables become expensive without firm responsibility boundaries.

Case file

A worked decision

A field technician's phone needs a short offline-ready job summary, while the dispatcher needs a detailed map and staff availability. Give each client a backend that assembles its own response.

Change the condition

When both screens need precisely the same representation and change together, one endpoint is simpler.

Check the decision

Change the mobile summary and check that the dispatch client needs neither a release nor a larger payload.

Relationships

Catalog note · Complements: Micro Frontends

Referenced by other entries (1)

Sources

Search technique

Backtracking search

Choose a candidate, extend it under constraints, and undo the choice when it cannot succeed.

FamilyLogic and search
ScopeConstraint model or search space
Editorial statusDraft

What it buys

A planner can recover from an early dead end and try another choice without manually enumerating complete schedules.

Apply when

A solution needs interdependent choices for which a greedy commitment can block a valid result.

Reconsider when

The problem has independent choices or a reliable direct construction.

Costs and failure modes

Large branching factors can explode the search and a poor ordering may hide easy solutions.

Case file

A worked decision

A puzzle assigns digits to letters. Reject partial assignments that conflict, then try the next candidate.

Change the condition

A lookup table already maps each code to one known digit, so there is no search problem.

Check the decision

Can a choice made early be undone without leaking changes into the next branch?

Relationships

Sources

Architectural style

Big compute architecture

Distribute compute-intensive work over a pool of scheduled nodes and aggregate outputs.

FamilyParallel computation
ScopeCompute fleet
Editorial statusDraft

What it buys

A long computation can finish sooner by distributing enough independently executable work over a fleet.

Apply when

A simulation or rendering batch contains enough independent work to absorb scheduling overhead.

Reconsider when

A serial dependency chain or excessive data transfer prevents parallel speedup.

Costs and failure modes

Provisioning, data movement, checkpoints and stragglers govern completion time.

Case file

A worked decision

A genomics lab provisions a temporary fleet to align independent samples and consolidates versioned results in durable storage.

Change the condition

For a single small sample due tomorrow, one workstation may meet the deadline at lower coordination cost.

Check the decision

Do transfer, startup, and result consolidation still fit the turnaround target?

Relationships

Catalog note · Can use: Data Parallelism

Referenced by other entries (1)

Sources

Architectural pattern

Blackboard

Knowledge sources contribute partial hypotheses to a common problem state under a control policy.

FamilyStructural architecture
ScopeProblem-solving system
Editorial statusDraft

What it buys

Independent specialists can refine a partial answer as evidence arrives, including when no specialist can solve the whole problem alone.

Apply when

An interpretation or recognition task needs different heuristics whose order cannot be predicted.

Reconsider when

A deterministic sequence of complete transformations already solves the task.

Costs and failure modes

Progress and termination depend on scheduling and conflict resolution.

Case file

A worked decision

A wildlife-monitoring system writes uncertain detections to a common board. Audio, video and location specialists refine a candidate only when new evidence makes their inference possible.

Change the condition

If every recording follows the same fixed sequence of three transformations, a pipeline states the work more clearly.

Check the decision

Can an audio-only sighting later be revised by video evidence without changing the audio specialist?

Relationships

Catalog note · Specializes: Shared Repository Architecture

Referenced by other entries (1)

Sources

Release pattern

Blue-green deployment

Switch traffic between two independently deployable environments.

FamilyRelease architecture
ScopeDeployment fleet
Editorial statusDraft

What it buys

Traffic can return quickly to the previous environment when state and schema remain compatible.

Apply when

Fast traffic cutover and rollback justify duplicate capacity.

Reconsider when

Old and new releases cannot coexist with the same database schema.

Costs and failure modes

Traffic can roll back faster than irreversible data changes.

Case file

A worked decision

An operator deploys a full green checkout stack, verifies it, then switches traffic away from blue while retaining blue for rollback.

Change the condition

When duplicate capacity is prohibitive and mixed versions are compatible, a rolling deployment consumes less spare capacity.

Check the decision

Can blue still read orders written after traffic switched to green?

Relationships

Catalog note · Complements: Expand and contract

Sources

Ownership technique

Borrowed access

Allow temporary access to an object while another owner controls its lifetime.

FamilyResource lifetime and ownership
ScopeResource or process lifetime
Editorial statusDraft

What it buys

A helper can inspect an owner's large buffer without copying it or assuming responsibility for releasing it.

Apply when

A caller needs to inspect or temporarily mutate data without transferring or copying it.

Reconsider when

A downstream worker must keep the data after its owner is free to release it.

Costs and failure modes

Lifetimes restrict how references can be stored, shared and returned.

Case file

A worked decision

A parser borrows a slice of a request buffer while the request is alive and returns an owned summary.

Change the condition

If tokens are kept by an asynchronous indexer after the buffer is reused, copy or transfer the required payload.

Check the decision

Can a consumer store a reference past the last valid lifetime of its owner?

Relationships

Referenced by other entries (1)

Study this decision

Sources

Concurrency pattern

Bounded channel pipeline

Pass work through bounded queues so a slower consumer can constrain its producer.

FamilyConcurrency boundaries
ScopeTask, process or partition
Editorial statusDraft

Also indexed as · Bounded buffer pipeline

What it buys

A queue capacity gives operators an upper bound on buffered items at that handoff and exposes when producers must slow down.

Apply when

Stages have different service times and buffering must respect a memory or latency budget.

Reconsider when

All steps are fast, sequential and run on one thread without blocking.

Costs and failure modes

Blocking sends, cancellation and shutdown ordering can deadlock or leak workers.

Case file

A worked decision

A video decoder hands frames to a thumbnail writer with a two-frame buffer. When disk slows, the decoder waits rather than accumulating frames.

Change the condition

A small command that processes one file at a time needs no queue.

Check the decision

If the writer exits after one frame, do producer and decoder stop and release their buffers?

Relationships

Sources

Strategic design pattern

Bounded Context

Define the boundary inside which a domain vocabulary and model have consistent meanings.

FamilyDomain boundaries
ScopeModel and ownership boundary
Editorial statusDraft

What it buys

Teams can model an account differently for billing and authentication while retaining an unambiguous vocabulary inside each boundary.

Apply when

Different teams use the same terms for legitimately different concepts or lifecycles.

Reconsider when

A proposed split cuts a tightly coupled invariant without a workable coordination model.

Costs and failure modes

Interfaces require explicit translation, and context discovery takes domain expertise.

Case file

A worked decision

A marketplace distinguishes a product offered for sale from a product that a warehouse picks. Separate models allow a single offer to refer to a kit containing several stocked items.

Change the condition

If both teams use product with identical identity and invariants, maintaining two translations has little benefit.

Check the decision

Ask both teams what uniquely identifies a product, and test the answer against a bundled kit.

Relationships

Catalog note · Documented by: Context Map

Referenced by other entries (2)

Study this decision

Sources

Lifecycle strategy

Bounded Graceful Shutdown

Request cooperative termination, then force an exit after a deadline.

FamilyDaemon lifecycle and supervision
ScopeService manager / process group
Editorial statusDraft

What it buys

A deployment can let work finish when possible while bounding how long an unhealthy or overloaded worker delays replacement.

Apply when

A stopping service should release resources but deployment must eventually proceed.

Reconsider when

External effects cannot finish within the grace period without durable recovery.

Costs and failure modes

Forced termination may interrupt an in-flight operation after it changed external state.

Case file

A worked decision

A worker leaves discovery, stops accepting jobs and drains in-flight image conversions until a termination deadline.

Change the condition

If every job is instantly and safely replayable, stop promptly and let the queue redeliver.

Check the decision

When the deadline expires mid-conversion, can another worker finish without publishing a partial image?

Relationships

Catalog note · Complements: Readiness Notification handles the opposite lifecycle boundary.

Study this decision

Sources

Resilience pattern

Bounded Retry with Backoff and Jitter

Retry selected transient failures within a deadline and attempt budget, spacing attempts with randomized delays.

FamilyFault isolation and overload
ScopeRemote call
Editorial statusDraft

What it buys

Transient failures can recover within a caller's budget while randomized waits reduce synchronized bursts of retries.

Apply when

A temporary communication failure can clear and the operation is safe to repeat.

Reconsider when

The error is permanent, the system is overloaded, or a timed-out side effect cannot safely be repeated.

Costs and failure modes

Retries across layers multiply demand. The delay consumes a caller’s remaining deadline.

Case file

A worked decision

A client retries idempotent metadata reads after transient overload with randomized delays and a deadline.

Change the condition

If input validation rejects the same malformed identifier, return the error immediately.

Check the decision

Can all attempts and waits together exceed the caller's deadline?

Relationships

Catalog note · Often requires Idempotent Receiver for side-effecting requests.

Referenced by other entries (2)

Study this decision

Sources

Migration pattern

Branch by Abstraction

Introduce an abstraction and gradually redirect clients between old and replacement implementations.

FamilyModernization
ScopeInternal component replacement
Editorial statusDraft

What it buys

A replacement implementation can serve a few callers in production while the rest continue using the old implementation.

Apply when

A dependency replacement must span multiple releasable commits.

Reconsider when

A small change can be safely made atomically or the seam would survive without purpose.

Costs and failure modes

Dual implementations and temporary switches add overhead until removal.

Case file

A worked decision

A search service must replace its ranking engine while receiving traffic. Route ranking calls through a narrow interface, compare recorded queries against both engines and switch callers gradually.

Change the condition

If the engine has one offline caller and a short maintenance window, replace it directly behind that caller.

Check the decision

Can one configuration change return all ranking calls to the old engine before its data is removed?

Relationships

Catalog note · Related at application scale: Strangler Fig

Study this decision

Sources

Object-oriented design pattern

Bridge

Give an abstraction a reference to an implementation hierarchy so both dimensions can evolve separately.

FamilyGoF · Structural
ScopeTwo independently varying object families
Editorial statusDraft

What it buys

An abstraction and its implementation can vary independently without multiplying subclasses for every combination.

Apply when

Multiple kinds of control must work with multiple backends, and both sets change.

Reconsider when

Only one dimension varies or the combinations are permanently fixed and small.

Costs and failure modes

Two abstractions and their compatibility contract require maintenance.

Case file

A worked decision

A map toolkit separates map controls from drawing backends so touchscreen and desktop controls can both target raster and vector output.

Change the condition

If drawings have one backend and no independent variation, defer the abstraction until a second axis appears.

Check the decision

Can a new backend be added without subclassing every control?

Relationships

Catalog note · Contrasts with retrospective interface translation in: Adapter

Sources

Architectural pattern

Broker Architecture

An intermediary locates service providers and mediates remote requests, replies and exceptions.

FamilyStructural architecture
ScopeDistributed object or service invocation
Editorial statusDraft

What it buys

A client can keep using its service contract when the provider moves to another host.

Apply when

Clients must invoke interchangeable or relocatable remote providers through a common interface.

Reconsider when

A small, fixed topology can use direct calls and does not need mediation.

Costs and failure modes

The broker adds latency and a failure dependency and cannot hide remote partial failures.

Case file

A worked decision

A lab workstation requests instrument calibration through a broker which locates an available instrument service and mediates invocation. Drivers can move without changing each client.

Change the condition

For one permanently attached instrument, a local adapter and direct call expose failures more clearly.

Check the decision

Move the service to a new endpoint and test whether an unchanged client can still calibrate and receive a failure reason.

Relationships

Catalog note · Related: Remote Facade

Sources

Object-oriented design pattern

Builder

Accumulate construction steps separately from the final representation.

FamilyGoF · Creational
ScopeComplex object construction
Editorial statusDraft

What it buys

A complex object can be assembled in stages while construction details stay outside the calling code.

Apply when

Construction has meaningful stages, alternative representations or cross-field validation at completion.

Reconsider when

A small immutable record with named arguments makes all valid inputs clear.

Costs and failure modes

Mutable builders can expose invalid intermediate states or hidden ordering constraints.

Case file

A worked decision

An export service assembles a signed archive in stages, validating its manifest and required files before handing it to callers.

Change the condition

For a value with two mandatory parameters, a checked constructor is smaller and clearer.

Check the decision

Can any builder path return an archive missing its required manifest?

Relationships

Catalog note · Contrasts with: Abstract Factory

Referenced by other entries (1)

Sources

Parallel computation model

Bulk Synchronous Parallel (BSP)

Run local work and communication in supersteps separated by synchronization barriers.

FamilyParallel and scientific computing
ScopeDistributed superstep
Editorial statusDraft

What it buys

Clear synchronization boundaries simplify reasoning about which messages are visible in a parallel superstep.

Apply when

A graph or numerical algorithm naturally uses iteration-wide synchronization.

Reconsider when

Most partitions could advance independently and latency is critical.

Costs and failure modes

A slow participant delays every participant at the barrier.

Case file

A worked decision

A graph traversal advances one frontier per superstep and exchanges newly reached vertices before the next round.

Change the condition

For independent image transformations, per-round barriers would unnecessarily idle fast workers.

Check the decision

How much of each superstep do workers spend waiting for the slowest partition?

Relationships

Catalog note · Contrast: Task Dependency Graph schedules at task granularity.

Referenced by other entries (1)

Sources

Resilience pattern

Bulkhead

Separate execution or connection capacity into independent pools.

FamilyFault isolation and overload
ScopeRuntime resource pools
Editorial statusDraft

What it buys

A failing optional dependency can exhaust its own concurrency allowance while capacity remains available to an essential operation.

Apply when

One slow dependency or tenant can exhaust capacity used by healthy requests.

Reconsider when

Isolation consumes scarce resources without a meaningful failure boundary.

Costs and failure modes

An idle pool cannot automatically rescue a saturated one. Sizing matters.

Case file

A worked decision

A checkout service reserves separate concurrency pools for payment authorization and optional recommendations.

Change the condition

If both workloads are cheap with identical failure behavior, use one bounded pool.

Check the decision

When recommendations exhaust their pool, can payment authorizations still acquire capacity?

Relationships

Catalog note · Complements Circuit Breaker by bounding resources consumed during failure.

Referenced by other entries (1)

Sources

Caching pattern

Cache-Aside

Read a cache first and populate misses from an authoritative store.

FamilyData access and caching
ScopeApplication and store
Editorial statusDraft

What it buys

Frequently reused rows can be served without executing the same authoritative read on each request.

Apply when

Repeated reads are expensive and bounded staleness is acceptable.

Reconsider when

Keys are almost never reused or stale responses would violate an invariant.

Costs and failure modes

Miss storms, invalidation races and cold-start load can hurt the origin.

Case file

A worked decision

A product service checks a cache for a description, loads misses from its catalog, and invalidates the entry after edits.

Change the condition

For a rarely read catalog with cheap indexed lookups, read directly from the database.

Check the decision

Can a concurrent miss repopulate stale data after invalidation?

Relationships

Catalog note · Alternative: Read-through cache

Referenced by other entries (2)

Sources

BPMN construct

Call Activity

Invoke a reusable process definition as a separate child instance with mapped inputs and outputs.

FamilyWorkflow control flow
ScopeParent and child process definitions
Editorial statusDraft

What it buys

Multiple processes can invoke a shared, versioned procedure and handle its completion without duplicating its internal workflow.

Apply when

Several processes reuse a compliance or verification subprocess with its own lifecycle.

Reconsider when

A short group of steps is only meaningful inside one parent process.

Costs and failure modes

Version selection, child cancellation and variable mapping become explicit contracts.

Case file

A worked decision

Loan origination and account reopening invoke the same versioned identity-verification process.

Change the condition

If identity verification is one local predicate, call the function directly.

Check the decision

Which verification version resumes for a loan started before a policy release?

Relationships

Catalog note · Composes with Multi-Instance Activity to invoke one subprocess per input.

Sources

Release pattern

Canary release

Expose a limited population to a new version and compare operational signals.

FamilyRelease architecture
ScopeDeployment fleet
Editorial statusDraft

What it buys

A regression can be detected in a small exposed group before it reaches the rest of the fleet.

Apply when

Traffic volume and signals can reveal a regression before broad exposure.

Reconsider when

Rare failures are invisible in the sample or the new side effect cannot be contained.

Costs and failure modes

Biased cohorts and poor metrics create false confidence.

Case file

A worked decision

A search team routes a small stable cohort to a new ranking service and compares latency and error rates before expanding.

Change the condition

For a low-traffic internal tool with no meaningful cohort signal, a supervised cutover may be clearer.

Check the decision

Does the cohort include expensive queries, and is exposure large enough to observe the rollback threshold?

Relationships

Catalog note · Alternative rollout control: Blue-green deployment

Referenced by other entries (3)

Sources

Integration pattern

Canonical Data Model

Translate interoperating formats through an agreed intermediate representation.

FamilyMessage contracts
ScopeApplication integration
Editorial statusDraft

What it buys

A newly connected system can translate to a common exchange model instead of implementing a mapping to each peer's format.

Apply when

Many applications exchange overlapping concepts and pairwise mappings proliferate.

Reconsider when

Two applications share a narrow stable contract, or meanings differ by context.

Costs and failure modes

Governing the model and versioning shared meanings can slow independent teams.

Case file

A worked decision

An auction house translates three partners' bid formats into one internal interchange model for lot ID, currency and bid amount. Each consumer reads the canonical message rather than every partner format.

Change the condition

When there are only two partners and their terms differ irreducibly, a narrowly scoped bilateral translation may be more accurate.

Check the decision

Encode a bid in each partner's format and verify the same financial meaning survives translation.

Relationships

Catalog note · Complements Content-Based Router when routes use shared metadata.

Referenced by other entries (1)

Sources

Fault-isolation architecture

Cell-based architecture

Partition traffic into isolated cells with bounded capacity and failure scope.

FamilyCloud infrastructure
ScopeSystem or tenant group
Editorial statusDraft

What it buys

A fault affecting one cell need not consume the capacity or availability of independent cells.

Apply when

One tenant or overloaded subsystem must not disable the whole service.

Reconsider when

Cells still share a synchronous critical dependency that dominates outages.

Costs and failure modes

Routing, rebalancing and spare capacity become part of reliability engineering.

Case file

A worked decision

A payments platform partitions merchants into independently provisioned cells so one noisy merchant group cannot starve the entire fleet.

Change the condition

If all cells share the same saturated database, fix the shared bottleneck before adding cells.

Check the decision

During a forced cell outage, which merchants outside it lose service?

Relationships

Catalog note · Can use: Deployment stamps

Referenced by other entries (2)

Sources

Object-oriented design pattern

Chain of Responsibility

Offer a request to a sequence of handlers that may handle it or pass it onward.

FamilyGoF · Behavioral
ScopeRequest handling within a component
Editorial statusDraft

What it buys

Request handlers can be reordered or extended without coupling the sender to every handling decision.

Apply when

Responsibility depends on request content and the handler order varies.

Reconsider when

One known receiver always handles the request or every stage must run as a transformation.

Costs and failure modes

Requests can go unhandled and reordering changes outcomes.

Case file

A worked decision

A support-ticket request passes through handlers for automatic resolution, specialist routing, and escalation until one accepts it.

Change the condition

When every input maps directly to one handler by a stable key, use a dispatch table.

Check the decision

Can a handler both resolve a ticket and accidentally forward it for a second resolution?

Relationships

Catalog note · Contrasts with the stage contract in: Pipes and Filters

Sources

Coordination style

Choreography

Each participant reacts to events and emits subsequent facts without a central director.

FamilyWorkflow coordination
ScopeMultiple services
Editorial statusDraft

What it buys

An independently owned consumer can add a response to a business event without changing a central coordinator's sequence.

Apply when

A short process has independent participants and few dependencies.

Reconsider when

Global deadlines, long compensation chains or audit requirements make implicit control flow hard to trace.

Costs and failure modes

Cycles and missing transitions are hard to diagnose across teams.

Case file

A worked decision

After dispatch, independent subscribers update loyalty points and delivery estimates in response to a shipment event.

Change the condition

If one owner must enforce a strict cross-team approval sequence, coordinate those steps centrally.

Check the decision

Can a delayed loyalty update inadvertently block delivery estimation?

Relationships

Catalog note · Alternative to Process Manager and one way to coordinate Saga.

Referenced by other entries (1)

Study this decision

Sources

Resilience pattern

Circuit Breaker

Temporarily reject calls to a failing dependency and probe for recovery.

FamilyFault isolation and overload
ScopeRemote dependency
Editorial statusDraft

What it buys

Callers can stop spending connection slots and deadline budget on a persistently failing dependency while limiting recovery probes.

Apply when

Repeated calls consume time and capacity while a dependency remains unhealthy.

Reconsider when

A validation error is permanent, or occasional safely retried transient failures dominate.

Costs and failure modes

Thresholds can trip too early or hide recovery. Half-open traffic needs limits.

Case file

A worked decision

An image API repeatedly times out, so the caller opens a breaker, serves placeholders and permits limited recovery probes.

Change the condition

If a single optional image lookup is rare and failure is cheap, use a deadline and fallback.

Check the decision

When the image API comes back, how many probes can enter before normal traffic resumes?

Relationships

Catalog note · Complements Bounded Retry with Backoff and Jitter.

Referenced by other entries (1)

Sources

Integration pattern

Claim Check

Store a large payload separately and send a reference in the message.

FamilyMessage contracts
ScopeMessage and payload stores
Editorial statusDraft

What it buys

Large attachments can bypass a broker's message-size limit while ordinary routing handles a compact reference.

Apply when

Documents exceed broker limits or make fan-out prohibitively expensive.

Reconsider when

Small messages benefit from carrying all data in one delivery.

Costs and failure modes

Payload lifetime, permissions and message retries must agree or references break.

Case file

A worked decision

A lab sends a blob identifier and integrity digest through its broker while storing the original microscopy image in a protected object store. Consumers retrieve the image only when needed.

Change the condition

If each result is a tiny text observation, inline data avoids an additional storage fetch and expiration policy.

Check the decision

Delay a consumer past its normal processing window and verify that the object still exists and unauthorized consumers cannot fetch it.

Relationships

Catalog note · Composes with Publish–Subscribe Channel for large shared payloads.

Sources

Architectural approach

Clean Architecture

Direct source dependencies inward toward business policy and invert dependencies at outward interactions.

FamilyApplication boundaries
ScopeApplication policy and mechanisms
Editorial statusDraft

What it buys

A change to database or UI technology can leave business-policy code and its tests untouched.

Apply when

Business rules must survive changes in storage, delivery or application frameworks.

Reconsider when

The application has little durable policy and most layers merely copy records.

Costs and failure modes

Boundary models and mappings increase work and can drift.

Case file

A worked decision

A scholarship office changes eligibility rules each term and replaces its portal less often. Put the admission use case behind inward-facing contracts so a new portal can submit the same application.

Change the condition

A short-lived sign-up form with no decisions beyond field validation can use a direct handler.

Check the decision

Can the eligibility review run from an in-memory fixture without importing the web or persistence framework?

Relationships

Catalog note · Related: Hexagonal Architecture / Ports and Adapters

Referenced by other entries (1)

Sources

Discovery pattern

Client-Side Service Discovery

Clients consult a registry and select a service instance for the request.

FamilyService access and discovery
ScopeClient and service fleet
Editorial statusDraft

What it buys

A client can select a nearby replica or avoid a known bad endpoint without sending every request through a separate routing service.

Apply when

A controlled client platform needs endpoint-aware balancing or routing.

Reconsider when

Many incompatible client stacks would need discovery and balancing logic.

Costs and failure modes

Stale client caches can route traffic to dead or removed instances.

Case file

A worked decision

An internal RPC client chooses a nearby healthy search replica using a watched endpoint list.

Change the condition

If unmanaged clients cannot consume discovery updates, put endpoint selection behind a proxy.

Check the decision

After a replica retires, how long does this client keep opening connections to it?

Relationships

Catalog note · Uses Service Registry, unlike routing through a discovery proxy.

Sources

Architectural style

Client–Server

A client initiates interaction with a server that owns a service.

FamilyNetwork architecture and protocols
ScopeNetwork roles
Editorial statusDraft

What it buys

Several clients can use one authority for shared rules and records without each maintaining an independent copy of the decision logic.

Apply when

Many clients need one independently controlled service or authoritative resource.

Reconsider when

Peers must continue cooperating when a central service is unreachable.

Costs and failure modes

Server outages and network latency become visible to clients.

Case file

A worked decision

A clinic's terminals submit bookings to an authoritative scheduling server shared by reception staff.

Change the condition

If one offline terminal owns the full appointment book, persist locally.

Check the decision

What booking behavior does a terminal offer during a server outage?

Relationships

Catalog note · Alternative: Peer-to-Peer.

Referenced by other entries (1)

Sources

Architectural style

Closed-loop process control

Measure a controlled variable, compare it with a target and adjust an actuator in a feedback loop.

FamilyEmbedded and real-time control
ScopeController and physical or software process
Editorial statusDraft

What it buys

A controller can respond to disturbances it did not predict by observing how far the measured process has moved from its target.

Apply when

The environment changes and a measurable error must be corrected during operation.

Reconsider when

Open-loop control suffices when disturbances are bounded and sensing or actuation would add little value.

Costs and failure modes

Delay, noisy measurements and incorrect gain can cause oscillation or instability.

Case file

A worked decision

A greenhouse controller reads temperature, compares it to the setpoint and adjusts ventilation using measured error.

Change the condition

If the actuator only needs a fixed timed purge independent of temperature, schedule an open-loop run.

Check the decision

After a sudden heat load, does ventilation restore the setpoint without persistent oscillation?

Relationships

Catalog note · Related at another scope: Reconciliation loop

Sources

Resource management architecture

Cluster resource scheduler

Admit workloads and place them on hosts according to resource demands, priority and availability.

FamilyOperations architecture
ScopeCompute cluster
Editorial statusDraft

What it buys

A fleet can place varied jobs against shared capacity using explicit resource and placement rules.

Apply when

Many heterogeneous jobs share a fleet and manual placement wastes capacity.

Reconsider when

A small static deployment already fits comfortably on dedicated hosts.

Costs and failure modes

Placement failures, fragmentation and stale resource estimates delay work.

Case file

A worked decision

A cluster scheduler places rendering jobs against GPU memory, device type, and tenant quotas.

Change the condition

If a dedicated workstation runs one fixed job, a local queue avoids cluster coordination.

Check the decision

Can any queued job fit on an actual node after all placement constraints apply?

Relationships

Catalog note · Can host: Big compute architecture

Referenced by other entries (1)

Sources

Architectural style

Code on Demand

A client acquires executable behavior from a server and runs it locally.

FamilyNetwork architecture and protocols
ScopeClient / downloaded code
Editorial statusDraft

What it buys

A host can supply new approved client behavior without requiring a new installed client release for every supported variation.

Apply when

A client needs optional capabilities after deployment.

Reconsider when

The client cannot securely run downloaded code or must remain fully auditable offline.

Costs and failure modes

Execution trust and version compatibility become part of the interface.

Case file

A worked decision

A mapping client fetches sandboxed style expressions from the server and executes them locally when rendering tiles.

Change the condition

If style options are fixed and few, send ordinary configuration values.

Check the decision

Can a downloaded style access anything outside the rendering capabilities granted to it?

Relationships

Catalog note · Contrast: Remote Evaluation moves code in the opposite direction.

Referenced by other entries (1)

Sources

Parallel communication pattern

Collective Reduction

Combine distributed partial values with an associative operator into a group result at a designated rank.

FamilyParallel and scientific computing
ScopeGroup of ranks / result
Editorial statusDraft

What it buys

Processes can obtain a combined statistic without each implementing its own collection and combination protocol.

Apply when

Many partitions independently produce partial aggregates for a total or maximum.

Reconsider when

The calculation depends on an exact evaluation order unsupported by the reduction.

Costs and failure modes

Reordering floating-point sums can change numerical results.

Case file

A worked decision

A scientific simulation reduces each worker's local residual to one designated rank, which checks convergence and communicates the resulting stop decision to the other workers.

Change the condition

If each worker checks only its own independent convergence target, use a local comparison and omit the collective.

Check the decision

Does floating-point aggregation order change the convergence decision across worker counts?

Relationships

Catalog note · Complements: Single Program, Multiple Data (SPMD).

Referenced by other entries (1)

Sources

Object-oriented design pattern

Command

Capture a requested action in an executable object that can be scheduled, composed or recorded.

FamilyGoF · Behavioral
ScopeLocal invocation and history
Editorial statusDraft

What it buys

An operation can be stored, queued or invoked by several inputs through one request representation.

Apply when

The same operation comes from multiple UI controls or must support undo history.

Reconsider when

The caller can invoke one function immediately and no request lifecycle is needed.

Costs and failure modes

Undo requires an explicit inverse or snapshot and external effects may be irreversible.

Case file

A worked decision

A drawing editor represents each stroke as an executable request and retains the information needed to undo it.

Change the condition

For a button that performs one immediate action with no queuing or history, call the action directly.

Check the decision

Can undo reconstruct the affected layers after an intervening edit?

Relationships

Catalog note · Can use for undo: Memento

Referenced by other entries (1)

Sources

Message role

Command Message

Send a request naming the action an accountable recipient should perform.

FamilyMessage contracts
ScopeService boundary
Editorial statusDraft

What it buys

A caller can delegate a named operation to its responsible service without sharing that service's implementation.

Apply when

A fulfillment service is explicitly asked to reserve a shipment.

Reconsider when

A producer only needs to announce that a sale has already happened.

Costs and failure modes

The sender depends on the recipient’s command contract and eventually needs failure handling.

Case file

A worked decision

A clearance service sends ReleaseContainer to the yard system that owns a container. The recipient can accept, reject or deduplicate the requested action.

Change the condition

If customs has already released the container and several parties only need to learn that fact, publish a release event instead.

Check the decision

Reject the command and verify the sender does not report release as a completed fact.

Relationships

Catalog note · Contrasts with Event Message, which describes a fact.

Referenced by other entries (1)
  • Command · analogous at another scope

Sources

Architecture pattern

Command-Side Replica

Maintain a local copy of selected external facts to decide commands without a synchronous call.

FamilyService data boundaries
ScopeService write model
Editorial statusDraft

What it buys

A handler can make a time-sensitive decision from local reference data during an upstream outage when its freshness contract allows that.

Apply when

One service repeatedly needs another service’s slowly changing reference data to act.

Reconsider when

The decision must use an authoritative up-to-the-instant fact.

Costs and failure modes

Stale replicas can approve invalid commands. Rebuild and lag detection are required.

Case file

A worked decision

A shipping service copies product dimensions locally because parcel creation cannot wait for a catalog lookup and slightly stale dimensions are acceptable.

Change the condition

If every label must reflect the latest legally certified weight, obtain an authoritative value before issuing it.

Check the decision

What happens to a label when the product-dimension update arrives after parcel creation?

Relationships

Catalog note · Often uses Event-Carried State Transfer to update the replica.

Referenced by other entries (2)

Sources

Design principle

Command–Query Separation (CQS)

Separate operations that observe state from operations that change observable state.

FamilyProgramming model and architecture
ScopeMethod or public API
Editorial statusDraft

Also indexed as · Command Query Separation

What it buys

A caller can repeat a preview or validation query without accidentally changing the business state it is inspecting.

Apply when

Callers must be able to inspect state without triggering a mutation.

Reconsider when

An atomic operation that both changes and returns a value is clearer and preserves the invariant.

Costs and failure modes

Splitting an atomic pop or claim can introduce a race or an extra round trip.

Case file

A worked decision

A playlist's current-song display used to advance the playhead every time the UI redrew. Separate observing the current song from advancing to the next track.

Change the condition

A concurrent work queue can reasonably claim and return its next job atomically, since splitting those operations can race.

Check the decision

Redraw the screen repeatedly and verify that the playhead advances only after an explicit advance command.

Relationships

Catalog note · Shares terminology at a different scope: CQRS

Referenced by other entries (3)

Study this decision

Runnable labs

Sources

Recovery pattern

Compensating Transaction

Perform a new business operation that counteracts the effects of a committed step.

FamilyWorkflow coordination
ScopeBusiness process
Editorial statusDraft

What it buys

A workflow can recover business value, such as releasing a hold, even after the original local transaction committed.

Apply when

A later failure requires releasing inventory, refunding funds or another semantic reversal.

Reconsider when

One ACID transaction can roll back uncommitted effects, or a real-world action is irreversible.

Costs and failure modes

Compensation can fail and may need different rules or human intervention.

Case file

A worked decision

When a trip package fails after a refundable room is booked, request cancellation using its booking reference.

Change the condition

If both changes are uncommitted in one database, roll back the transaction.

Check the decision

Does a second cancellation request refund the same booking twice?

Relationships

Catalog note · Often used by Saga to recover from a partially completed workflow.

Referenced by other entries (1)

Sources

Integration pattern

Competing Consumers

Have multiple workers claim work from the same logical queue.

FamilyMessage delivery
ScopeWorker pool
Editorial statusDraft

What it buys

Additional workers can absorb a backlog from one queue without changing the producer's routing logic.

Apply when

Items can run independently and one worker is falling behind.

Reconsider when

All subscribers need all items, or strict global execution order is required.

Costs and failure modes

Concurrency breaks completion order. A stalled worker can have its job redelivered.

Case file

A worked decision

A print farm has several compatible workers claim the next pending poster job. Each job goes to one available printer, preserving a durable job ID in case a worker disappears.

Change the condition

If accounting and archiving each require a copy of the completed print event, use a separate subscription for each.

Check the decision

Stop a worker after output generation and before acknowledgement and check the policy for preventing or detecting a second print.

Relationships

Catalog note · Uses Point-to-Point Channel for one worker group.

Referenced by other entries (2)

Study this decision

Sources

Architecture pattern

Compiler with a shared intermediate representation

Front ends lower languages to a shared representation consumed by optimization passes and back ends.

FamilyCompiler architecture
ScopeLanguage toolchain
Editorial statusDraft

What it buys

A new language frontend can reuse existing optimization passes and machine-code backends.

Apply when

Several languages or targets can reuse analyses and optimizations.

Reconsider when

One small translator has no reuse pressure and direct translation is clear.

Costs and failure modes

Representation changes affect many passes and semantic details can be lost.

Case file

A worked decision

A compiler project adds a second source language and a new processor target. Both front ends emit a shared intermediate representation consumed by optimization passes and both back ends.

Change the condition

For a one-off translator from one tiny input format to one output, direct generation avoids defining a long-lived intermediate language.

Check the decision

Compile equivalent programs from both source languages and verify that the common optimizer preserves each language's overflow semantics.

Relationships

Catalog note · Can use: Pipes and Filters

Referenced by other entries (1)

Sources

Design pattern

Component Configurator

Attach, configure or detach service implementations during execution.

FamilyMiddleware structure
ScopeProcess / middleware
Editorial statusDraft

What it buys

An operator can change which component handles new work without restarting unrelated parts of a long-running host.

Apply when

Operators must replace services without restarting the host process.

Reconsider when

Restarting an immutable process is cheap and acceptable.

Costs and failure modes

Unloading live components requires draining calls and transferring ownership.

Case file

A worked decision

A telemetry host must replace decoder components for different factories while remaining available and draining active sessions.

Change the condition

If decoders change only with a scheduled deployment, load them at startup.

Check the decision

What happens to an active frame decode when its component is removed?

Relationships

Catalog note · Alternative: supervised process replacement.

Sources

Object-oriented design pattern

Composite

Give leaves and containers a common operation and let containers apply it recursively.

FamilyGoF · Structural
ScopeRecursive part–whole structure
Editorial statusDraft

What it buys

Clients can apply the same part–whole operation to a leaf or a nested group.

Apply when

A tree of shapes, expressions or UI components supports meaningful uniform operations.

Reconsider when

Leaves and groups require distinct operations or the structure has shared cyclic ownership.

Costs and failure modes

A broad common interface can permit invalid operations and recursive traversal can be expensive.

Case file

A worked decision

A scene graph allows the same transform operation on a shape or a group that recursively applies it to its children.

Change the condition

For a flat table of independent shapes, a list traversal is sufficient.

Check the decision

Can reparenting a group create a cycle or apply a transform twice?

Relationships

Catalog note · Often traversed by: Visitor

Referenced by other entries (4)

Sources

Replicated data abstraction

Conflict-Free Replicated Data Type (CRDT)

Choose operations or merge rules that deterministically converge under the type’s delivery assumptions.

FamilyReplication and consistency
ScopeMulti-writer replicas
Editorial statusDraft

What it buys

Replicas can accept supported local edits while disconnected and converge under the data type's specified merge or delivery conditions.

Apply when

Offline clients or disconnected sites must edit data whose merge semantics the domain accepts.

Reconsider when

An invariant requires synchronous coordination, such as unique allocation of a scarce seat without preallocated rights.

Costs and failure modes

Convergence can still surprise users. Metadata, tombstones and safe cleanup may be costly.

Case file

A worked decision

Disconnected field devices maintain a shared grow-only set of observed hazards and merge it by union.

Change the condition

If the operation is reserving a unique scarce slot, serialize the reservation.

Check the decision

Do all permutations of duplicated and delayed hazard additions converge to the same set?

Relationships

Catalog note · Alternative to a Replicated Log for mergeable updates without a single order.

Referenced by other entries (2)

Sources

Strategic design pattern

Conformist

The downstream context adopts the upstream model and its vocabulary.

FamilyDomain boundaries
ScopeDownstream model boundary
Editorial statusDraft

What it buys

A downstream team can consume an upstream model directly and avoid maintaining a translation whose distinctions serve no local purpose.

Apply when

An influential supplier offers a suitable model and translation has little business value.

Reconsider when

Upstream concepts would distort the downstream team's core domain.

Costs and failure modes

Supplier semantics and incompatible changes flow into the downstream model.

Case file

A worked decision

A small importer adopts an external customs authority's commodity vocabulary exactly because it cannot negotiate changes and the classification is its product's purpose.

Change the condition

If the importer starts using a richer local model for stocking decisions, continuing to conform may spread external assumptions into stock rules.

Check the decision

Change a customs classification in a fixture and locate the business decisions that must be revised.

Relationships

Catalog note · Alternative: Anti-Corruption Layer

Referenced by other entries (1)

Sources

Protocol mechanism

Congestion Control

Adjust sending rate or in-flight data in response to observed path conditions.

FamilyNetwork architecture and protocols
ScopeTransport / shared network path
Editorial statusDraft

What it buys

A sender can adapt its offered load to a shared path, limiting the queue growth and loss caused by a persistently excessive rate.

Apply when

Multiple senders share bottlenecks whose capacity changes.

Reconsider when

An existing transport already performs adequate congestion control for this traffic.

Costs and failure modes

Poor tuning can cause unfairness, sustained queues or underuse.

Case file

A worked decision

A transport reduces its sending rate in response to signs that a shared network path is congested.

Change the condition

If the limiting factor is exclusively a receiver's application buffer on a dedicated link, use receiver flow control.

Check the decision

Does competing traffic on the path reduce the sender's rate even when the receiver advertises free capacity?

Relationships

Catalog note · Complements: Credit-Based Flow Control protects the receiver.

Sources

Architecture pattern

Consistent Core

Keep authoritative coordination metadata in a small strongly consistent subsystem.

FamilyCluster coordination
ScopeCluster control plane
Editorial statusDraft

What it buys

Ownership and other decisions that demand agreement can stay authoritative without forcing unrelated data transfers through the same consensus path.

Apply when

A large fleet needs one agreed ownership or configuration map.

Reconsider when

One managed database or existing coordinator already covers this need.

Costs and failure modes

The core can throttle coordination writes and loses availability without sufficient replicas.

Case file

A worked decision

A storage fleet serializes shard ownership changes in a small consensus-backed metadata service while data transfers bypass it.

Change the condition

If one process owns every shard, keep an in-process ownership table.

Check the decision

During a partition, can two controllers successfully assign the same shard epoch?

Relationships

Catalog note · Often uses Raft to implement the control plane.

Referenced by other entries (1)

Sources

Partitioning algorithm

Consistent Hashing

Assign keys and ownership points in a hash space so membership changes move a limited share of keys.

FamilyPartitioning and placement
ScopeDistributed store or cache
Editorial statusDraft

What it buys

Adding or removing a cache node can move a subset of keys while most clients keep finding the rest on their former owners.

Apply when

A changing server population serves key-based lookups or caching.

Reconsider when

Queries must scan adjacent keys, or a single hot key causes the load imbalance.

Costs and failure modes

Skew and rebalancing still require virtual nodes, capacity planning or replication.

Case file

A worked decision

A cache fleet changes membership regularly and seeks to limit the key movement triggered by adding a node.

Change the condition

If keys are already divided into stable buckets with managed placement, move buckets explicitly.

Check the decision

Which keys move when a single cache node joins, and what happens to a single extremely hot key?

Relationships

Catalog note · Alternative to Key-Range Partitions.

Referenced by other entries (1)

Sources

Search technique

Constraint propagation

Narrow variable domains using constraints as information becomes available.

FamilyLogic and search
ScopeConstraint model or search space
Editorial statusDraft

What it buys

Discovering one forced assignment can remove many impossible alternatives before the solver branches.

Apply when

Removing impossible values early saves substantial work in a combinatorial search.

Reconsider when

All choices are determined independently by a simple formula.

Costs and failure modes

Propagation alone may leave multiple feasible values and still require search.

Case file

A worked decision

A shift planner removes overnight assignments after an employee's unavailability becomes known, reducing possibilities for adjacent shifts.

Change the condition

One worker with one fixed shift can be assigned directly.

Check the decision

After propagation reaches a fixed point, which variables still need a choice?

Relationships

Referenced by other entries (1)

Study this decision

Sources

Declarative approach

Constraint solver

Model variables, domains and constraints and let a solver search assignments.

FamilyProgramming model and architecture
ScopePlanning or allocation subsystem
Editorial statusDraft

What it buys

A planner can explore alternative feasible assignments after a constraint changes without hand-coding every possible combination.

Apply when

Scheduling or allocation has interacting requirements that make greedy choices fail.

Reconsider when

A simple construction always yields a satisfactory answer within budget.

Costs and failure modes

Search time, model fidelity and diagnosis of infeasibility can dominate.

Case file

A worked decision

A clinic must allocate rooms, nurses and equipment subject to time windows, qualifications and cleaning gaps. A solver searches for a feasible assignment and can reject infeasible input.

Change the condition

If every appointment uses an identical room and slots never overlap, a direct slot lookup is simpler.

Check the decision

With the only qualified nurse removed, does the planner distinguish proved infeasibility from an unresolved search that reached its time limit?

Relationships

Catalog note · Alternative for triggered decisions: Production rules engine

Referenced by other entries (2)

Study this decision

Sources

Integration pattern

Content-Based Router

Select the next destination by inspecting message fields.

FamilyMessage routing
ScopeIntegration flow
Editorial statusDraft

What it buys

A new inspection policy can redirect restricted consignments without requiring every sender to know who inspects them.

Apply when

Region or product type determines the system responsible for an item.

Reconsider when

Subscribers independently decide whether to receive a shared event stream.

Costs and failure modes

Routing rules couple the router to payload schemas and rule precedence.

Case file

A worked decision

A customs gateway sends declarations containing restricted goods to specialist review and routes the rest to automatic clearance.

Change the condition

If importers already select distinct regulated endpoints, route by endpoint instead.

Check the decision

Which destination receives a declaration containing both ordinary and restricted goods?

Relationships

Catalog note · Contrasts with Publish–Subscribe Channel’s independent subscriptions.

Sources

Strategic design pattern

Context Map

Describe existing contexts, their dependencies and the kind of relationship on each boundary.

FamilyDomain boundaries
ScopeRelationships among models and teams
Editorial statusDraft

What it buys

A team planning a contract change can identify which neighboring contexts depend on it and where negotiation or translation is needed.

Apply when

Multiple groups must agree who controls an integration model and how changes propagate.

Reconsider when

A single small context has no external model relationships to explain.

Costs and failure modes

Maps quickly mislead if they document aspirations as current integrations.

Case file

A worked decision

A bank maps the relationships among customer identity, credit assessment and loan servicing before migrating a shared customer table. The map names each owner and each translation boundary.

Change the condition

For a single team with one model and no integration boundary, a short module diagram may answer the same question.

Check the decision

Follow an address change across the map and identify which team can change each representation independently.

Relationships

Catalog note · Describes: Customer/Supplier and Shared Kernel

Referenced by other entries (1)

Sources

Resource management idiom

Context-managed dynamic resource stack

Register a variable number of cleanup actions and unwind them in reverse acquisition order.

FamilyResource lifetime and ownership
ScopeResource or process lifetime
Editorial statusDraft

Also indexed as · ExitStack, cleanup stack

What it buys

If the fifth acquisition fails, already acquired resources can still be released in reverse order without a separate failure path per resource.

Apply when

Acquisition can fail partway through the opening of an unknown set of resources.

Reconsider when

One fixed resource already has a natural scoped owner.

Costs and failure modes

Canceling or transferring registered cleanup actions incorrectly can leak or double-release a resource.

Case file

A worked decision

An importer opens all selected archive parts before building an index. If part four fails, clean up the three that opened.

Change the condition

If only a single file is ever opened, use a normal scoped file operation.

Check the decision

For every failing acquisition index, are exactly the earlier successful acquisitions undone?

Relationships

Study this decision

Sources

Execution idiom

Continue-as-New

Close a workflow run and carry explicit state into a fresh history under the same workflow identity.

FamilyWorkflow execution
ScopeLong-lived workflow instance
Editorial statusDraft

What it buys

Long-lived work can carry forward the state it still needs while bounding the execution history a worker must reconstruct.

Apply when

An indefinitely running entity or process would exceed replay or history limits.

Reconsider when

One bounded execution completes comfortably within engine limits.

Costs and failure modes

State handoff, pending messages and run-specific references need explicit handling.

Case file

A worked decision

A subscription workflow lives for years and rolls its renewal date and deduplication state into successive fresh execution histories.

Change the condition

If each subscription closes after one renewal, finish the workflow normally.

Check the decision

If a cancellation signal arrives as one run closes, how does the subscription test detect a lost signal or duplicate refund?

Relationships

Catalog note · Extends Durable Workflow Execution by Replay for long-lived instances.

Sources

MLOps architecture

Continuous training pipeline

Trigger reproducible data validation, training, evaluation and gated model deployment.

FamilyML and AI systems
ScopeModel lifecycle
Editorial statusDraft

What it buys

New training runs and promotions can follow reproducible evidence and quality gates as data changes.

Apply when

Data changes often enough that manual refreshes degrade measured model quality.

Reconsider when

A stable low-risk model seldom requires retraining.

Costs and failure modes

Drift and faulty validation can automate deployment of a worse model.

Case file

A worked decision

A grocery forecaster retrains on newly labeled sales, compares a challenger with the incumbent, and gates promotion on validation.

Change the condition

If verified labels arrive only annually, a reviewed annual training run may be easier to govern.

Check the decision

Can the team reproduce exactly which data and code produced a promoted model?

Relationships

Catalog note · Complements: Canary release

Referenced by other entries (1)

Sources

Message design pattern

Correlation Identifier

Carry an identifier that associates an incoming reply with its original request.

FamilyMessage contracts
ScopeService conversation
Editorial statusDraft

What it buys

A requester can match replies that arrive out of order to the correct outstanding operations.

Apply when

Several requests can be outstanding and replies may arrive out of order.

Reconsider when

A strictly sequential exchange already has an unambiguous pairing.

Costs and failure modes

Identifier reuse or short-lived correlation state can misroute late replies.

Case file

A worked decision

A vessel planner issues many asynchronous tariff requests over one return channel. Each request includes an opaque ID and the responder copies it into its reply.

Change the condition

If a dedicated synchronous connection carries one outstanding request at a time, its call context may already match replies.

Check the decision

Return replies in reverse order and verify that every price lands on the correct sailing.

Relationships

Catalog note · Supports Request–Reply and Aggregator.

Referenced by other entries (2)

Sources

Architecture pattern

CQRS

Model commands and queries separately, with shared or separate storage as needed.

FamilyService data boundaries
ScopeApplication or bounded context
Editorial statusDraft

Also indexed as · Command Query Responsibility Segregation

What it buys

Complex write-side invariants and read-side projections can evolve independently when their required models diverge.

Apply when

Write-side rules and read-side shapes evolve independently and burden a shared model.

Reconsider when

Straightforward CRUD has symmetric reads and writes.

Costs and failure modes

Two models require mapping and ownership. Async projections also add lag and rebuilds.

Case file

A worked decision

A seat-booking service enforces capacity on a write model and builds a differently shaped availability calendar for browsing.

Change the condition

If one reservation table already handles both rules and browsing, query it directly.

Check the decision

Can a stale calendar cause a confirmed double booking, or does the write model enforce capacity independently?

Relationships

Catalog note · May compose with Event Sourcing. Each can stand independently.

Referenced by other entries (3)

Study this decision

Runnable labs

Sources

Protocol mechanism

Credit-Based Flow Control

Limit transmission to the data allowance advertised by the receiver.

FamilyNetwork architecture and protocols
ScopeTransport / receiver buffers
Editorial statusDraft

What it buys

A receiver can bound the sender's outstanding deliveries to capacity the receiver has explicitly granted.

Apply when

A fast producer can exhaust memory at the receiving endpoint.

Reconsider when

Flow control is already supplied below and additional application credits protect no separate limit.

Costs and failure modes

Insufficient credit lowers throughput; excess credit commits receiver memory.

Case file

A worked decision

A broker grants a consumer a finite number of outstanding deliveries and replenishes credit as capacity returns.

Change the condition

If all messages are processed synchronously one at a time, wait for each response.

Check the decision

Can the broker send one more delivery after all granted credit is spent?

Relationships

Catalog note · Complements: Congestion Control protects the network path.

Referenced by other entries (3)

Sources

Strategic design pattern

Customer/Supplier

The downstream team negotiates needs and acceptance tests with the upstream supplier.

FamilyDomain boundaries
ScopeUpstream/downstream relationship
Editorial statusDraft

What it buys

The supplier can test a contract change against the downstream team's actual needs before the change ships.

Apply when

The upstream team can plan changes around downstream requirements.

Reconsider when

The downstream team lacks bargaining power or the upstream model is externally fixed.

Costs and failure modes

Roadmap negotiation can delay both teams and tests can constrain upstream changes.

Case file

A worked decision

A fraud team needs an additional authorization attribute from payments. The teams agree on a versioned contract and a delivery date, and verify the change with a consumer contract test.

Change the condition

When the upstream supplier cannot be influenced, a conformist model or translation boundary may be more realistic.

Check the decision

Can the downstream team show where it participates in upstream contract changes and acceptance decisions?

Relationships

Catalog note · Contrasts with: Conformist

Sources

Object-oriented architectural style

Data abstraction and object-oriented organization

Objects encapsulate representations and collaborate through operations.

FamilyStructural architecture
ScopeApplication and modules
Editorial statusDraft

What it buys

A component can change its data representation without requiring its callers to rewrite how they perform a domain operation.

Apply when

State has clear owners whose invariants must survive changes to representation.

Reconsider when

Uniform transformations over many records dominate and object identity adds no value.

Costs and failure modes

Clients must track object collaborators and interactions can hide global control flow.

Case file

A worked decision

A library system makes a loan object responsible for its due date and renewal count. All callers request renewal through that object so a new limit applies consistently.

Change the condition

For a report that only totals immutable rows, a direct transformation avoids creating stateful collaborators.

Check the decision

Can any external caller construct a loan with more renewals than the policy permits?

Relationships

Catalog note · Can use: Strategy

Sources

Storage architecture

Data lake

Retain diverse source data in shared storage for later interpretation and analysis.

FamilyAnalytical architecture
ScopeData platform
Editorial statusDraft

What it buys

Analysts can revisit retained source data when a new question requires a different interpretation.

Apply when

Consumers explore heterogeneous datasets before all use cases or schemas are known.

Reconsider when

A small stable reporting model serves every consumer directly.

Costs and failure modes

Weak metadata, ownership and access controls can make stored datasets unusable.

Case file

A worked decision

A climate archive retains original satellite swaths so future algorithms can reinterpret historical observations.

Change the condition

If analysts only need a stable set of validated measures, publish curated warehouse tables directly.

Check the decision

Can an analyst identify the schema, provenance, and retention policy for a raw object?

Relationships

Catalog note · Related: Lakehouse

Referenced by other entries (1)

Sources

Persistence pattern

Data Mapper

A separate mapper moves data between the object and database representations.

FamilyEnterprise persistence
ScopeStorage boundary
Editorial statusDraft

What it buys

A domain object's construction and relationships can evolve independently of database records when the mapping absorbs the difference.

Apply when

Business objects and a relational schema need to evolve independently.

Reconsider when

A small CRUD system has a near-perfect row-to-object match.

Costs and failure modes

Mappings can hide expensive loads or duplicate schema knowledge.

Case file

A worked decision

A legal case contains nested claims and parties, yet the inherited reporting database stores them in several normalized tables. A mapper reconstructs the case without making it issue SQL.

Change the condition

For a lookup class matching one table with almost no behavior, active record or a direct query is often easier to follow.

Check the decision

Round-trip a case containing the same party in two claims and verify that shared identity survives the mapping.

Relationships

Catalog note · Alternative: Active Record

Referenced by other entries (2)

Sources

Architectural approach

Data mesh

Domains publish owned data products on shared infrastructure with common governance.

FamilyAnalytical architecture
ScopeOrganization and data platform
Editorial statusDraft

What it buys

Teams that know a domain can publish and evolve its analytical product without waiting for a central delivery queue.

Apply when

Several capable domain teams need to deliver independent analytical products.

Reconsider when

One small data team owns the sources and consumers and a warehouse already meets demand.

Costs and failure modes

Without shared semantics, ownership and quality standards move in different directions.

Case file

A worked decision

An insurer gives claims and policies teams ownership of documented data products and enforces shared identifiers through a common platform.

Change the condition

With one small analytics team and one source, centralized ownership avoids product-management overhead.

Check the decision

Which team handles a broken claims schema and how do consumers learn of the change?

Relationships

Catalog note · Can use: Lakehouse

Sources

Parallel design approach

Data Parallelism

Apply the same operation to many partitions of a dataset, allowing independent work to overlap.

FamilyParallel and scientific computing
ScopeArray / partitioned dataset
Editorial statusDraft

What it buys

Independent partitions can execute the same transformation concurrently without coordinating every element.

Apply when

A simulation, transformation or model operates uniformly on a large collection.

Reconsider when

Work is tiny or almost every element depends on the previous output.

Costs and failure modes

Partitioning, data movement and skew can offset speedup.

Case file

A worked decision

An image pipeline distributes independent images across devices, each applying the same normalization to its own batch.

Change the condition

If every image depends serially on the preceding output, partition another dimension or keep the sequential loop.

Check the decision

Do skewed image sizes leave some devices idle while another finishes its shard?

Relationships

Catalog note · Implemented by: SIMT kernels or multiple SPMD ranks.

Referenced by other entries (5)

Study this decision

Sources

Distribution pattern

Data Transfer Object

Collect the fields needed for a remote call in a serializable transfer representation.

FamilyEnterprise integration
ScopeProcess or network boundary
Editorial statusDraft

What it buys

A remote client can obtain the necessary fields in one round trip without exposing the server's full object graph.

Apply when

A remote interaction requires a stable payload and fewer round trips.

Reconsider when

Local callers can already share a suitable value type and have no boundary to protect.

Costs and failure modes

Mapping duplication and version skew accumulate.

Case file

A worked decision

A route-planning client needs station names, platform changes and accessible transfers in one response. A DTO carries that shape without exposing the server's database or domain object graph.

Change the condition

For a purely local call within one module, an extra data transfer type can duplicate an existing value for no boundary benefit.

Check the decision

Add a server-only field and check that the serialized public response and compatibility tests remain unchanged.

Relationships

Catalog note · Complements: Remote Facade

Referenced by other entries (1)

Study this decision

Sources

Analytical architecture

Data warehouse

Integrate data into governed structures optimized for analytical queries.

FamilyAnalytical architecture
ScopeEnterprise data platform
Editorial statusDraft

What it buys

Different reports can compare historical business measures against a shared interpretation of the source data.

Apply when

Multiple reports require consistent business measures and historical comparisons.

Reconsider when

Low-latency transactional updates dominate and cross-source reporting is minimal.

Costs and failure modes

Ingestion, semantic modeling and freshness commitments require continuing work.

Case file

A worked decision

A retailer loads validated sales, returns, and calendar history into a warehouse for repeatable finance reports.

Change the condition

For an application that only displays today's orders, query the operational store within its load budget.

Check the decision

Can the monthly close be reproduced from the same inputs and transformation version?

Relationships

Catalog note · Can use: Dimensional star schema

Referenced by other entries (1)

Sources

Architecture pattern

Database per Service

Make a service the exclusive owner of its persistent data, with contracts for outside access.

FamilyService data boundaries
ScopeService boundary
Editorial statusDraft

What it buys

The owning service can change a private schema without coordinating changes to other services' direct SQL queries.

Apply when

Teams must change their schemas independently and preserve ownership of invariants.

Reconsider when

Frequent cross-boundary atomic updates point to a misplaced service boundary.

Costs and failure modes

Cross-service joins and transactions require new collaboration mechanisms.

Case file

A worked decision

Delivery and invoicing teams need to evolve schemas independently and can exchange status through published interfaces.

Change the condition

If every order change needs a single atomic join across both areas, retain one transactional boundary.

Check the decision

Can invoicing deploy a schema migration without a direct delivery query breaking?

Relationships

Catalog note · Often motivates API Composition or Saga.

Referenced by other entries (1)

Sources

Tenancy pattern

Database per tenant

Allocate a separately managed database to each tenant.

FamilyMultitenancy
ScopeTenant data plane
Editorial statusDraft

Also indexed as · Database-per-tenant

What it buys

A single tenant can be restored, placed or scaled with less interference with other tenants.

Apply when

Tenants require separate restore, isolation, sizing or regional placement.

Reconsider when

Many tiny low-value tenants share the same schema and requirements.

Costs and failure modes

Fleet migrations and per-database cost scale with tenant count.

Case file

A worked decision

A medical records vendor restores one hospital's database to a historical point without rolling back other customers.

Change the condition

For thousands of tiny tenants with uniform isolation requirements, shared storage reduces provisioning and migration work.

Check the decision

Can one tenant be restored within its objective while the rest continue normal traffic?

Relationships

Catalog note · Alternative: Shared multitenant database

Referenced by other entries (1)

Sources

Logic and relational model

Datalog inference

Derive relations from facts and rules until the program reaches a fixed point.

FamilyProgramming model and architecture
ScopeAnalysis engine
Editorial statusDraft

What it buys

A short set of recursive rules can derive indirect relationships such as all resources reachable through nested roles.

Apply when

Recursive reachability or static analysis repeatedly propagates facts across a graph.

Reconsider when

A direct lookup or ordinary nonrecursive query expresses the whole requirement.

Costs and failure modes

Intermediate relation sizes and rule evaluation cost can grow sharply.

Case file

A worked decision

An access auditor derives transitive membership from nested groups and then joins the derived memberships with resource grants. Datalog rules define the relation independently of traversal order.

Change the condition

If every user belongs to a single flat group, a simple relation join already answers the question.

Check the decision

Insert a cycle in the group graph and verify that derived access terminates with the intended set of memberships.

Relationships

Catalog note · Related: Production rules engine

Referenced by other entries (1)

Sources

Integration pattern

Dead Letter Channel

Divert messages that exhaust delivery policy into a separate destination.

FamilyMessage delivery
ScopeFailure handling
Editorial statusDraft

What it buys

Operators can inspect repeatedly failing messages while healthy messages continue through the main delivery path.

Apply when

A poison message keeps blocking or consuming normal worker capacity.

Reconsider when

A rejected request can be reported synchronously and safely discarded.

Costs and failure modes

Unmonitored backlogs bury failures. Replaying after repair can repeat effects.

Case file

A worked decision

An accounting importer sends a malformed batch to a dead-letter channel after bounded failures. An operator inspects the stored cause, repairs the mapping and replays the batch under its original ID.

Change the condition

If failures reflect a brief storage outage and the data is valid, bounded retry or delayed delivery may recover without manual intervention.

Check the decision

Replay a quarantined batch twice and verify recovery produces one ledger effect with an auditable result.

Relationships

Catalog note · Complements Idempotent Receiver during redrive.

Sources

Integrity mechanism

Declarative integrity constraint

Declare a check, uniqueness rule, foreign key or other supported invariant at the store that commits the write.

FamilyRelational operations and invariants
ScopeRelation, query or database boundary
Editorial statusDraft

What it buys

Concurrent or independently written clients encounter the same enforced rule when attempting to commit invalid data.

Apply when

Independent writers must obey the same enforceable rule under concurrency.

Reconsider when

The invariant depends on an external real-time decision that the database cannot evaluate safely.

Costs and failure modes

Existing inconsistent rows, migration locking and error translation need an explicit plan.

Case file

A worked decision

Two sales channels can claim a numbered seat. A unique constraint on show and seat makes the conflicting commit fail.

Change the condition

A request-only tip that patrons usually prefer aisle seats belongs outside the database invariant.

Check the decision

Under two concurrent transactions for the same seat, can both commits succeed?

Relationships

Study this decision

Sources

Decomposition pattern

Decompose by Business Capability

Align services with stable business activities such as billing or fulfillment.

FamilyService architecture
ScopeBusiness and service boundaries
Editorial statusDraft

What it buys

A change to a fulfillment rule can stay with the team responsible for fulfillment, from its API through its storage.

Apply when

Business activities have clear owners, change drivers and interfaces.

Reconsider when

A supposed capability is a temporary org chart box or a technical layer.

Costs and failure modes

Poor boundaries distribute a single business change across many services.

Case file

A worked decision

A manufacturer can identify quoting, scheduling and shipping as enduring capabilities with separate operators. Give each team ownership of one capability's interfaces and release decisions.

Change the condition

If one small team changes all three every time it adjusts order rules, begin with modules in one deployment.

Check the decision

Trace a recent change request and count the teams that must coordinate to ship it.

Relationships

Catalog note · Related: Decompose by Subdomain

Sources

Decomposition pattern

Decompose by Subdomain

Use domain analysis to find cohesive business problem areas around which services can form.

FamilyService architecture
ScopeDomain and service boundaries
Editorial statusDraft

What it buys

Policy that changes for one business problem can evolve independently of similarly named concepts with different rules elsewhere.

Apply when

Terms and rules cluster around distinct problems with different models.

Reconsider when

A speculative split needs cross-service transactions for nearly every operation.

Costs and failure modes

Discovering boundaries takes expertise and later repartitioning moves data and contracts.

Case file

A worked decision

A travel platform discovers that a hotel booking and a payments settlement use different models of cancellation. Split the contexts along these domain boundaries to preserve distinct rules.

Change the condition

If both operations refer to the same policy and change as a unit, a new service boundary adds translation work.

Check the decision

Can each side explain a cancellation entirely in its own vocabulary and state its external contract?

Relationships

Catalog note · Informed by: Bounded Context

Referenced by other entries (1)

Sources

Object-oriented design pattern

Decorator

Wrap an object in collaborators implementing the same interface, adding work around a delegated call.

FamilyGoF · Structural
ScopePer-instance behavior
Editorial statusDraft

What it buys

Optional behaviors can be combined around one object without a subclass for every combination.

Apply when

Logging, validation or buffering must be independently combined for individual instances.

Reconsider when

A single permanent behavior change belongs directly in the implementation.

Costs and failure modes

Wrapper order changes behavior and can make identity and debugging surprising.

Case file

A worked decision

A telemetry exporter wraps the same byte-writer interface with compression and byte counting. Counting inside or outside the compressor measures different quantities.

Change the condition

If one fixed pipeline has an unchanging order, use explicit sequential calls.

Check the decision

With a compressible payload, does the chosen wrapper order report raw input size or actual transmitted bytes as intended?

Relationships

Catalog note · Related interface shape, different intent: Proxy

Referenced by other entries (3)

Sources

Workflow pattern

Deferred Choice

Enable several possible events and let the first external occurrence select one path.

FamilyWorkflow control flow
ScopeBusiness process instance
Editorial statusDraft

What it buys

A reservation can wait for one of several external outcomes and record which one committed the workflow to its next branch.

Apply when

A customer response races a deadline and the outcome cannot be evaluated in advance.

Reconsider when

The choice is already determined by data available at the branch.

Costs and failure modes

Late arrivals and the treatment of nearly simultaneous events require explicit rules.

Case file

A worked decision

A reservation waits for payment confirmation or expiry, whichever eligible event the workflow accepts first.

Change the condition

If the branch is already determined from stored payment status, evaluate that condition directly.

Check the decision

When confirmation and expiry arrive together, can both release and capture the same reservation?

Relationships

Catalog note · Can be implemented by a BPMN event-based gateway.

Sources

Resource management idiom

Deferred cleanup / scope guard

Register cleanup immediately after successful acquisition and run it as the enclosing scope or function unwinds according to the runtime's rules.

FamilyResource lifetime and ownership
ScopeResource or process lifetime
Editorial statusDraft

What it buys

An early exit added later can still run previously registered cleanup without duplicating release code at each return.

Apply when

A routine has several return paths and manually paired cleanup is fragile.

Reconsider when

The resource must be released before the scope exits or ownership escapes the scope.

Costs and failure modes

Long-running scopes and loops can retain handles until much later than intended.

Case file

A worked decision

Each request opens a temporary file. Register close after open succeeds so error branches cannot leak it.

Change the condition

A batch loop opens thousands of files in a single long scope. Use a per-file inner scope or close each one promptly.

Check the decision

What does the maximum number of simultaneously open files become on a large batch?

Relationships

Referenced by other entries (2)

Sources

Execution pattern

Deferred Interrupt Handling

Record minimal interrupt work, then queue longer processing for a worker thread.

FamilyEmbedded and real-time control
ScopeInterrupt handler / kernel worker
Editorial statusDraft

What it buys

The device can be acknowledged promptly while decoding or allocation runs outside interrupt context.

Apply when

Hardware requires short interrupt service latency but handling is substantial.

Reconsider when

The deferred step itself has a deadline shorter than the queue can guarantee.

Costs and failure modes

Queue backlog delays completion and interrupt context must transfer data safely.

Case file

A worked decision

An interrupt handler acknowledges the sensor and enqueues a sample descriptor. A worker decodes the packet after the handler returns.

Change the condition

For a single bounded register update, finish in the handler if it fits the interrupt latency budget.

Check the decision

Under peak arrivals, does the queue drain before the next burst?

Relationships

Catalog note · Related: Half-Sync/Half-Async also separates execution contexts.

Referenced by other entries (1)

Sources

Composition pattern

Dependency injection

Make a component receive its collaborators through its construction or call boundary.

FamilyModule construction
ScopeComponent and composition boundary
Editorial statusDraft

Also indexed as · DI, constructor injection

What it buys

A test can supply a clock or payment substitute without changing the component that uses the collaborator.

Apply when

Different environments or tests need to replace a clock, gateway or policy without editing business code.

Reconsider when

A local deterministic function already has all of its inputs and no variable collaborator.

Costs and failure modes

An object graph of unnecessary abstractions makes simple control flow difficult to follow.

Case file

A worked decision

An invoice service accepts a clock so month-end tests run against a fixed date. A plain constructor is enough.

Change the condition

A balance function already receives the date and rates as values, so injecting factories would add no useful variation.

Check the decision

Can the dependency be supplied at one composition point without a global lookup?

Relationships

Sources

Deployment pattern

Deployment stamps

Deploy multiple independently operable copies of a service stack.

FamilyCloud infrastructure
ScopeFleet or region
Editorial statusDraft

What it buys

Capacity, tenant placement and rollout can be managed one repeatable deployment unit at a time.

Apply when

Tenant placement, capacity or release isolation needs repeatable independent units.

Reconsider when

One small deployment easily fits its capacity and failure budget.

Costs and failure modes

Placement, per-stamp configuration and fleet updates add operations.

Case file

A worked decision

A payroll provider instantiates the same application stack for successive groups of customers as capacity fills.

Change the condition

If one installation meets capacity and isolation needs, keep a single deployment.

Check the decision

Can a tenant move between stamps without ambiguous routing or duplicate payroll execution?

Relationships

Catalog note · Can implement: Cell-based architecture

Referenced by other entries (2)

Sources

Resource management idiom

Deterministic resource lifetime (RAII)

Tie resource acquisition and release to the lifetime of an owning object.

FamilyResource lifetime and ownership
ScopeResource or process lifetime
Editorial statusDraft

Also indexed as · RAII, Resource Acquisition Is Initialization

What it buys

A file descriptor or mutex can be released on an early return or exception through the owning object's normal lifetime rules.

Apply when

Exceptions or early exits can cross several paths that share a lock, descriptor or native allocation.

Reconsider when

The environment already owns the resource for the whole process and there is no independent release point.

Costs and failure modes

Ownership transfer must be explicit. Cleanup ordering can surprise callers.

Case file

A worked decision

A file conversion acquires a temporary lock and an output handle. Owning objects release both during unwinding on conversion failure.

Change the condition

A borrowed handle owned by the caller must not be wrapped in a second owner that closes it.

Check the decision

On each injected failure path, is every acquired resource released exactly once?

Relationships

Referenced by other entries (1)

Study this decision

Sources

Data model pattern

Dimensional star schema

Organize facts at a declared grain and relate them to descriptive dimensions.

FamilyAnalytical architecture
ScopeAnalytical store
Editorial statusDraft

What it buys

Analysts can express common aggregations around a stable fact grain and recognizable business dimensions.

Apply when

Users repeatedly aggregate measures by common business dimensions.

Reconsider when

A transactional write model mainly enforces normalized business relationships.

Costs and failure modes

Mixing grains silently double-counts facts. History policy can distort past reports.

Case file

A worked decision

A ticketing warehouse records one fact per admission and joins event, venue, and calendar dimensions for attendance reports.

Change the condition

If the main operation edits a customer's contact details, use a transactional schema.

Check the decision

Would joining multiple ticket scans accidentally multiply attendance at the chosen grain?

Relationships

Catalog note · Supports: Enterprise data warehouse bus

Referenced by other entries (3)

Study this decision

Sources

Decomposition pattern

Distributed Stencil with Halo Exchange

Partition a grid and exchange boundary values for local neighborhood computations.

FamilyParallel and scientific computing
ScopeGrid tiles / neighboring ranks
Editorial statusDraft

What it buys

Workers can update local interiors independently and exchange only the neighboring data their boundaries require.

Apply when

A solver repeatedly updates each grid cell from a bounded neighborhood.

Reconsider when

Dependencies are global or highly irregular, defeating local neighbor exchange.

Costs and failure modes

Small tiles spend disproportionate time and bandwidth exchanging boundaries.

Case file

A worked decision

A weather model partitions its grid and exchanges edge cells with neighbors before advancing the next timestep.

Change the condition

If the grid fits comfortably on one device, local contiguous access removes halo communication.

Check the decision

Do results at partition edges match a single-domain reference after multiple timesteps?

Relationships

Catalog note · Complements: Data Parallelism over each tile's interior.

Referenced by other entries (1)

Sources

Observability technique

Distributed tracing

Propagate trace context and correlate spans over process boundaries.

FamilyOperations architecture
ScopeRequest path
Editorial statusDraft

What it buys

Operators can identify which downstream span contributes to a slow or failed request across services.

Apply when

A slow or failed request crosses components and logs cannot reveal its critical path.

Reconsider when

One process and a profiler already isolate the bottleneck.

Costs and failure modes

Sampling, broken context and sensitive span attributes can obscure evidence.

Case file

A worked decision

A purchase request propagates a trace context through checkout, inventory, and a payment callback to identify where a deadline expires.

Change the condition

For a single local script, structured timing around the slow function is often sufficient.

Check the decision

Is context preserved across the queue hop without recording sensitive payment data?

Relationships

Catalog note · Complements: Service mesh

Referenced by other entries (1)

Sources

Tactical design pattern

Domain Event

Represent a business-significant occurrence explicitly as an immutable fact.

FamilyDomain modeling
ScopeDomain or context
Editorial statusDraft

What it buys

Later reactions can refer to the business occurrence that triggered them even after the affected entity's current state changes.

Apply when

Other domain behavior needs to distinguish what happened and when.

Reconsider when

A local helper call carries no business meaning or an invariant must be enforced before commit.

Costs and failure modes

Treating every mutation as an event produces noise and brittle consumers.

Case file

A worked decision

A loan emits LoanApproved when its rules approve an application. A notification handler prepares email independently, so a delivery failure leaves the approval intact.

Change the condition

If the UI only needs an immediate success indication and no other behavior observes approval, a direct return value may suffice.

Check the decision

Reject an application and check that neither a durable approval fact nor a notification is produced.

Relationships

Catalog note · Distinct from, usable with: Event Sourcing

Sources

Domain logic pattern

Domain Model

Represent domain concepts and their behavior in collaborating domain objects.

FamilyEnterprise application
ScopeBusiness logic
Editorial statusDraft

What it buys

Business operations can share rules across use cases, reducing the chance that two workflows implement different versions of one policy.

Apply when

Many workflows share interacting rules and invariants.

Reconsider when

Routine data entry has little behavior beyond straightforward validation.

Costs and failure modes

Model discovery and persistence mapping may exceed the business complexity.

Case file

A worked decision

An underwriting application models policies, coverages and endorsements so that all entry points apply the same eligibility and adjustment rules.

Change the condition

For a directory of offices with simple create, edit and list operations, per-use-case scripts need less machinery.

Check the decision

Exercise an endorsement through both the bulk import and the UI and compare the resulting premium and policy state.

Relationships

Catalog note · Alternative: Transaction Script

Referenced by other entries (1)

Sources

Tactical design pattern

Domain Service

Express a domain operation without forcing it onto a single entity or value object.

FamilyDomain modeling
ScopeDomain operation
Editorial statusDraft

What it buys

A rule involving several domain concepts gains a single named home that callers can exercise without choosing an arbitrary owning entity.

Apply when

A rule spans concepts and no one object naturally owns the operation.

Reconsider when

An entity already owns the invariant and can implement the behavior directly.

Costs and failure modes

Overuse drains behavior from entities and concentrates unrelated logic.

Case file

A worked decision

A shipping service calculates a transfer price using rules applying to both the sending depot and the receiving depot. The rule lives in a named domain service because neither depot owns the whole decision.

Change the condition

If the price depends entirely on one tariff object's internal data, a method on that object keeps the rule closer to its invariant.

Check the decision

Can the price decision be tested using depots and tariffs without web handlers, a database or a clock?

Relationships

Catalog note · Invoked by: Service Layer

Referenced by other entries (1)

Sources

Sequencing pattern

Double Buffer

Write the next version to a second buffer and swap visible buffers at a safe boundary.

FamilyGame and simulation architecture
ScopeProducer / consumer or frame boundary
Editorial statusDraft

What it buys

A reader can see a complete frame while the writer assembles the next one, avoiding a mixture of generations.

Apply when

Rendering or simulation updates must appear as a complete frame.

Reconsider when

The consumer can safely process incremental updates or memory is scarce.

Costs and failure modes

Requires extra storage and correct handoff before reusing the old buffer.

Case file

A worked decision

A scoreboard renderer writes the next frame into a private buffer while the display reads the last complete frame. It publishes the new buffer at a synchronization point.

Change the condition

For a single-threaded text render that completes before any reader runs, one buffer is simpler.

Check the decision

Pause the writer halfway through a frame and verify the reader still sees a whole old or new frame.

Relationships

Catalog note · Complements: Game Loop publishes a completed frame.

Study this decision

Sources

Optimization pattern

Double-Checked Locking

Check readiness before locking and recheck under the lock before publication.

FamilySynchronization and memory
ScopeCode / one-time initialization
Editorial statusDraft

What it buys

After safe publication succeeds, the common initialized path can avoid taking the initialization lock.

Apply when

A measured initialization bottleneck justifies a safe memory-model-specific implementation.

Reconsider when

A language-provided once primitive handles initialization.

Costs and failure modes

Unsafe publication may expose partially initialized state despite the second check.

Case file

A worked decision

A serializer lazily builds a costly lookup table, checks an acquire-loaded reference, and checks again under the initialization lock before safe publication.

Change the condition

If the runtime provides a once-initializer, prefer it to hand-written publication logic.

Check the decision

Can a reader observe the table reference before every entry is visible under the memory model?

Relationships

Catalog note · Alternative: runtime-provided one-time initialization.

Referenced by other entries (1)

Sources

Integration pattern

Durable Subscriber

Keep a subscriber’s position or outstanding messages while it disconnects.

FamilyMessage delivery
ScopeBroker subscription
Editorial statusDraft

What it buys

A subscriber can resume after a deployment and retrieve publications retained during its absence.

Apply when

A billing service must catch up after maintenance.

Reconsider when

Live presence indicators can simply refresh current state.

Costs and failure modes

Inactive subscriptions consume retention capacity and may replay obsolete work.

Case file

A worked decision

A district school's reporting feed must catch up on attendance changes after nightly downtime. The broker retains outstanding messages for its named durable subscription.

Change the condition

A dashboard that only needs a current headcount can discard missed events and fetch a snapshot on restart.

Check the decision

Stop the reporting subscriber, submit an attendance change, restart it and verify receipt within the configured retention window.

Relationships

Catalog note · Specializes Publish–Subscribe Channel for offline subscribers.

Sources

Execution architecture

Durable Workflow Execution by Replay

Persist a history of decisions, events and activity results, then replay deterministic workflow code after failure.

FamilyWorkflow execution
ScopeWorkflow engine and workers
Editorial statusDraft

Also indexed as · Durable execution

What it buys

A worker can recover the decision point of a long-running workflow after failure using recorded outcomes from earlier steps.

Apply when

A multiday process must survive restarts and wait without occupying an application thread.

Reconsider when

A short job can finish in a retriable database transaction or queue worker.

Costs and failure modes

Code upgrades must remain replay-compatible. External activities can retry and need safe effects.

Case file

A worked decision

A hiring workflow waits weeks between interviews and reconstructs its control state from recorded activity outcomes after worker replacement.

Change the condition

If work finishes inside one retryable request, call the activities directly.

Check the decision

Can the new worker replay an old interview history without sending another invitation?

Relationships

Catalog note · Can implement Process Manager with a durable execution history.

Referenced by other entries (1)

Sources

Presentation architecture pattern

Elm Architecture

A model stores state, a view renders it, and an update function maps messages and state to the next state.

FamilyPresentation architecture
ScopeInteractive application
Editorial statusDraft

Also indexed as · Model–View–Update, MVU

What it buys

A recorded message and its prior model can reproduce a UI transition in a test without driving a browser.

Apply when

State transitions need to be explicit, reproducible and testable.

Reconsider when

A small widget has little meaningful state or expensive redraws dominate without mitigation.

Costs and failure modes

Large message sets, nested state and effect coordination can complicate composition.

Case file

A worked decision

A timetable editor encodes loading, draft changes and save results as messages and derives its screen from the updated model. A late save reply is associated with its revision.

Change the condition

For one read-only arrival display that never accepts edits, rendering fetched data directly may be enough.

Check the decision

Feed an older save reply after a newer edit and check that the displayed model preserves the unsaved revision.

Relationships

Catalog note · Specializes: Unidirectional Data Flow

Referenced by other entries (1)

Sources

Architecture pattern

Enterprise data warehouse bus

Integrate business-process fact tables through conformed dimensions.

FamilyAnalytical architecture
ScopeWarehouse and business domains
Editorial statusDraft

What it buys

Conformed dimensions let independently delivered business-process facts participate in the same report.

Apply when

Reports must compare facts across processes using consistent definitions of customer or time.

Reconsider when

Independent marts have genuinely different grain or semantics and no shared decisions.

Costs and failure modes

Conformance requires negotiation and durable ownership of shared definitions.

Case file

A worked decision

A chain adopts conformed store and date dimensions for sales and inventory marts while retaining each fact table's own grain.

Change the condition

A standalone mart with no cross-process analysis can define its dimensions locally.

Check the decision

Do both marts agree about fiscal week boundaries and historical store identities?

Relationships

Catalog note · Uses: Dimensional star schema

Referenced by other entries (1)

Sources

Integration architecture

Enterprise Service Bus

Use shared integration infrastructure to route, translate and mediate calls or messages.

FamilyEnterprise integration
ScopeEnterprise systems
Editorial statusDraft

Also indexed as · ESB

What it buys

Several integrations can reuse the same routing and protocol conversion infrastructure across otherwise incompatible endpoints.

Apply when

Many legacy systems require protocol and format mediation with centralized operating expertise.

Reconsider when

A few peers share clear contracts and can integrate directly.

Costs and failure modes

Shared delivery gates and business logic in the bus can couple unrelated teams.

Case file

A worked decision

A wholesaler connects a mainframe sending fixed-width messages with an ERP using XML and a warehouse accepting broker messages. A bus translates and routes common exchanges with monitored failure queues.

Change the condition

If only two modern applications share a stable contract, use a direct interface and avoid a central integration release dependency.

Check the decision

Change one partner's format and verify whether the bus mapping alone can absorb it without altering unrelated routes.

Relationships

Catalog note · Can implement part of: Service-Oriented Architecture

Referenced by other entries (1)

Sources

Tactical design pattern

Entity

Track continuity of identity across changes to an object's attributes or representation.

FamilyDomain modeling
ScopeDomain type
Editorial statusDraft

What it buys

Bookings, invoices, or audit records can continue to refer to the same customer after the customer's name or address changes.

Apply when

An account or order remains the same business thing as its state changes.

Reconsider when

Two instances are interchangeable whenever their values match.

Costs and failure modes

Identity allocation, lifecycle and reconciliation require explicit rules.

Case file

A worked decision

A rental company tracks a particular van through repairs, plate changes and repainting. A stable vehicle identifier connects the history even when all visible details change.

Change the condition

If the program only compares dimensions of proposed crates, values can be compared by their contents without persistent identity.

Check the decision

Change the van's registration number and verify that the repair history remains attached to the same vehicle.

Relationships

Catalog note · Contrasts with: Value Object

Referenced by other entries (1)

Sources

Data-oriented architectural style

Entity Component System (ECS)

Represent entities by identity, store component data separately and run systems over matching entities.

FamilySpecialized architecture
ScopeSimulation / entity storage
Editorial statusDraft

What it buys

A system can update only entities with the components it needs and process those components in a cache-friendly order.

Apply when

Many game or simulation entities share component sets and bulk updates dominate.

Reconsider when

A handful of heterogeneous objects have behavior best expressed independently.

Costs and failure modes

Structural changes and system ordering complicate reasoning and may cost more than dispatch saved.

Case file

A worked decision

A particle engine stores positions and velocities as components and updates every moving particle in a focused system. Entities lacking velocity do not join that update.

Change the condition

If a small narrative game has a few actors with highly individual scripts, a compact object per actor may be easier to maintain.

Check the decision

Profile the movement system and confirm that its writes are disjoint before running chunks in parallel.

Relationships

Catalog note · Complements: Data Parallelism where system updates have independent writes.

Referenced by other entries (2)

Study this decision

Sources

Architectural topology

Event broker topology

Components react to events and emit subsequent events through broker channels without a central workflow coordinator.

FamilyEvent-driven architecture
ScopeIntegration and workflow
Editorial statusDraft

Also indexed as · Broker topology for event-driven architecture

What it buys

A new independent reaction can be attached to an existing event channel without revising a central process definition.

Apply when

Subscribers need autonomy and no component owns an end-to-end workflow.

Reconsider when

A regulated sequence needs explicit progress tracking and timed recovery.

Costs and failure modes

Long causal chains hide completion, ownership and failure paths.

Case file

A worked decision

A publisher emits ArticleReleased and leaves search, email and syndication free to add their own reactions. The producer has no definition of a shared completion step.

Change the condition

If publication is complete only after named systems finish in a specified order, introduce an owner for the process.

Check the decision

Disable syndication and verify that search still updates while the failed subscriber's backlog remains visible.

Relationships

Catalog note · Alternative: Event mediator topology

Sources

Architectural topology

Event mediator topology

A mediator coordinates the steps triggered by an initial event and directs processing components.

FamilyEvent-driven architecture
ScopeIntegration and workflow
Editorial statusDraft

Also indexed as · Mediator topology for event-driven architecture

What it buys

The owner of a multi-step reaction can inspect one coordination policy to determine which step should follow a result.

Apply when

A multistep event flow requires an explicit sequence and recovery owner.

Reconsider when

Independent subscribers need only a notification and no shared completion condition.

Costs and failure modes

The coordinator couples to the process definition and needs durable recovery.

Case file

A worked decision

A grant disbursement coordinator requests eligibility, signed consent and bank approval in order, resuming when each result arrives. The coordinator records the current stage and missed deadlines.

Change the condition

If unrelated consumers only need to know a grant was awarded, directly publishing the event avoids a needless workflow controller.

Check the decision

Interrupt the coordinator after bank approval and verify it resumes without submitting the payment instruction twice.

Relationships

Catalog note · Related: Process Manager

Sources

Message role

Event Message

Publish a fact about something that has already occurred.

FamilyMessage contracts
ScopeService boundary
Editorial statusDraft

What it buys

Several consumers can interpret a completed occurrence according to their own needs without obligating the publisher to direct their work.

Apply when

Independent consumers should decide how to respond to a completed change.

Reconsider when

A sender requires one specific recipient to perform an action and report success.

Costs and failure modes

Implicit workflows become difficult to follow. Schemas must evolve compatibly.

Case file

A worked decision

A theatre emits PerformanceCancelled only after the cancellation commits. Ticketing, signage and marketing receive the fact and make independent decisions about their own work.

Change the condition

If the theatre manager is asking an authority to approve a cancellation, send a command or request rather than declaring a cancellation.

Check the decision

Simulate a rolled-back cancellation and verify that no subscriber receives a committed cancellation fact.

Relationships

Catalog note · Contrasts with Command Message.

Referenced by other entries (2)

Sources

Interaction pattern

Event Notification

Announce a completed change, letting each subscriber decide if it should act or fetch details.

FamilyEvent-driven integration
ScopeService boundary
Editorial statusDraft

What it buys

A publisher can alert many subscribers with a small message and let each decide whether it needs the full current data.

Apply when

The publisher needs no specific response from any particular subscriber.

Reconsider when

The sender depends on one recipient taking an action and reporting whether it succeeded.

Costs and failure modes

Thin notifications can trigger extra reads and obscure cross-service control flow.

Case file

A worked decision

A parcel-status service sends ParcelMoved with a parcel ID to a monitoring tool, which fetches the current status only if somebody is watching.

Change the condition

If thousands of consumers must all fetch the same full parcel state immediately, carrying selected data in the event can reduce read pressure.

Check the decision

Pause a subscriber during two parcel moves and verify whether fetching the latest state still satisfies its actual requirement.

Relationships

Catalog note · Uses Event Message and contrasts with Command Message.

Referenced by other entries (1)

Study this decision

Sources

Persistence pattern

Event Sourcing

Make an append-only history of domain events authoritative and reconstruct state by folding it.

FamilyService data boundaries
ScopeDomain model and store
Editorial statusDraft

What it buys

A team can reconstruct earlier domain state or build a new projection from retained domain events whose historical semantics remain available.

Apply when

History, temporal reconstruction or auditability is part of the domain’s behavior.

Reconsider when

Only the current record matters and a conventional audit log suffices.

Costs and failure modes

Event versioning, privacy requirements, replay correctness and projection repair endure over time.

Case file

A worked decision

A policy administration system must reconstruct the terms in effect after each endorsement, so policy changes become authoritative domain events.

Change the condition

If only the current policy and an access log are required, store the current record with a conventional audit trail.

Check the decision

Can an old policy be rebuilt after endorsement event formats evolve?

Relationships

Catalog note · Composes with CQRS when separate projections serve readers.

Referenced by other entries (3)

Sources

BPMN construct

Event Subprocess

Activate a local event handler while its enclosing process scope exists, optionally interrupting normal work.

FamilyWorkflow control flow
ScopeEnclosing process scope
Editorial statusDraft

What it buys

One scoped handler can cover a recall during any active shipment stage without reproducing the same interrupt branch at every step.

Apply when

Several steps share the same cancellation, escalation or message-handling rule.

Reconsider when

One activity alone needs a timeout and a local boundary handler is simpler.

Costs and failure modes

Interrupting the scope can terminate unrelated active branches. Non-interrupting handlers can overlap.

Case file

A worked decision

A shipment can receive a safety recall during any active stage, so the enclosing process defines an interrupting recall handler.

Change the condition

If recalls are checked only before dispatch, add one check at dispatch.

Check the decision

Does a recall during packing prevent the original shipment path from reaching dispatch?

Relationships

Catalog note · Can implement exception handling inside a Process Manager.

Referenced by other entries (1)

Sources

Integration pattern

Event-Carried State Transfer

Include changed data in events so subscribers can maintain their own working copies.

FamilyEvent-driven integration
ScopeService boundary
Editorial statusDraft

What it buys

A subscriber can serve local reads from received state even while the publishing service is unavailable.

Apply when

Consumers must keep functioning without synchronous calls back to the source.

Reconsider when

Consumers rarely need the data, must see the latest value immediately, or should not retain copies.

Costs and failure modes

Replication creates lag, privacy obligations, schema evolution and repair work.

Case file

A worked decision

A store receives catalog events carrying the current label and permitted shipping classes. Its checkout service projects this data locally and quotes shipping during a catalog outage.

Change the condition

If checkout requires an immediately revoked safety restriction to take effect everywhere, a possibly stale replica cannot authorize the decision.

Check the decision

Delay a restriction change and measure whether checkout enforces its documented staleness limit.

Relationships

Catalog note · Can populate a Command-Side Replica.

Referenced by other entries (3)

Sources

Architectural style

Event-driven architecture

Publish events describing something that happened and let interested components react.

FamilyEvent-driven architecture
ScopeApplication or system
Editorial statusDraft

What it buys

A producer can record that something happened while several consumers evolve their independent reactions.

Apply when

Independent consumers join over time or work must continue across a time boundary.

Reconsider when

Immediate coordination and a single transaction are the dominant requirements.

Costs and failure modes

Ordering, replay semantics and end-to-end diagnosis need explicit design.

Case file

A worked decision

A rail timetable publisher emits revisions so platform displays and passenger apps can update independently. Consumers tolerate brief lag and reconcile against a current timetable after interruptions.

Change the condition

If a signal interlock needs a synchronous authoritative decision before enabling a route, asynchronous announcements alone cannot grant it.

Check the decision

Deliver timetable revisions out of order and check which version each display finally presents.

Relationships

Catalog note · Specializations include: Event broker topology, Event mediator topology

Sources

Processing pattern

Event-time windowing and watermarks

Group records by event timestamp and use a progress estimate to trigger results.

FamilyStream processing
ScopeStream operator
Editorial statusDraft

What it buys

Aggregates can be assigned to the business time they describe and revised under an explicit lateness policy.

Apply when

Late and out-of-order events change the meaning of a business-time aggregate.

Reconsider when

Arrival-time reporting satisfies the contract and late corrections have no value.

Costs and failure modes

Waiting improves completeness at the cost of latency and retained state.

Case file

A worked decision

A meter service groups readings by measurement time and advances a watermark before closing each billing interval.

Change the condition

When only arrival volume matters, processing-time windows avoid lateness and correction policies.

Check the decision

What happens to a reading from a disconnected meter after the billing watermark passes?

Relationships

Catalog note · Complements: Kappa architecture

Study this decision

Sources

Control and type mechanism

Exhaustive pattern matching

Branch on a structured value while checking that every supported variant is handled.

FamilyTypes and polymorphism
ScopeType or public contract
Editorial statusDraft

Also indexed as · Exhaustiveness checking

What it buys

Adding a new variant can reveal exactly which decisions need updating when the language enforces exhaustiveness.

Apply when

Missing a variant is a meaningful defect and the value shape is finite and known.

Reconsider when

An open-ended plugin family must extend behavior without editing the dispatcher.

Costs and failure modes

A catch-all arm can conceal an accidentally unhandled new case.

Case file

A worked decision

A claims processor handles Accepted, Rejected and NeedsReview. A new Escalated case should force a policy decision.

Change the condition

If insurers supply plugins independently, dispatch through their published interface.

Check the decision

Does adding a new variant make every critical decision site visibly incomplete?

Relationships

Sources

Operating-system architectural style

Exokernel and Library OS

A minimal kernel protects resource use while unprivileged libraries implement higher-level abstractions.

FamilyOperating-system architecture
ScopeKernel / application-level OS library
Editorial statusDraft

What it buys

Different applications can select resource-management policies while protection remains in a small privileged core.

Apply when

Specialized applications benefit from choosing their own resource abstractions.

Reconsider when

A stable conventional OS API and mature general-purpose tooling matter more.

Costs and failure modes

Resource policies and compatibility work migrate into application libraries.

Case file

A worked decision

A storage appliance implements its preferred disk layout in an application library while a kernel arbitrates access to disk blocks.

Change the condition

For a conventional application that needs standard filesystem tools, use the host filesystem.

Check the decision

Which resource grants may the kernel revoke, and how does the library recover?

Relationships

Catalog note · Contrast: OS Microkernel exports privileged primitives to isolated services.

Sources

Evolution pattern

Expand and contract

Introduce a compatible shape, migrate consumers, then retire the old shape.

FamilyRelease architecture
ScopeSchema, API or protocol
Editorial statusDraft

What it buys

Producers and consumers can migrate at different times while both representations remain supported.

Apply when

A rolling release spans independent clients or a shared database.

Reconsider when

All parties can change atomically and there is no compatibility window.

Costs and failure modes

Dual formats or writes can drift and the old form can linger.

Case file

A worked decision

A shipment service adds a new carrier field, deploys compatible writers and backfills old records. It switches readers after checking parity, then retires legacy writers and removes the old field once rollback no longer needs it.

Change the condition

If all consumers can stop together for a short migration, a coordinated replacement may be simpler.

Check the decision

Which running consumer or rollback version still references the old column?

Relationships

Catalog note · Enables: Rolling update

Referenced by other entries (1)

Sources

Design pattern

Extension Interface

Expose optional capabilities via additional interfaces on a component.

FamilyMiddleware structure
ScopeComponent / API compatibility
Editorial statusDraft

What it buys

A host can take advantage of a device's optional capability while still admitting devices that implement only the original contract.

Apply when

Existing clients must remain compatible as some clients adopt new capabilities.

Reconsider when

All clients ship in lockstep and a single interface is sufficiently stable.

Costs and failure modes

Capability probing multiplies compatibility paths to test.

Case file

A worked decision

A deployed graphics host probes for an optional color-calibration interface while continuing to support older devices.

Change the condition

If every device must implement calibration, put it on the base contract.

Check the decision

Does the host still render on a device that lacks the calibration interface?

Relationships

Catalog note · Alternative: versioned replacement interface.

Referenced by other entries (1)

Sources

Configuration pattern

External configuration store

Read deployment-independent configuration from a shared external source.

FamilyCloud infrastructure
ScopeApplication fleet
Editorial statusDraft

What it buys

Operators can change a shared setting independently of shipping a new application binary.

Apply when

A coordinated runtime change must reach many services or instances.

Reconsider when

A small immutable application benefits more from versioned configuration shipped with it.

Costs and failure modes

Availability, stale reads and rollout consistency need explicit handling.

Case file

A worked decision

A shipping application reads versioned carrier cutoffs shared by multiple workers and keeps a last-known-good copy.

Change the condition

If a setting changes only with a compatible code release, ship it with the application.

Check the decision

Can a malformed cutoff be rolled back before workers disagree on promised dates?

Relationships

Catalog note · Complements: Deployment stamps

Sources

Architecture pattern

Externalized authorization policy

Separate policy decisions from the code that enforces each decision.

FamilySecurity architecture
ScopeService and control plane
Editorial statusDraft

What it buys

One policy change can govern multiple enforcement points through a common decision contract.

Apply when

Independent services must apply the same evolving access rules.

Reconsider when

A local fixed rule is clear and shared policy infrastructure adds a failure dependency.

Costs and failure modes

Stale policy replicas and unclear fail-open behavior can undermine enforcement.

Case file

A worked decision

An appeals service submits subject, action, and case metadata to a policy decision point and enforces its result at the endpoint.

Change the condition

A single application with stable permissions may keep policy close to the protected operation.

Check the decision

If the policy service times out, which operations fail closed and which have an explicitly approved fallback?

Relationships

Catalog note · Can implement: Attribute-based access control

Referenced by other entries (1)

Sources

Object-oriented design pattern

Facade

Offer a focused entry point that orchestrates a subsystem's more detailed interfaces.

FamilyGoF · Structural
ScopeClient-facing subsystem interface
Editorial statusDraft

What it buys

A common operation can present a smaller and more stable surface than the underlying subsystem.

Apply when

Many callers repeat a sequence of subsystem interactions with common intent.

Reconsider when

Consumers need individual capabilities and a thin forwarding layer adds no simplification.

Costs and failure modes

An overly broad facade attracts unrelated dependencies and changes.

Case file

A worked decision

A publishing facade offers one publish operation over asset validation, manifest creation, and release registration.

Change the condition

If a caller needs independent control and retries for each step, expose the underlying operations deliberately.

Check the decision

After registration fails, can the caller discover what the facade already committed?

Relationships

Catalog note · Related across a network boundary: Remote Facade

Referenced by other entries (2)

Sources

Object-oriented design pattern

Factory Method

Let a creator's subclass override the operation that chooses the product implementation.

FamilyGoF · Creational
ScopeClass hierarchy / product creation
Editorial statusDraft

What it buys

A framework can own an algorithm while allowing an extension to choose the concrete product it needs.

Apply when

A framework owns a workflow but extensions must supply the product used in one step.

Reconsider when

There is one fixed implementation or a constructor function can be passed directly.

Costs and failure modes

Each creation variant can require a new creator subclass.

Case file

A worked decision

A document framework fixes its open-document workflow while format-specific creator subclasses override which parser object is made.

Change the condition

If callers can pass a parser constructor, use a function parameter and avoid a subclass hierarchy.

Check the decision

Does a new parser require changing the framework workflow, or only the creation hook?

Relationships

Catalog note · Often used inside: Template Method

Referenced by other entries (1)

Sources

Data architecture

Feature store

Manage reusable feature definitions and deliver historical values for training and current values for inference.

FamilyML and AI systems
ScopeModel training and serving
Editorial statusDraft

What it buys

Training and serving can reuse agreed feature definitions and retrieve values appropriate for their respective time points.

Apply when

Several models reuse features and need consistent point-in-time values.

Reconsider when

A single batch model already computes every feature in a reproducible pipeline.

Costs and failure modes

Freshness, point-in-time joins and training-serving skew demand monitoring.

Case file

A worked decision

A credit-risk team defines account-age and repayment features for training snapshots and online scoring with consistent time semantics.

Change the condition

If a single batch model uses features once, a versioned dataset and transformation may suffice.

Check the decision

Can a historical training row use a feature value that became available only after the prediction timestamp?

Relationships

Catalog note · Can use: Log-based change data capture

Sources

Release technique

Feature toggles

Select old or new behavior without redeploying the application.

FamilyRelease architecture
ScopeApplication and release
Editorial statusDraft

What it buys

An operator can expose or withdraw behavior for a cohort independently of deploying a new binary.

Apply when

Business exposure must be separated from deployment, or only a cohort should see a feature.

Reconsider when

A simple deployment can release the complete feature and no independent switch is needed.

Costs and failure modes

Flags multiply test combinations and abandoned branches become hard to remove.

Case file

A worked decision

A tax calculator deploys a new formula behind a regional flag and records which rule version produced each quote.

Change the condition

For a change that must become universal in a single controlled release, separate flag state can create confusion.

Check the decision

Who removes the flag and old calculation after the last jurisdiction switches?

Relationships

Catalog note · Complements: Canary release

Referenced by other entries (1)

Sources

Identity pattern

Federated identity

Rely on an external identity provider and validate its assertions locally.

FamilySecurity architecture
ScopeTrust boundary
Editorial statusDraft

What it buys

Users and relying applications can reuse an established authentication authority across organizational boundaries.

Apply when

Several applications or organizations need shared sign-in across trust boundaries.

Reconsider when

An offline local tool needs no external identity trust.

Costs and failure modes

Provider availability, claim mapping and trust configuration affect every relying service.

Case file

A worked decision

A university accepts signed assertions from configured partner institutions after checking issuer, signature, audience and validity period. It maps the issuer and subject together to the local enrollment.

Change the condition

For an offline tool on one workstation, local authentication avoids an external identity dependency.

Check the decision

Can two institutions issue the same subject value without colliding in the local account map?

Relationships

Catalog note · Complements: Gateway offloading

Referenced by other entries (1)

Sources

Distributed training architecture

Federated learning

Train locally and aggregate model updates across participating devices or organizations.

FamilyML and AI systems
ScopeClient fleet and coordinator
Editorial statusDraft

What it buys

Organizations can collaborate on model updates while keeping training examples on their originating systems.

Apply when

Data cannot be pooled centrally and clients can contribute useful local training.

Reconsider when

Centralized training meets policy and heterogeneous clients add needless coordination.

Costs and failure modes

Uneven participation, communication and privacy leakage from updates need controls.

Case file

A worked decision

Several hospitals train a shared classifier by combining local model updates while retaining raw cases at each hospital.

Change the condition

If lawful centralized training is feasible and sites are small, a governed pooled dataset simplifies iteration.

Check the decision

Could a malicious participant or model update reveal information about an individual record?

Relationships

Catalog note · Composes with: Fog computing

Sources

Coordination mechanism

Fencing Token

Attach an increasing ownership token to writes and make the protected resource reject older tokens.

FamilyCluster coordination
ScopeExternal resource
Editorial statusDraft

What it buys

A storage target can reject an obsolete holder's late write after a replacement has established a newer fencing epoch.

Apply when

A paused former lease holder may resume after another owner takes over.

Reconsider when

The target cannot compare and enforce tokens at the write boundary.

Costs and failure modes

Generating ordered tokens requires trusted coordination. Every write path must enforce them.

Case file

A worked decision

A paused backup leader may resume after its lease expires, so the storage target rejects writes bearing an older leadership epoch.

Change the condition

If all writes occur under a single database transaction, use transactional exclusion.

Check the decision

After epoch 42 writes, can a resumed writer using epoch 41 overwrite its output?

Relationships

Catalog note · Complements Lease by rejecting stale writers.

Referenced by other entries (2)

Sources

Collection operation

Filter by predicate

Select elements that satisfy an explicit predicate.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

Also indexed as · filter, where

What it buys

The eligibility rule can be tested separately and applied consistently to multiple collections.

Apply when

Dropping nonmatches is intentional and downstream consumers require only matching items.

Reconsider when

Rejected items need explanations, retries or audit records.

Costs and failure modes

A filter can silently discard evidence when rejection itself is important.

Case file

A worked decision

A media browser shows only photographs taken in the selected month. Nonmatches legitimately disappear from this view.

Change the condition

An import validator must explain every rejected record, so retain a classified result for each input.

Check the decision

Can the caller tell whether an empty result means no matches or a failed data source?

Relationships

Study this decision

Sources

Partitioning pattern

Fixed Partitions

Map keys into a stable set of logical partitions and move partition ownership as the cluster changes.

FamilyPartitioning and placement
ScopeDistributed store
Editorial statusDraft

What it buys

Operators can rebalance stable units of ownership without changing how each record maps to its logical partition.

Apply when

The topology changes but key-to-partition assignment should stay stable.

Reconsider when

Individual large keys or data distributions demand frequent partition splitting.

Costs and failure modes

Choosing too few partitions caps rebalancing flexibility. Too many increase metadata.

Case file

A worked decision

A queue allocates a known set of logical partitions and reassigns whole partitions as consumers join.

Change the condition

If throughput never needs independent workers, keep a single queue.

Check the decision

When adding workers beyond the partition count, how many can own useful work?

Relationships

Catalog note · Alternative to dynamically split Key-Range Partitions.

Referenced by other entries (1)

Sources

Timing strategy

Fixed-Timestep Simulation

Advance simulation in fixed increments while accumulating elapsed wall time.

FamilyGame and simulation architecture
ScopeSimulation / render loop
Editorial statusDraft

What it buys

A slow render frame need not change the duration used by each physics integration step.

Apply when

Physics or deterministic replay needs repeatable integration steps given identical inputs and execution conditions.

Reconsider when

An event-driven simulation already advances accurately at sparse state changes.

Costs and failure modes

Falling behind can trigger repeated catch-up work and worsen latency.

Case file

A worked decision

A replayable billiards simulation advances collision physics in fixed-duration steps while the renderer may draw frames at varying intervals.

Change the condition

If an animation has no simulation or replay requirements, elapsed-time interpolation alone may be sufficient.

Check the decision

Replay the same timestamped shots under different render frame rates and compare the sequence of simulation states.

Relationships

Catalog note · Specializes: Game Loop; interpolation can smooth rendering.

Referenced by other entries (1)

Study this decision

Sources

Object-oriented design pattern

Flyweight

Share intrinsic immutable data and supply occurrence-specific context at use time.

FamilyGoF · Structural
ScopeMany fine-grained instances
Editorial statusDraft

What it buys

Many logical instances can share immutable intrinsic data, reducing duplicated storage.

Apply when

Profiling shows repeated equivalent object data is consuming substantial memory.

Reconsider when

Values are mostly unique or state lookup exceeds the memory savings.

Costs and failure modes

Separating intrinsic and extrinsic state complicates the design and makes shared mutation dangerous.

Case file

A worked decision

A map renderer shares immutable glyph outlines among thousands of labels and stores each label's placement separately.

Change the condition

If nearly every glyph has a unique representation, pooling adds lookup overhead with little memory benefit.

Check the decision

Do memory profiles show fewer retained outline bytes after including the pool's own cost?

Relationships

Catalog note · Related data-layout concern: Data-Oriented Design

Sources

Reference model

Fog computing

Distribute compute, storage and networking to intermediate nodes near data sources.

FamilyClient and edge architecture
ScopeDevice, edge and cloud
Editorial statusDraft

What it buys

A site can react to local measurements without paying the round-trip time or bandwidth cost of sending every sample to the cloud.

Apply when

Bandwidth, locality or latency prevents sending all work to a central platform.

Reconsider when

A reliable low-latency link and cheap centralized processing already meet requirements.

Costs and failure modes

Fleet security, upgrades, physical exposure and intermittent links add cost.

Case file

A worked decision

An offshore turbine gateway aggregates vibration readings and raises local alerts during a satellite outage. It forwards summaries and selected traces to a regional service after reconnection.

Change the condition

A test bench on a stable factory network can send its few readings straight to the central service.

Check the decision

Disconnect the gateway and measure whether the alert still reaches the operator before the defined response deadline.

Relationships

Catalog note · Complements: Reconciliation loop

Sources

Collection operation

Fold / reduce

Combine input values with an accumulator and a named step function.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

Also indexed as · fold, reduce, aggregate

What it buys

A stream can produce a compact summary in one pass when the accumulator size stays bounded.

Apply when

A sequential summary can be stated as the meaning of an accumulated prefix.

Reconsider when

The task is clearer as a direct library sum or requires complex early exits and effects.

Costs and failure modes

A wrong initial value or an invalid assumption of associativity changes results.

Case file

A worked decision

Fold stock movements into a balance using a known opening amount. A sequential fold preserves the order of movements.

Change the condition

For an ordinary integer count, use the collection's count operation.

Check the decision

Does the empty input yield the correct opening balance, and would parallel regrouping preserve the result?

Relationships

Referenced by other entries (1)

Sources

Replication pattern

Follower Reads

Serve eligible reads at replicas following a write leader.

FamilyReplication and consistency
ScopeReplicated store
Editorial statusDraft

What it buys

A lag-tolerant archive can serve readers from nearby replicas and reserve writer capacity for changes that require it.

Apply when

Read locality or throughput matters and the application can bound or accept staleness.

Reconsider when

The next read must immediately observe a recent write and no safe replica-read protocol exists.

Costs and failure modes

Replica lag can reveal different states to successive reads.

Case file

A worked decision

A public archive serves last week's articles from nearby replicas where delayed corrections are acceptable.

Change the condition

If an editor must immediately verify a fresh correction, read from the writer or a sufficiently caught-up replica.

Check the decision

Can the archive detect a replica older than its published freshness allowance?

Relationships

Catalog note · Extends Leader and Followers with a read-placement decision.

Sources

Parallel control-flow pattern

Fork–Join Parallelism

Fork independent child work and join it before dependent execution continues.

FamilyParallel and scientific computing
ScopeFunction / parallel region
Editorial statusDraft

What it buys

Independent subproblems can run concurrently and be joined exactly where their results are needed.

Apply when

A computation can split into substantial independent pieces with one merge point.

Reconsider when

Subtasks are tiny or need to stream partial results instead of waiting for a join.

Costs and failure modes

The slowest child delays the join and excess tasks increase scheduling overhead.

Case file

A worked decision

An image pyramid recursively splits large tiles, processes them independently and joins their summaries at each parent.

Change the condition

When tiles are tiny, a sequential base case avoids spawning more work than it performs.

Check the decision

At what tile size does scheduling overhead exceed useful work?

Relationships

Catalog note · Complements: Work Stealing can balance ready child tasks.

Referenced by other entries (2)

Sources

Network intermediary role

Forward Proxy

A client selects an intermediary to forward its requests toward origin servers.

FamilyNetwork architecture and protocols
ScopeClient / outbound network boundary
Editorial statusDraft

What it buys

An organization can apply egress rules and audit outgoing requests at one controlled point shared by clients.

Apply when

An organization needs common outbound access policy or shared caching.

Reconsider when

End-to-end identity or confidentiality rules prohibit the intended inspection.

Costs and failure modes

Trust and failure can concentrate at the intermediary.

Case file

A worked decision

Corporate build agents fetch packages through an egress proxy that owns enterprise access rules and auditing.

Change the condition

If a standalone developer machine needs no shared egress policy, connect directly.

Check the decision

Can the proxy identify which build agent initiated a blocked package request?

Relationships

Catalog note · Contrast: Reverse Proxy stands in front of origin servers.

Sources

Request dispatch pattern

Front Controller

Route requests through one logical entry for shared handling and dispatch.

FamilyWeb presentation
ScopeWeb application entry point
Editorial statusDraft

What it buys

A new endpoint can inherit the same dispatch and request handling policy as existing endpoints.

Apply when

Authentication, routing and common error behavior need consistent handling.

Reconsider when

Unrelated clients or protocols require fundamentally different entry policies.

Costs and failure modes

Excessive branching turns a dispatcher into a bottleneck for changes.

Case file

A worked decision

A university has dozens of administrative web routes requiring the same authentication, locale selection and error mapping. One front controller applies them before dispatch.

Change the condition

A tiny personal site with two unrelated pages and no common request policy can use page-specific handlers.

Check the decision

Add a new protected route and verify that authentication applies before its handler executes.

Relationships

Catalog note · Alternative: Page Controller

Referenced by other entries (1)

Sources

Execution model

Function as a Service

Delegate function scheduling and instance lifecycle to a managed execution platform.

FamilyCloud infrastructure
ScopeFunction and event platform
Editorial statusDraft

Also indexed as · FaaS

What it buys

An infrequent event handler can run without the team provisioning permanently idle workers.

Apply when

Short event-driven workloads are bursty and external state is acceptable.

Reconsider when

Long-lived connections or predictable steady load need tight lifecycle or cost control.

Costs and failure modes

Cold starts, execution limits and platform coupling affect behavior.

Case file

A worked decision

A thumbnail function runs when a photo arrives and writes a result keyed by input version to tolerate redelivery.

Change the condition

For a continuously busy GPU pipeline, a persistent worker may reuse resources more efficiently.

Check the decision

Does the largest supported image complete within execution and memory limits?

Relationships

Catalog note · Can implement stages in: Pipes and Filters

Referenced by other entries (1)

Sources

Compositional technique

Function composition

Connect functions by using one result as the next input.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

Each step in a transformation can be tested on its own and reused in a new sequence with matching inputs and outputs.

Apply when

A chain of independent transformations shares clear input and output contracts.

Reconsider when

Steps need unrelated branching, cleanup or retries more naturally expressed in an explicit workflow.

Costs and failure modes

An opaque composition can conceal intermediate failures and debugging points.

Case file

A worked decision

A search index normalizes Unicode, folds case and splits words. Each pure stage can be tested with the preceding stage's output.

Change the condition

If tokenization depends on an external service with retry policy, surface that effect rather than silently chaining it.

Check the decision

At which boundary would you inspect the text if normalization changes a word boundary?

Relationships

Sources

Architecture pattern

Functional Core, Imperative Shell

Compute decisions from explicit input in a pure core and perform I/O in a surrounding shell.

FamilyProgramming model and architecture
ScopeFunction through application
Editorial statusDraft

Also indexed as · FCIS

What it buys

A policy change can be tested against plain input values without starting a database, reading a clock, or contacting a remote service.

Apply when

Business rules need deterministic tests independently of clocks, storage or network.

Reconsider when

Most work is simple I/O forwarding and the boundary would add translation without meaningful logic.

Costs and failure modes

Maintaining a pure boundary requires explicit data transfer and effect handling.

Case file

A worked decision

An energy retailer's shell reads meter data and today's published tariff, then calls a pure bill calculator and persists the result. The calculator accepts snapshots of all inputs it uses.

Change the condition

If an endpoint simply forwards an uploaded meter image to storage, creating a pure core may produce an empty layer.

Check the decision

Run a saved tariff and consumption snapshot through the calculator and reproduce the billed amount without infrastructure.

Relationships

Catalog note · Can combine with: Hexagonal Architecture

Referenced by other entries (2)

Study this decision

Sources

Sequencing pattern

Game Loop

Repeatedly take input, advance simulation and render without waiting for the next input event.

FamilyGame and simulation architecture
ScopeInteractive runtime
Editorial statusDraft

What it buys

Animation and simulation can progress during periods with no user input.

Apply when

The world continues evolving even while players supply no input.

Reconsider when

A turn-based UI can sleep until an event arrives.

Costs and failure modes

Time management and scheduling determine responsiveness and CPU use.

Case file

A worked decision

An arcade cabinet polls input, advances entities and renders the scene repeatedly even if the player presses nothing. Its loop allocates each cycle's time among those tasks.

Change the condition

For an interactive settings form that changes only after a click, a continuously running game loop wastes work.

Check the decision

Leave the controls untouched and verify that autonomous enemies advance and input responsiveness remains within budget.

Relationships

Catalog note · Specialized by: Fixed-Timestep Simulation.

Referenced by other entries (2)

Study this decision

Sources

Integration pattern

Gateway

Represent an external system or resource behind a local access object.

FamilyEnterprise integration
ScopeExternal resource boundary
Editorial statusDraft

What it buys

A change to an external provider's API can often be handled in one place behind a locally meaningful operation.

Apply when

Vendor APIs expose unstable conventions or behavior that recurs across callers.

Reconsider when

One short-lived caller already consumes a stable suitable interface.

Costs and failure modes

A gateway can conceal latency or grow into a vendor-shaped dependency for every consumer.

Case file

A worked decision

A mapping tool wraps a geocoding vendor behind a local operation that returns its own coordinates and ambiguity status. Vendor-specific error codes are translated at that boundary.

Change the condition

If an experimental script uses one vendor call once, a dedicated gateway may add little over a direct call.

Check the decision

Swap in a recorded vendor response with an ambiguous address and verify the caller sees only local types.

Relationships

Catalog note · Can implement an adapter in: Hexagonal Architecture / Ports and Adapters

Referenced by other entries (1)

Sources

Edge pattern

Gateway offloading

Move common work such as TLS or token validation to a gateway.

FamilyCloud infrastructure
ScopeApplication ingress
Editorial statusDraft

What it buys

Shared edge functions can be applied consistently without being independently reimplemented in every backend.

Apply when

Many services would otherwise duplicate the same edge concern.

Reconsider when

A service requires a domain-specific decision the gateway cannot evaluate safely.

Costs and failure modes

The gateway concentrates trust, load and configuration risk.

Case file

A worked decision

An API gateway validates external tokens and applies a request-size cap before forwarding uploads to several services.

Change the condition

If one internal endpoint already enforces both rules reliably, another gateway adds a hop.

Check the decision

Can callers bypass the gateway and reach a backend that trusts its headers?

Relationships

Catalog note · Complements: Federated identity

Referenced by other entries (2)

Sources

Control abstraction

Generator / coroutine iterator

Suspend a producer at a yield point and resume it when the next value is requested.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

A parser can yield records as they arrive while keeping its place between requests, without first materializing the full dataset.

Apply when

A traversal with local state produces many values and callers may stop early.

Reconsider when

A short fixed collection is easier to return eagerly.

Costs and failure modes

Single-pass consumption and cleanup on early exit must be explicit.

Case file

A worked decision

A decoder yields complete frames from a recording as a caller scrolls. It keeps the partially decoded position between requests.

Change the condition

A dialog showing five known file types can return a list.

Check the decision

Does stopping after one frame release the file, and can a second caller start independently?

Relationships

Sources

Generic design approach

Generic algorithm and concept

Parameterize an algorithm by the operations and semantic properties required of its input types.

FamilyProgramming model and architecture
ScopeFunction and library
Editorial statusDraft

What it buys

One tested search or ordering algorithm can work across unrelated data types that meet the stated behavioral requirements.

Apply when

Different representations can share an algorithm while preserving their own types.

Reconsider when

There is one concrete operation and the type parameters obscure its intent.

Costs and failure modes

Undocumented semantic requirements can defeat type checking and produce incorrect results.

Case file

A worked decision

A merge algorithm handles appointments, ledger entries and log records using their common ordering contract. The caller supplies comparison semantics while retaining its concrete item type.

Change the condition

If a sorting rule is only meaningful for appointment conflicts, a named appointment operation makes that domain constraint clearer.

Check the decision

Give the algorithm a comparator that violates transitivity and check where its precondition is documented or validated.

Relationships

Catalog note · Can combine with: Policy-based design

Referenced by other entries (2)

Study this decision

Sources

Multiregion architecture

Geode

Deploy capable regional nodes that can serve requests from any region.

FamilyCloud infrastructure
ScopeGlobal service
Editorial statusDraft

What it buys

A nearby healthy regional node can serve users even when a distant region is impaired, if data policy permits.

Apply when

Low regional latency and geographic resilience justify data distribution.

Reconsider when

Writes require strict global ordering with a latency budget that cannot afford coordination.

Costs and failure modes

Replication, conflicting updates and regional failover complicate operation.

Case file

A worked decision

A global booking service routes users to nearby regional deployments and assigns each seat inventory partition a write owner.

Change the condition

If bookings require immediate global serialization and regional latency is acceptable, use one authoritative write region.

Check the decision

Can two isolated regions both confirm the last seat?

Relationships

Catalog note · Related: Deployment stamps

Sources

Operating approach

GitOps

Version desired state and continuously pull and reconcile it against the running system.

FamilyOperations architecture
ScopeDelivery and operations
Editorial statusDraft

What it buys

Operators can review intended changes in version control and detect divergence in the running environment.

Apply when

Teams need an auditable deployment history and automatic drift correction.

Reconsider when

Rapidly changing runtime state or secrets cannot be modeled safely in the repository.

Costs and failure modes

Repository access, reconciliation lag and emergency overrides require policy.

Case file

A worked decision

An operations team merges a replica-policy change and a controller continuously converges the cluster on that reviewed revision.

Change the condition

For a disposable one-off experiment, applying a configuration directly can avoid repository workflow overhead.

Check the decision

After manual drift, does the reconciler restore the intended revision and report the discrepancy?

Relationships

Catalog note · Uses: Reconciliation loop

Referenced by other entries (1)

Sources

Dissemination pattern

Gossip Dissemination

Have nodes relay updates to selected peers over repeated rounds.

FamilyCluster coordination
ScopeCluster membership
Editorial statusDraft

What it buys

Membership information can spread gradually through local exchanges without making one broadcaster contact every node.

Apply when

Large membership or status maps can tolerate eventual dissemination.

Reconsider when

Every recipient must act on an update before the caller returns.

Costs and failure modes

Convergence time varies. Peers exchange redundant updates.

Case file

A worked decision

Cache nodes exchange partial membership views across racks where temporary disagreement is acceptable.

Change the condition

If a configuration must take effect everywhere before a transfer begins, use explicit acknowledgments.

Check the decision

After a rack reconnects, do independent views eventually drop an obsolete member?

Relationships

Catalog note · Can spread Heartbeat observations without an all-to-all broadcast.

Sources

Integration pattern

Guaranteed Delivery

Persist accepted messages across broker or endpoint restarts and redeliver under the channel contract.

FamilyMessage delivery
ScopeMessaging infrastructure
Editorial statusDraft

What it buys

An acknowledged message can survive a supported restart and remain available for the next delivery attempt.

Apply when

Losing an accepted shipment request is unacceptable.

Reconsider when

Transient telemetry expires before a failed service recovers.

Costs and failure modes

Durability adds I/O and storage. A crash around acknowledgement can still duplicate effects.

Case file

A worked decision

A lab instrument keeps each test-completion message until the broker confirms durable acceptance. The broker retains it until the receiver durably accepts it and acknowledges delivery.

Change the condition

Live cursor-position updates have value only while current, so best-effort delivery avoids accumulating stale traffic.

Check the decision

Crash the broker or receiver at each handoff in a test deployment and record where redelivery is possible.

Relationships

Catalog note · Complements Idempotent Receiver.

Sources

Control-flow idiom

Guard clause

Return or fail early when a precondition or special case ends the operation.

FamilyControl flow and decomposition
ScopeExpression, function or module
Editorial statusDraft

What it buys

Readers can follow the successful path without carrying each earlier rejection condition through a nest of branches.

Apply when

The main operation is buried inside nested checks with distinct exit reasons.

Reconsider when

A short positive condition already makes both branches obvious.

Costs and failure modes

Moving a guard across a mutation can alter the result or skip cleanup.

Case file

A worked decision

A booking handler rejects an expired hold before it computes a charge. Keeping that exit near the top makes the accepted path visible.

Change the condition

If both branches select equally valid prices and then continue booking, use one ordinary conditional.

Check the decision

Can an expired hold still trigger a charge, a log that implies success or a resource leak?

Relationships

Referenced by other entries (1)

Study this decision

Sources

Architectural pattern

Half-Sync/Half-Async

Bridge an asynchronous event layer and synchronous processing through a queue.

FamilyConcurrency and network I/O
ScopeProcess / runtime
Editorial statusDraft

Also indexed as · Half-synchronous / half-asynchronous

What it buys

A responsive event loop can coexist with blocking legacy code when a bounded handoff isolates that work.

Apply when

Blocking business work must coexist with responsive socket handling.

Reconsider when

All work is short and nonblocking on one event loop.

Costs and failure modes

Queued work adds latency and needs a capacity policy.

Case file

A worked decision

A socket loop accepts requests without blocking and hands parsed jobs to synchronous legacy pricing workers through a bounded queue.

Change the condition

If pricing is cheap and nonblocking, compute it directly in the loop.

Check the decision

When all pricing workers stall, can the socket loop still reject excess work promptly?

Relationships

Catalog note · Alternative: Leader/Followers can avoid the extra queued handoff.

Study this decision

Sources

Observability pattern

Health endpoint monitoring

Expose checks that distinguish whether an instance can receive or continue work.

FamilyOperations architecture
ScopeProcess and service
Editorial statusDraft

What it buys

Traffic can be directed away from an unready instance or a genuinely wedged process can be restarted.

Apply when

Routing or orchestration needs a meaningful health signal from each replica.

Reconsider when

A dependency-heavy liveness check would restart healthy instances during a shared outage.

Costs and failure modes

Misclassified failures can cause restart or traffic-removal cascades.

Case file

A worked decision

A search service publishes separate checks for taking traffic and making process progress so orchestration can route or restart appropriately.

Change the condition

For a short-lived command, a meaningful exit status may be enough.

Check the decision

Does losing an optional analytics sink incorrectly evict every search replica?

Relationships

Catalog note · Complements: Rolling update

Referenced by other entries (1)

Sources

Failure-detection mechanism

Heartbeat

Exchange periodic liveness signals and suspect a peer after a timeout.

FamilyCluster coordination
ScopeDistributed process
Editorial statusDraft

What it buys

A dispatcher can start investigating a silent worker or route new work elsewhere while the worker's final status remains uncertain.

Apply when

A coordinator needs evidence of a silent or unreachable participant.

Reconsider when

A missing signal would be treated as incontrovertible proof of failure for an irreversible action.

Costs and failure modes

Partitions, pauses and congestion produce false suspicions.

Case file

A worked decision

A dispatcher stops assigning new work to a worker after repeated liveness signals go missing.

Change the condition

If work is submitted synchronously to a local child, watch its process handle.

Check the decision

Does a congested link produce a false suspicion without allowing two workers to finalize the same task?

Relationships

Catalog note · Can trigger Raft elections, whose quorum rules prevent two committed leaders for one term.

Referenced by other entries (1)

Sources

Architectural pattern

Hexagonal Architecture / Ports and Adapters

Drive and serve the application through ports implemented by adapters for external technologies.

FamilyApplication boundaries
ScopeApplication core and integrations
Editorial statusDraft

Also indexed as · Hexagonal architecture, ports and adapters

What it buys

The same use case can run behind a web endpoint, a batch import, and a test harness through a common application contract.

Apply when

The same use cases need multiple drivers or fast tests without real external systems.

Reconsider when

An adapter only forwards a stable local call and provides no substitution or isolation.

Costs and failure modes

Poorly chosen ports expose infrastructure details and multiply translation code.

Case file

A worked decision

A baggage-routing engine receives the same routing request from a terminal kiosk and a disruption simulator. Both call a routing port, and separate adapters supply live or simulated flight information.

Change the condition

If the program translates one file format once and directly exits, an adapter per dependency obscures its control flow.

Check the decision

Can a scripted adapter reproduce a cancelled-flight scenario using the exact production routing rules?

Relationships

Catalog note · Related: Clean Architecture

Referenced by other entries (4)

Sources

Behavioral model

Hierarchical State Machine

Nest states so events can be handled by a shared parent when a child has no handler.

FamilyEmbedded and real-time control
ScopeController / reactive component
Editorial statusDraft

What it buys

Shared behavior for a parent state can be specified once while substates keep their own transitions.

Apply when

Several device modes share transitions yet require local overrides.

Reconsider when

A handful of independent cases fit a flat transition table.

Costs and failure modes

Entry, exit and event propagation rules can hide unexpected transitions.

Case file

A worked decision

A ventilator enters a shared alarm state from several ventilation modes while each mode owns its internal transitions.

Change the condition

For a two-state lamp, a flat transition table is easier to inspect.

Check the decision

Which inherited transition fires when a child state also handles the alarm?

Relationships

Catalog note · Complements: Active Object can serialize incoming events.

Referenced by other entries (1)

Sources

Language abstraction

Higher-order function

Pass a computation into another computation or return one as a value.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

One traversal can support different scoring or validation rules by accepting a function from each caller.

Apply when

The traversal or workflow stays fixed while a small policy varies.

Reconsider when

The algorithm is local and has one policy, or its collaborators need several coordinated operations.

Costs and failure modes

Captured state can hide effects or keep objects alive longer than intended.

Case file

A worked decision

A file indexer walks the same directory tree for every client. An inclusion function selects photographs or source files.

Change the condition

If only one file type will ever be indexed, keep the test next to the traversal.

Check the decision

Can a caller change the selection rule without duplicating traversal or mutating a global variable?

Relationships

Referenced by other entries (2)

Study this decision

Runnable labs

Sources

Workflow construct

Human Task

Create assignable human work and suspend the process until a completion arrives.

FamilyHuman and case workflows
ScopeProcess instance and work queue
Editorial statusDraft

What it buys

A process can pause for an accountable person's judgment, track the outstanding assignment, and resume when the decision is recorded.

Apply when

A decision requires human authority, judgment, or supporting evidence.

Reconsider when

A deterministic rule and reliable facts can decide the case without a person.

Costs and failure modes

Unclaimed tasks, stale permissions and missed deadlines can strand a process.

Case file

A worked decision

An adjuster must sign a high-value claim and record the reason before funds are released.

Change the condition

If a statutory formula fully determines payment and no sign-off is required, automate the step.

Check the decision

Who can take over a claim when the assigned adjuster leaves mid-review?

Relationships

Catalog note · Composes with Deferred Choice for an approval-versus-timeout race.

Referenced by other entries (1)

Sources

Metaprogramming mechanism

Hygienic macro

Transform syntax while preserving binding relationships between introduced names and caller expressions.

FamilyMetaprogramming
ScopeSource language and expansion
Editorial statusDraft

What it buys

A macro can introduce local helper names without accidentally capturing variables used by the surrounding program.

Apply when

A recurring control or binding construct cannot be expressed conveniently by an ordinary function.

Reconsider when

A function over already evaluated values provides the desired behavior.

Costs and failure modes

An overgrown syntax layer impedes tooling and hides evaluation order.

Case file

A worked decision

A resource macro binds a temporary handle, runs a user expression and guarantees the intended scope without capturing the user's local name.

Change the condition

If callers only need to add two settings values, a normal function is clearer.

Check the decision

Do caller variables named like the macro's internal binding retain their original meaning?

Relationships

Sources

Integration pattern

Idempotent Receiver

Make repeated processing produce the same business effect, by design or durable deduplication.

FamilyMessage delivery
ScopeConsumer boundary
Editorial statusDraft

What it buys

A timeout can be retried without issuing a second refund or otherwise duplicating the business effect.

Apply when

An acknowledgement or response can be lost after the effect commits.

Reconsider when

An operation already has naturally idempotent semantics and no extra side effects, so skip a deduplication store.

Costs and failure modes

Deduplication records need a retention rule and an atomic link to the effect.

Case file

A worked decision

A benefits processor receives the same payment instruction again after its acknowledgement is lost. It records the instruction ID and the local ledger effect atomically and returns the original outcome on redelivery.

Change the condition

If each message simply sets an idempotent local flag, a dedicated duplicate-ID table may be unnecessary.

Check the decision

Race two deliveries of one instruction and verify that one ledger entry commits and both responses refer to the same outcome.

Relationships

Catalog note · Complements Transactional Outbox, whose relay can publish twice.

Referenced by other entries (7)

Study this decision

Runnable labs

Sources

Persistence pattern

Identity Map

Keep one loaded object per persistent identity within a defined scope.

FamilyEnterprise persistence
ScopeTransaction or session
Editorial statusDraft

What it buys

Two associations resolved in one unit of work can observe changes to the same instance instead of diverging in separate copies.

Apply when

Different paths load and modify the same entity in one operation.

Reconsider when

Reads are stateless projections or the proposed cache outlives the consistency boundary.

Costs and failure modes

Unbounded maps retain memory and stale objects.

Case file

A worked decision

A procurement edit screen loads a supplier via both the order and its contract. One unit-of-work identity map keeps both references pointed at the same supplier instance.

Change the condition

For immutable projections used only to render one report, separate value copies have no conflicting updates to reconcile.

Check the decision

Change the supplier's reference in the order editor and inspect the same supplier through the contract before saving.

Relationships

Catalog note · Complements: Unit of Work

Referenced by other entries (2)

Sources

Architectural style

Implicit Invocation

Publish occurrences and let registered handlers run without the publisher naming them.

FamilyStructural architecture
ScopeComponents and integration
Editorial statusDraft

What it buys

A new reaction can be attached to an existing occurrence without editing each place that publishes it.

Apply when

Independent extensions should react to changes without modifying the producer.

Reconsider when

A caller must control execution order, atomic results or a mandatory response.

Costs and failure modes

Hidden execution paths complicate debugging and reentrant updates.

Case file

A worked decision

A CAD editor raises a model-changed signal after a successful edit. The inspector and autosave indicator register separate reactions without putting UI references into editing code.

Change the condition

If exactly one validation must finish before the edit can succeed, call it explicitly.

Check the decision

Can a new panel observe changes without editing the command that changes the model?

Relationships

Catalog note · Related at object scope: Observer

Referenced by other entries (1)

Sources

Architectural pattern

Interceptor

Install callbacks at explicit points in a framework's processing path.

FamilyMiddleware structure
ScopeMiddleware / invocation pipeline
Editorial statusDraft

What it buys

A tracing or authentication change can apply consistently across registered operations through controlled interception points.

Apply when

Several services need the same tracing, authorization or policy hooks.

Reconsider when

Core domain behavior needs explicit control flow and local reasoning.

Costs and failure modes

Ordering and short-circuiting can change behavior invisibly to callers.

Case file

A worked decision

An RPC stack applies the same tracing and authentication around many operations through ordered interception points.

Change the condition

If one method needs a timing measurement, instrument that method directly.

Check the decision

When authentication rejects a request, which tracing hooks record the rejection?

Relationships

Catalog note · Complements: Component Configurator can install interceptors.

Referenced by other entries (1)

Sources

Object-oriented design pattern

Interpreter

Represent grammar constructs as expression types whose instances evaluate a sentence against a context.

FamilyGoF · Behavioral
ScopeSmall language and expression tree
Editorial statusDraft

What it buys

A small language can be evaluated by composing the meaning of recurring grammar constructs.

Apply when

A small, stable rule language needs repeated evaluation and explicit syntax structure.

Reconsider when

A growing grammar or demanding performance calls for a parser generator, compiler or established engine.

Costs and failure modes

Every grammar construct may introduce a class and tree-walking can be slow.

Case file

A worked decision

A pricing tool represents a tiny eligibility language as expression nodes and evaluates the resulting tree against an order.

Change the condition

If two fixed rules suffice and users never compose expressions, ordinary predicates are simpler.

Check the decision

How does evaluation handle an unknown field or an ill-typed comparison?

Relationships

Catalog note · Can realize: Interpreter Architecture

Referenced by other entries (1)

Sources

Architectural style

Interpreter Architecture

An abstract machine evaluates an explicit program representation against its execution state.

FamilyStructural architecture
ScopeExecution engine
Editorial statusDraft

What it buys

Users can run new programs expressed in the supported instruction set without rebuilding the execution engine for each program.

Apply when

Users need a portable evolving rules language or scripted behavior.

Reconsider when

A handful of fixed branches suffices or evaluation overhead violates deadlines.

Costs and failure modes

Language semantics, diagnostics and sandboxing become maintenance obligations.

Case file

A worked decision

A tax tool represents allowance rules as expressions in a small language and evaluates those expressions against a return. The same rules can be traced and changed without rebuilding the tool.

Change the condition

If the only variation is three fixed tax rates, a versioned lookup table is easier to audit.

Check the decision

For an unexpected allowance, can the evaluator identify the exact expression that produced it?

Relationships

Catalog note · Can implement: Domain-Specific Language

Sources

Refactoring

Introduce Parameter Object

Collect parameters that travel together into one named value with clear semantics.

FamilyControl flow and decomposition
ScopeExpression, function or module
Editorial statusDraft

What it buys

Related arguments such as dates and time zones can be validated together and passed without swapping several similar parameters.

Apply when

The same group recurs and parts of the program disagree about ordering or validity.

Reconsider when

Unrelated settings merely happen to appear in one long call.

Costs and failure modes

An options bag can hide required fields and encourage unrelated responsibilities.

Case file

A worked decision

Start date, end date and inclusivity appear in six reservation queries. A DateRange value gives every caller the same boundary rule.

Change the condition

If a one-off utility takes exactly one start date and one count, a new wrapper buys little.

Check the decision

Can the object prevent an invalid range and can callers see what each argument means?

Relationships

Sources

Object-oriented design pattern

Iterator

Encapsulate traversal position and advance through elements without exposing the underlying collection.

FamilyGoF · Behavioral
ScopeCollection traversal
Editorial statusDraft

What it buys

Clients can traverse a collection without knowing or depending on how its elements are stored.

Apply when

A custom collection needs sequential access, independent traversals or lazy traversal.

Reconsider when

The language's standard iterator or generator already provides these semantics.

Costs and failure modes

Mutation can invalidate a cursor and a lazy iterator may retain resources until closed.

Case file

A worked decision

A document reader exposes successive paragraphs without requiring clients to know whether the document is chunked on disk.

Change the condition

If consumers need repeated indexed random access to a short list, a sequence interface may suffice.

Check the decision

What happens when the underlying document changes between two iterator steps?

Relationships

Catalog note · Often traverses: Composite

Referenced by other entries (4)

Sources

Dataflow computation model

Kahn Process Network

Connect deterministic sequential processes with channels, blocking reads and conceptually unbounded writes.

FamilyDistributed coordination models
ScopeDeterministic processes / FIFO channels
Editorial statusDraft

What it buys

Under its deterministic process and channel assumptions, alternative execution schedules produce the same streams, simplifying reasoning about concurrent transformations.

Apply when

Streaming stages consume ordered inputs and schedule-independent sequences are important.

Reconsider when

The required behavior depends on nondeterministic readiness or wall-clock races.

Costs and failure modes

A finite-buffer implementation needs analysis to avoid artificial deadlock.

Case file

A worked decision

A deterministic decoding pipeline uses blocking reads over FIFO channels to connect independently scheduled transformations.

Change the condition

If every stage consumes the same fixed block sizes, use a statically scheduled pipeline.

Check the decision

Do different legal schedules yield identical decoded output for identical input streams?

Relationships

Catalog note · Contrast: Reactive Streams makes bounded demand explicit.

Referenced by other entries (1)

Sources

Architectural style

Kappa architecture

Reprocess a retained input log through a stream computation to rebuild derived results.

FamilyAnalytical architecture
ScopeStream platform
Editorial statusDraft

What it buys

Corrections and live results can use one transformation, reducing the risk of divergent batch and streaming logic.

Apply when

The log can be retained and replay can finish within a tolerable recovery window.

Reconsider when

Required historical input is unavailable or replay cost exceeds the recovery budget.

Costs and failure modes

Schema evolution, replay duration and cutover require planning.

Case file

A worked decision

A clickstream team recomputes session counts by replaying a retained log through a revised streaming job into a fresh output.

Change the condition

If a nightly report is the only consumer and archived snapshots suffice, run a scheduled batch calculation.

Check the decision

How long will a clean replay take relative to retention and restore objectives?

Relationships

Catalog note · Alternative: Lambda architecture

Referenced by other entries (4)

Sources

Partitioning pattern

Key-Range Partitions

Assign contiguous sorted key intervals to separate partitions.

FamilyPartitioning and placement
ScopeDistributed store
Editorial statusDraft

What it buys

A range scan can target just the owners of the relevant ordered intervals, reducing the number of partitions a query must contact.

Apply when

Scans and range predicates must remain local to a small number of partitions.

Reconsider when

Sequential keys direct nearly every write to the newest interval.

Costs and failure modes

Hot ranges must split or migrate while routing stays consistent.

Case file

A worked decision

A time-series archive frequently retrieves contiguous time ranges and routes queries to partitions overlapping the interval.

Change the condition

If nearly all lookups are random by unique key, use hash-based placement.

Check the decision

Does today's write traffic concentrate in the newest range despite balanced historical storage?

Relationships

Catalog note · Alternative to Consistent Hashing for workloads dominated by range scans.

Referenced by other entries (1)

Sources

Architectural style

Lakehouse

Serve warehouse and analytical workloads over managed tables in open data storage.

FamilyAnalytical architecture
ScopeData platform
Editorial statusDraft

What it buys

SQL analysis and model building can reuse governed datasets without maintaining separate authoritative copies.

Apply when

SQL analysts and model builders need consistent access to the same large datasets.

Reconsider when

A small warehouse already serves all required queries and consumers.

Costs and failure modes

Metadata, compaction and workload isolation require operational ownership.

Case file

A worked decision

A research platform adds transactional table metadata over object storage so model builders and SQL analysts read consistent versions.

Change the condition

For a small report served by one database, a managed relational table has fewer moving parts.

Check the decision

Do all writers honor the same transaction protocol and snapshot retention rules?

Relationships

Catalog note · Can use: Medallion architecture

Referenced by other entries (2)

Sources

Architectural style

Lambda architecture

Compute low-latency results on a fast path and correct them with a batch recomputation.

FamilyAnalytical architecture
ScopeBatch and stream platform
Editorial statusDraft

What it buys

Users can receive provisional results quickly and later correct them with a complete historical run.

Apply when

The fast path is approximate and full recomputation yields material corrections.

Reconsider when

One replayable stream computation meets freshness and accuracy requirements.

Costs and failure modes

Two implementations of the same business rule can diverge.

Case file

A worked decision

A fraud monitor estimates counts immediately in a speed layer and replaces provisional results with a batch recomputation.

Change the condition

If replaying one streaming pipeline meets freshness and correction deadlines, retire the duplicate computation.

Check the decision

When batch and speed views overlap, which result owns each interval?

Relationships

Catalog note · Alternative: Kappa architecture

Referenced by other entries (1)

Sources

Logical clock algorithm

Lamport Clock

Advance logical counters on local events and merge received timestamps to preserve happened-before order.

FamilyDistributed time and causality
ScopeDistributed process
Editorial statusDraft

What it buys

A trace can order causally related sends and receives without trusting synchronized physical clocks.

Apply when

A protocol needs ordering consistent with causality without synchronized wall clocks.

Reconsider when

The application must detect whether two versions were genuinely concurrent.

Costs and failure modes

Scalar timestamps can order unrelated events. They cannot recover elapsed real time.

Case file

A worked decision

A trace viewer annotates cross-service messages so a send always sorts before its corresponding receive.

Change the condition

If only elapsed time within one process matters, use its monotonic timer.

Check the decision

Can unrelated trace events have ordered timestamps even though neither caused the other?

Relationships

Catalog note · Contrasts with Version Vector, which can expose concurrent updates.

Sources

Architectural style

Layered Architecture

Group responsibilities into levels with explicit permitted dependencies between levels.

FamilyStructural architecture
ScopeModules and subsystems
Editorial statusDraft

What it buys

A team can replace a layer's implementation and focus compatibility testing on the neighboring contracts it exposes.

Apply when

A protocol stack or application has stable abstraction boundaries with independently changing implementations.

Reconsider when

Most feature edits cross every layer and add forwarding methods without isolating change.

Costs and failure modes

Layer bypasses erode boundaries and strict layering adds hops.

Case file

A worked decision

An imaging tool separates acquisition, reconstruction and presentation so that alternate scanners only alter acquisition. Higher layers depend on declared lower-layer interfaces.

Change the condition

When a small change always touches every layer and the layers only forward calls, a feature module reduces indirection.

Check the decision

Swap the scanner adapter and run reconstruction fixtures without changing the renderer.

Relationships

Catalog note · Contrasts with: Pipes and Filters

Referenced by other entries (1)

Sources

Evaluation strategy

Lazy sequence

Compute successive elements only as the consumer demands them.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

A consumer searching for an early match can stop without computing or allocating the unused tail.

Apply when

A consumer needs the first match or a bounded prefix of a large input.

Reconsider when

All items must be consumed immediately and strict evaluation gives clearer timing.

Costs and failure modes

Deferred errors or work may occur after the original resource or transaction closes.

Case file

A worked decision

A diagnostic asks for the first ten suspicious records in a long immutable archive. Later records need never be parsed.

Change the condition

A signed compliance export must validate every record before reporting success.

Check the decision

Does taking ten results leave unconsumed work and close the underlying source?

Relationships

Sources

Replication pattern

Leader and Followers

Route writes through a leader that orders and propagates changes to followers.

FamilyReplication and consistency
ScopeReplication group
Editorial statusDraft

Also indexed as · Single-leader replication. Distinct from the POSA2 thread-pool pattern.

What it buys

One authority orders writes while additional copies can support reads or takeover under the chosen replication and failover policy.

Apply when

A single write order simplifies conflicting updates within one replica group.

Reconsider when

Multiple disconnected sites must accept independent writes during partitions.

Costs and failure modes

Leader throughput limits writes and failover must prevent stale authority.

Case file

A worked decision

A catalog serializes SKU edits on one primary and distributes them to read replicas.

Change the condition

If one durable node meets the read and availability requirements, keep a single copy plus backups.

Check the decision

After failover, which acknowledged SKU changes are visible under the chosen replication policy?

Relationships

Catalog note · Supports Follower Reads and may use a Replicated Log.

Referenced by other entries (2)

Sources

Architectural pattern

Leader/Followers

Rotate leadership among threads waiting on common event sources.

FamilyConcurrency and network I/O
ScopeProcess / thread pool
Editorial statusDraft

Also indexed as · Leader/followers thread pool in POSA2. Distinct from leader–follower replication.

What it buys

A fixed set of threads can share event reception while a follower takes over waiting as the former leader handles its event.

Apply when

Several threads can process independent events without a separate dispatch queue.

Reconsider when

Handlers monopolize threads and require workload isolation.

Costs and failure modes

Promotion errors or a saturated pool delay the next event.

Case file

A worked decision

A server thread pool designates one thread to await readiness, then promotes a waiting follower before processing the event.

Change the condition

If a single event loop handles every callback cheaply, use that loop.

Check the decision

During handoff, can two threads claim the same socket readiness notification?

Relationships

Catalog note · Alternative: Half-Sync/Half-Async.

Sources

Replication architecture

Leaderless quorum replication

Send operations to replica sets without a fixed leader and reconcile versions according to the store's quorum model.

FamilyData replication
ScopeDistributed data store
Editorial statusDraft

What it buys

Requests can use available replicas without first replacing a failed designated writer, subject to the system's quorum and conflict policies.

Apply when

Availability across failures and tolerance for reconciliation outweigh immediate global ordering.

Reconsider when

The business requires linearizable constraints across writes the design cannot enforce.

Costs and failure modes

Conflicts, repairs, sloppy quorum behavior and clock assumptions need attention.

Case file

A worked decision

A multi-node preference store accepts writes through any coordinator and reconciles divergent replica versions on read or repair.

Change the condition

If all updates must be serialized by one authority, use a leader and its replicas.

Check the decision

After concurrent preference edits on isolated replicas, what merge result reaches clients?

Relationships

Catalog note · Alternative: Leader and Followers

Sources

Coordination pattern

Lease

Grant a participant authority for a bounded time with an explicit renewal policy.

FamilyCluster coordination
ScopeShared resource
Editorial statusDraft

What it buys

Another worker can eventually reclaim an abandoned right after the authority's expiry condition, without a manual unlock by the previous owner.

Apply when

Ownership must expire after a worker disappears without manual release.

Reconsider when

A paused worker could corrupt an external resource that cannot reject stale writes.

Costs and failure modes

Clock assumptions, long pauses and renewal delays can invalidate assumptions about ownership.

Case file

A worked decision

A report builder renews a claim to a month's export so another builder can take over after failure.

Change the condition

If strict exclusion fits a short local transaction, use that transaction.

Check the decision

After an extended pause, how does a builder learn it must reacquire the claim?

Relationships

Catalog note · Complements Fencing Token where the resource enforces monotonic ownership.

Referenced by other entries (2)

Sources

Overload-control pattern

Load Shedding

Reject selected work before expensive execution to preserve useful capacity for remaining requests.

FamilyFault isolation and overload
ScopeService admission
Editorial statusDraft

What it buys

Discarding excess or obsolete work preserves capacity for requests that can still produce a useful result.

Apply when

Sustained overload would otherwise make most requests miss their deadline.

Reconsider when

A brief burst of deferrable work can be absorbed within its latency budget.

Costs and failure modes

Dropped requests are user-visible. Uncoordinated retries can intensify overload.

Case file

A worked decision

A live scoring endpoint discards obsolete refresh requests when the waiting time would exceed their useful lifetime.

Change the condition

If every work item must eventually finish and delay is acceptable, enqueue it durably.

Check the decision

Under overload, are expired refreshes dropped before consuming scoring capacity?

Relationships

Catalog note · Alternative to Queue-Based Load Leveling for time-sensitive overload.

Referenced by other entries (2)

Sources

Architectural approach

Local-first software

Treat a local copy as primary for user interaction and sync changes between replicas.

FamilyClient and edge architecture
ScopeUser devices and collaboration
Editorial statusDraft

What it buys

A user can keep editing during a network outage and synchronize those local edits after connectivity returns.

Apply when

Users need ownership, offline editing or collaboration independent of a reachable central service.

Reconsider when

The product requires centralized, immediate revocation or global serialization of every write.

Costs and failure modes

Identity, conflict policy, synchronization and durable local storage require work.

Case file

A worked decision

A research group edits shared field notes on laptops that may never contact the original hosting provider again. Each user retains a working local copy and syncs changes when peers reconnect.

Change the condition

If the application only displays authoritative train availability and users cannot contribute edits, a read cache may suffice.

Check the decision

Have two researchers edit separate paragraphs offline, then reconnect and check preservation and convergence.

Relationships

Catalog note · Can use: Conflict-Free Replicated Data Type (CRDT)

Sources

Integration mechanism

Log-based change data capture

Publish committed row changes from a database change log.

FamilyAnalytical architecture
ScopeDatabase boundary
Editorial statusDraft

Also indexed as · Log-based CDC

What it buys

Downstream consumers can follow committed changes without adding event-publication code to every writer.

Apply when

Existing writers cannot all be modified and downstream stores need changes incrementally.

Reconsider when

Consumers need business intent that cannot be recovered from changed rows.

Costs and failure modes

Retention, snapshots, schema changes and duplicate handling matter.

Case file

A worked decision

A catalog sync tails committed database changes and checkpoints the log position while updating a search index.

Change the condition

If nightly export meets the search freshness target, a snapshot import is simpler.

Check the decision

After an outage, can the consumer resume before the source discards its log segment?

Relationships

Catalog note · Can implement the relay for: Transactional Outbox

Referenced by other entries (1)

Study this decision

Sources

Reasoning principle

Loop invariant

State the property that holds before the loop and after every completed iteration.

FamilyControl flow and decomposition
ScopeExpression, function or module
Editorial statusDraft

What it buys

A reviewer can check initialization and one iteration to establish a property for any number of iterations.

Apply when

A result depends on a cursor, a partial result or a boundary staying consistent at every step.

Reconsider when

A direct library operation already supplies the needed semantics and proof obligations.

Costs and failure modes

A vague invariant may hold on every iteration yet fail to imply the required result. Proving termination needs a separate progress argument.

Case file

A worked decision

While merging two sorted lists, the output is the sorted merge of their consumed prefixes. No unconsumed head is smaller than the last emitted value.

Change the condition

If the inputs are already in a single ordered store, an ordered query removes the custom merge loop.

Check the decision

Does the invariant hold for empty inputs, after the very first comparison, and when either side is exhausted?

Relationships

Sources

Procedural architectural style

Main program and subroutines

A central routine sequences calls to subordinate procedures.

FamilyStructural architecture
ScopeProgram
Editorial statusDraft

What it buys

The main routine gives a reader one place to inspect the order of work and the points where errors can interrupt it.

Apply when

A known sequence dominates and readers benefit from seeing the control flow in one place.

Reconsider when

Independent event sources or run-time extensions would force increasingly tangled dispatch.

Costs and failure modes

Central orchestration can accumulate unrelated policies.

Case file

A worked decision

A command-line importer reads a manifest, validates records, applies replacements and writes a report. A main routine owns that fixed order and delegates each step to a procedure.

Change the condition

If third-party extensions must react independently to imported records, a rigid sequence may turn into a growing dispatcher.

Check the decision

Can a maintainer determine the execution order and exit conditions by reading the main routine?

Relationships

Catalog note · Alternative: Implicit Invocation

Sources

Coordination mechanism

Majority Quorum

Require an intersecting majority for protocol decisions within a membership configuration.

FamilyCluster coordination
ScopeReplica group
Editorial statusDraft

What it buys

In a fixed voting configuration, any two majorities intersect, giving a correctly designed agreement protocol a place to carry earlier decisions forward.

Apply when

A consensus group must avoid independently confirming conflicting decisions across partitions.

Reconsider when

A disconnected minority must keep accepting independently valid updates.

Costs and failure modes

Progress stops without a majority. Membership changes require a safe protocol.

Case file

A worked decision

Five voters in a fixed consensus configuration require three votes to choose an owner for the next shard epoch.

Change the condition

If losing the only configuration process may halt edits, use a single durable writer.

Check the decision

During a two-versus-three partition, can the two-voter side choose a conflicting owner for the same epoch?

Relationships

Catalog note · Used by Raft and Paxos. Intersection alone does not define consensus.

Referenced by other entries (1)

Sources

Collection operation

Map over a collection

Transform each input element independently, preserving the collection's structural correspondence where defined.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

Also indexed as · map, select

What it buys

Readers can see that each output comes from one input and inspect the transformation without following index bookkeeping.

Apply when

Every input has exactly one output and the mapping has no order-dependent state.

Reconsider when

The output depends on the preceding element, or failed items must be reported separately.

Costs and failure modes

Eager mapping may allocate a full intermediate collection. Effectful mapping makes order matter.

Case file

A worked decision

A report turns each stored temperature into a displayed Celsius value. Independent conversion makes the transformation easy to sample-test.

Change the condition

A running average depends on earlier readings and needs an accumulator.

Check the decision

Does rearranging independent inputs merely rearrange the corresponding outputs?

Relationships

Sources

Processing model

MapReduce

Partition input, map records, group intermediate keys and reduce each group.

FamilyParallel computation
ScopeDistributed batch job
Editorial statusDraft

What it buys

Authors can concentrate on mapping and aggregation while the runtime partitions work and shuffles matching keys.

Apply when

Large independent input partitions reduce to grouped summaries.

Reconsider when

Low-latency, highly iterative or skewed workloads make shuffles dominate.

Costs and failure modes

Shuffle traffic, hot keys and job startup can dominate execution.

Case file

A worked decision

A corpus analysis maps documents to token counts and reduces all values for each token into a global frequency table.

Change the condition

For repeated graph iterations with extensive shared state, repeated shuffles may make another execution model preferable.

Check the decision

Will a handful of common keys overload reducers despite balanced input partitions?

Relationships

Catalog note · Alternative for continuous input: Kappa architecture

Referenced by other entries (1)

Sources

Read-model pattern

Materialized View

Persist a precomputed query result and refresh it when its sources change.

FamilyData access and caching
ScopeDatabase or read service
Editorial statusDraft

What it buys

A repeated report can read precomputed results instead of recalculating expensive joins for each reader.

Apply when

An expensive repeated read can tolerate the refresh policy and storage cost.

Reconsider when

An indexed live query meets latency or callers require immediate current results.

Costs and failure modes

Refresh lag, rebuild time and invalidation become part of the read contract.

Case file

A worked decision

A transit dashboard precomputes departures per station from multiple timetable tables and refreshes affected stations after timetable changes.

Change the condition

If users choose arbitrary joins once a month, execute the query on demand.

Check the decision

How stale can the station board become after a canceled service?

Relationships

Catalog note · Can implement a read projection in: CQRS

Referenced by other entries (5)

Study this decision

Sources

Data pipeline pattern

Medallion architecture

Separate original ingestion, validated records and business-ready outputs into successive layers.

FamilyAnalytical architecture
ScopeData platform
Editorial statusDraft

What it buys

An error in a curated output can be traced to a validation stage and rebuilt from an earlier retained layer.

Apply when

Teams must replay raw inputs, trace corrections and publish curated datasets.

Reconsider when

A reliable small source maps directly to one output with minimal transformation.

Costs and failure modes

Each stage adds latency, storage and a contract to maintain.

Case file

A worked decision

A marketplace retains source deliveries in bronze, deduplicates seller records in silver, and computes reconciled revenue in gold.

Change the condition

If a single validated table is the only output, materializing three copies adds needless latency and storage.

Check the decision

Can a malformed delivery be traced from a gold discrepancy back to the original record?

Relationships

Catalog note · Can organize: Lakehouse

Sources

Object-oriented design pattern

Mediator

Move coordination among peers into a dedicated object they call instead of knowing each other directly.

FamilyGoF · Behavioral
ScopeObject collaboration
Editorial statusDraft

What it buys

A coordination rule shared by several peers can be changed in one place without rewiring every pair.

Apply when

Many UI controls interact under rules that change independently of the controls.

Reconsider when

Two collaborators already share a simple stable interaction.

Costs and failure modes

Centralizing interactions can create a large coordinator that is difficult to test.

Case file

A worked decision

An appointment form delegates coordination between clinic, doctor, and timeslot selectors to a mediator that owns their update sequence.

Change the condition

For two fields with one simple dependency, a direct event handler is easier to trace.

Check the decision

Can programmatic selection changes trigger a notification cycle through the mediator?

Relationships

Catalog note · May receive updates via: Observer

Referenced by other entries (2)

Sources

Object-oriented design pattern

Memento

Let the state owner create an opaque snapshot that a caretaker retains for later restoration.

FamilyGoF · Behavioral
ScopeObject snapshot and restoration
Editorial statusDraft

What it buys

An owner can restore a past state without exposing its internal representation to the history manager.

Apply when

A local editor or simulation needs undo without exposing private representation.

Reconsider when

State is huge, includes external effects, or a reversible delta is substantially cheaper.

Costs and failure modes

Snapshots consume memory and become incompatible when state representation evolves.

Case file

A worked decision

A puzzle editor saves an opaque board snapshot before a destructive transformation and restores it on undo.

Change the condition

If each move has a compact reliable inverse, storing the inverse may use far less memory.

Check the decision

Does restoring a snapshot also restore identity and relationships between linked pieces?

Relationships

Catalog note · Complements: Command

Referenced by other entries (2)

Sources

Optimization technique

Memoization

Cache a computation by the inputs that determine its result.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

Repeated calls with the same inputs can reuse an expensive calculation after paying its cost once.

Apply when

Expensive deterministic subproblems recur with reusable input keys.

Reconsider when

Results depend on unkeyed time or external state, or inputs rarely repeat.

Costs and failure modes

Unbounded keys retain memory and stale values can answer silently.

Case file

A worked decision

A layout engine repeatedly measures the same glyph run at the same font version and size. Use those values as the cache key.

Change the condition

If the font file may change without changing its identity, disable the cache or version the dependency.

Check the decision

Does changing any result-affecting input force a cache miss, and is retention bounded?

Relationships

Sources

Architectural style

Micro Frontends

Compose one user experience from independently delivered feature slices.

FamilyPresentation architecture
ScopeBrowser application and team boundaries
Editorial statusDraft

What it buys

A feature team can release its slice of an interface without synchronizing every frontend team's release.

Apply when

Autonomous teams own distinct vertical experiences with independent release needs.

Reconsider when

A single team maintains a cohesive interface with frequent cross-feature edits.

Costs and failure modes

Bundle duplication, accessibility inconsistencies and integration testing grow.

Case file

A worked decision

A rail operator's booking, loyalty and disruption teams release independently into one passenger portal. Each owns its feature UI and agrees on navigation, accessibility and authentication contracts.

Change the condition

If all features are maintained by one small team and deploy together, ordinary front-end modules avoid runtime integration overhead.

Check the decision

Run a loyalty release against the current booking and shell versions and check navigation and keyboard behavior.

Relationships

Catalog note · Complements: Backend for Frontend

Sources

Architectural style

Microkernel / Plug-in Architecture

A stable application core discovers or invokes extensions through a defined contract.

FamilyStructural architecture
ScopeExtensible product
Editorial statusDraft

What it buys

A customer-specific extension can ship separately while other installations continue to use the same core.

Apply when

A product supports independently supplied or selectively installed behavior.

Reconsider when

There is one implementation and no credible independent extension schedule.

Costs and failure modes

Compatibility commitments, extension conflicts and trust boundaries constrain the core.

Case file

A worked decision

A music workstation hosts third-party effects behind a versioned processing interface. The core controls routing and timing while installed plug-ins add new transformations.

Change the condition

If all effects ship together and change with the core, ordinary modules avoid plug-in discovery and compatibility work.

Check the decision

Can a plug-in built for the previous supported contract load and process a test buffer safely?

Relationships

Catalog note · Can use: Strategy

Referenced by other entries (2)

Study this decision

Runnable labs

Sources

Architectural style

Microservice Architecture

Package capabilities in loosely coupled services that can deploy independently.

FamilyService architecture
ScopeDistributed application
Editorial statusDraft

What it buys

A team can ship a compatible change to its service without coordinating a simultaneous release of every other service.

Apply when

Different teams or capabilities need independent release, scaling or isolation.

Reconsider when

Changes repeatedly require coordinated releases or operations cannot support distributed failures.

Costs and failure modes

Network dependencies, tracing and cross-service consistency replace local mechanisms.

Case file

A worked decision

A retailer's catalog search and payment authorization need different release windows, capacity and on-call owners. Separate the two behind versioned interfaces and give each team operational responsibility.

Change the condition

If one small team deploys them together and needs a local transaction across both, keep a modular monolith.

Check the decision

Disable catalog search and verify that already-created orders can still authorize payment.

Relationships

Catalog note · Alternative: Modular Monolith

Referenced by other entries (2)

Sources

Presentation pattern

Model–View–Controller (MVC)

Separate the domain model, its presentation and the interpretation of user input.

FamilyPresentation architecture
ScopeInteractive user interface
Editorial statusDraft

What it buys

A different view can present the same domain state without embedding presentation decisions in the model.

Apply when

A model supports multiple views or independent interaction and presentation logic.

Reconsider when

A static or trivial screen gains no independent variation from splitting its responsibilities.

Costs and failure modes

Frameworks assign different meanings to controller and model, obscuring responsibilities.

Case file

A worked decision

A map editor keeps its road model independent of the route-list and canvas views. A controller converts drag gestures into edits and both views render the updated model.

Change the condition

A static information page with no mutable model or user actions can render directly.

Check the decision

Apply an edit through an alternate input controller and verify that both views display the same geometry.

Relationships

Catalog note · Related: Model–View–Presenter (MVP)

Referenced by other entries (1)

Sources

Presentation pattern family

Model–View–Presenter (MVP)

A presenter coordinates interaction between a view and model, with variants differing in view autonomy.

FamilyPresentation architecture
ScopeInteractive user interface
Editorial statusDraft

What it buys

Interaction behavior can be exercised through a presenter and a view contract without repeatedly constructing a full UI.

Apply when

Complex interaction logic must be tested independently of a toolkit.

Reconsider when

The UI has minimal interaction or straightforward bindings already express its behavior.

Costs and failure modes

Presenter and view interfaces can accumulate forwarding methods.

Case file

A worked decision

A handheld inspection app uses a presenter to turn scanned codes and button events into view updates. The display adapter can then be replaced for use on a different scanner.

Change the condition

If all screen behavior is trivial binding to one data object, a dedicated presenter may only repeat field names.

Check the decision

Can a fake view reproduce the sequence of prompts after an unreadable barcode without opening the device UI?

Relationships

Catalog note · Variants: Passive View and Supervising Controller

Referenced by other entries (3)

Sources

Presentation pattern

Model–View–ViewModel (MVVM)

A view binds to presentation state and commands exposed by a view model.

FamilyPresentation architecture
ScopeDesktop, mobile or browser view
Editorial statusDraft

Also indexed as · Presentation Model, MVVM (related terminology)

What it buys

Several controls can reflect the same presentation state through bindings, reducing hand-written synchronization between widgets.

Apply when

Screens have reusable presentation logic and the toolkit supports reliable binding.

Reconsider when

A small screen has no meaningful presentation logic or binding infrastructure is costly.

Costs and failure modes

Binding errors, feedback loops and oversized view models can hide dependencies.

Case file

A worked decision

A reservation form binds date, occupancy and validation messages to a view model. Changing the date recomputes availability status and the enabled state of the submit command.

Change the condition

A static confirmation screen with no derived or editable state needs little beyond a view-data record.

Check the decision

Change occupancy from two to three people and verify the binding refreshes capacity warnings and submit eligibility.

Relationships

Catalog note · Related: Supervising Controller

Sources

Architectural style

Modular Monolith

Partition a single deployment into modules with explicit APIs and controlled dependencies.

FamilyStructural architecture
ScopeSingle deployable application
Editorial statusDraft

What it buys

A team can enforce ownership of internal APIs and still use in-process calls and one deployment when that fits the workload.

Apply when

A team needs enforceable business boundaries while retaining local calls and simple operations.

Reconsider when

Separate release cadence, isolation or elasticity is a proven requirement for one capability.

Costs and failure modes

One deployment remains a shared release and failure boundary, and shortcuts erode modularity.

Case file

A worked decision

A training provider keeps enrollment, billing and scheduling as modules in one deployable product. Module APIs reject direct access to another module's tables.

Change the condition

If billing must deploy during a prolonged outage of the enrollment release pipeline, one deployment boundary can become a liability.

Check the decision

Can one module's persistence schema change without callers importing its tables or internal models?

Relationships

Catalog note · Alternative: Microservice Architecture

Referenced by other entries (3)

Study this decision

Sources

Design pattern

Monitor Object

Guard object methods and condition waits with shared synchronization.

FamilyConcurrency and network I/O
ScopeObject / shared state
Editorial statusDraft

What it buys

Callers can preserve a shared object's invariant through a small synchronized interface instead of duplicating lock and condition protocols.

Apply when

Concurrent callers need atomic updates to one tightly related state.

Reconsider when

Work spends most of its time waiting on remote I/O while holding the monitor.

Costs and failure modes

Lock contention and incorrect condition tests can stall all callers.

Case file

A worked decision

A bounded buffer protects its occupancy invariant under one lock and lets producers wait until consumers make room.

Change the condition

If only one thread owns the buffer, use ordinary collection operations.

Check the decision

Can a woken producer overfill the buffer after another producer gets the lock first?

Relationships

Catalog note · Alternative: Active Object.

Referenced by other entries (1)

Sources

Deployment style

Monolithic Architecture

Package and release application functionality as one deployment unit.

FamilyStructural architecture
ScopeApplication delivery
Editorial statusDraft

What it buys

A cross-feature change can be tested and released as one version without managing mixed-version service interactions.

Apply when

A small team benefits from local calls, one transaction boundary and a single release pipeline.

Reconsider when

Substantial parts need independent failure isolation, scaling or release cadences.

Costs and failure modes

A change to one part can require releasing or scaling the whole application.

Case file

A worked decision

A two-person museum team ships collections, exhibitions and the staff interface together as one application. A release installs one artifact and migrations run in one maintenance window.

Change the condition

If the public search needs an independent release and failure budget, isolate that boundary before splitting unrelated features.

Check the decision

Rehearse a rollback and record which unrelated capabilities must roll back with the changed one.

Relationships

Catalog note · Specialized by: Modular Monolith

Study this decision

Sources

Operating-system architectural style

Monolithic Kernel

Run major operating-system services within a shared privileged address space.

FamilyOperating-system architecture
ScopeKernel / hardware services
Editorial statusDraft

What it buys

Frequent interactions among kernel services can use in-kernel calls instead of crossing an address-space boundary.

Apply when

Tightly coupled services benefit from direct calls and shared kernel facilities.

Reconsider when

Driver or subsystem failure must be isolated from the privileged core.

Costs and failure modes

A memory-safety failure in one privileged component can compromise the kernel.

Case file

A worked decision

A fixed-purpose appliance puts filesystem and network drivers in kernel space to minimize crossings on its packet path.

Change the condition

If drivers must restart independently after faults, isolate them behind process boundaries.

Check the decision

Does a driver fault bring down unrelated kernel services in the fault test?

Relationships

Catalog note · Alternative: OS Microkernel.

Referenced by other entries (1)

Sources

Workflow pattern

Multi-Instance Activity

Instantiate the same activity for each input item, sequentially or in parallel, with a completion rule.

FamilyWorkflow control flow
ScopeActivity instances within a workflow
Editorial statusDraft

What it buys

One activity definition can cover a runtime-sized set of reviewers while the workflow tracks their individual outcomes.

Apply when

Each member of a varying reviewer list or each item in a batch needs the same process step.

Reconsider when

Independent fire-and-forget jobs need no enclosing workflow or completion policy.

Costs and failure modes

Large fan-outs can overwhelm workers. Shared output variables can race between parallel branches.

Case file

A worked decision

An onboarding case launches a reference check for each referee named on the application.

Change the condition

If there is always exactly one referee, use a single check.

Check the decision

If one referee declines, what completion rule lets the case proceed?

Relationships

Catalog note · Can compose with Aggregator when individual outcomes form a collective result.

Referenced by other entries (2)

Sources

Deployment style

N-tier Architecture

Place application responsibilities in separately deployed tiers connected over a network.

FamilyStructural architecture
ScopeNetworked application
Editorial statusDraft

What it buys

A team can scale application capacity or restrict database network access independently of the presentation tier.

Apply when

Separate trust zones or independent resource requirements justify process boundaries.

Reconsider when

Logical layers fit one deployment and network round trips dominate useful work.

Costs and failure modes

Each tier adds latency, failure modes and coordinated rollout concerns.

Case file

A worked decision

A bank places the public web tier outside its restricted application tier and permits database access only from the latter. Network policy enforces a trust boundary between the deployments.

Change the condition

If all responsibilities share a host and trust level, logical layers can preserve organization without network hops.

Check the decision

From a compromised web-tier test identity, attempt a direct database connection.

Relationships

Catalog note · Distinguishes physical tiers from: Layered Architecture

Referenced by other entries (2)

Sources

Asynchronous model

Observable stream

Publish a sequence of values or events to subscribed observers over time.

FamilyReactive sequences
ScopeProducer and subscriber
Editorial statusDraft

What it buys

A live dashboard can subscribe when displayed and detach when closed without changing the component that produces measurements.

Apply when

Clients must react as new input arrives and combine or transform asynchronous sequences.

Reconsider when

A one-time request can return a value or a single future.

Costs and failure modes

Subscription cleanup, ordering and producer pressure may require additional protocols.

Case file

A worked decision

A market screen receives changes until the user closes it, then unsubscribes to avoid accumulating unused consumers.

Change the condition

A settings dialog that loads preferences once needs one asynchronous result.

Check the decision

After closing the screen, do updates stop and is the upstream subscription released?

Relationships

Study this decision

Sources

Object-oriented design pattern

Observer

A subject invokes registered observers when relevant state changes.

FamilyGoF · Behavioral
ScopeObject notification within a runtime
Editorial statusDraft

What it buys

Independent subscribers can react to a local change without making the publisher know their concrete types.

Apply when

Several independently added local dependents must update after a change.

Reconsider when

One known consumer suffices, notification order is critical or delivery must survive a crash.

Costs and failure modes

Forgotten subscriptions retain objects and reentrant callbacks make ordering hard to reason about.

Case file

A worked decision

A stock ticker notifies visible chart and table views when its latest quote changes. Each view unsubscribes on removal.

Change the condition

If one caller needs one explicit result, a direct return value is easier to reason about.

Check the decision

After closing a dashboard repeatedly, does the subscriber count return to baseline?

Relationships

Catalog note · Object-scale example of: Implicit Invocation

Referenced by other entries (3)

Sources

Architectural approach

Offline-first client architecture

Serve reads from local storage and coordinate synchronization with remote state.

FamilyClient and edge architecture
ScopeDevice and data service
Editorial statusDraft

What it buys

Users can open already-synchronized data promptly on a slow or disconnected network.

Apply when

An application must remain usable across slow, costly or unreliable connectivity.

Reconsider when

Authoritative online verification is mandatory before every action.

Costs and failure modes

Conflicts, stale data, queued writes and credential expiry need explicit policies.

Case file

A worked decision

A meter reader enters readings where cellular coverage is unreliable. The app commits locally, marks each reading pending and retries upload when connectivity returns.

Change the condition

If a technician must receive server authorization before energizing equipment, the authorization action still requires an online decision.

Check the decision

Submit a reading offline, terminate the app, restart it and verify that the pending value and upload status survive.

Relationships

Catalog note · Can use: Log-based change data capture

Sources

Restart strategy

One-for-All Supervision

When an eligible child fails, terminate its siblings and restart the group under child policies.

FamilyDaemon lifecycle and supervision
ScopeSupervisor / coupled workers
Editorial statusDraft

What it buys

Interdependent workers can restart from one generation together, avoiding surviving siblings that still depend on stale peer state.

Apply when

A group is only consistent after all members start together.

Reconsider when

Independent workers can recover without disrupting each other.

Costs and failure modes

A single recurring defect repeatedly interrupts healthy siblings.

Case file

A worked decision

Three Erlang workers maintain interdependent views of one device session, so a failed worker triggers a fresh start for the whole group.

Change the condition

If every session worker is independent, restart only the failed child.

Check the decision

Following a parser crash, can any sibling continue using state from the previous session generation?

Relationships

Catalog note · Alternative: One-for-One Supervision.

Referenced by other entries (2)

Sources

Restart strategy

One-for-One Supervision

Restart the failed eligible child while leaving its siblings running.

FamilyDaemon lifecycle and supervision
ScopeSupervisor / independent workers
Editorial statusDraft

What it buys

An independent worker can recover without interrupting the other children supervised alongside it.

Apply when

Sibling workers remain valid when any one sibling restarts.

Reconsider when

Siblings share an in-memory protocol that a restart invalidates.

Costs and failure modes

The restarted worker may rejoin siblings with incompatible state.

Case file

A worked decision

A supervisor owns independent per-camera workers and restarts only the camera process that crashes.

Change the condition

If siblings share a corrupted session state, restart the dependent group.

Check the decision

Does failure of camera A interrupt the stream from camera B?

Relationships

Catalog note · Alternative: One-for-All Supervision.

Referenced by other entries (1)

Sources

Architectural style

Onion Architecture

Put the domain model at the center and let outer infrastructure implement interfaces owned closer to the core.

FamilyApplication boundaries
ScopeDomain-centered application
Editorial statusDraft

What it buys

A domain rule can keep its own vocabulary even when a storage provider requires a different representation of the same data.

Apply when

The domain has a long lifetime and storage or UI adapters need to change independently.

Reconsider when

Simple database maintenance screens have little policy worth isolating.

Costs and failure modes

Mapping and indirection can obscure straightforward workflows.

Case file

A worked decision

A licensing service keeps license terms and renewal decisions in its core. Persistence and vendor adapters depend inward on those contracts, so a move to a new store leaves renewal rules intact.

Change the condition

An internal license spreadsheet with one import and no domain behavior can use simple data access.

Check the decision

Identify every dependency imported by renewal policy and verify that none belongs to persistence.

Relationships

Catalog note · Related: Clean Architecture

Sources

Strategic design pattern

Open Host Service

Expose a stable protocol through which multiple external consumers access the host's services.

FamilyDomain boundaries
ScopeIntegration surface of a context
Editorial statusDraft

What it buys

Each new integration can reuse a supported endpoint and protocol instead of requiring a bespoke interface from the host team.

Apply when

Several independent consumers would otherwise need bespoke integrations.

Reconsider when

One consumer needs a private rapidly changing interaction.

Costs and failure modes

The provider inherits protocol design, compatibility and versioning obligations.

Case file

A worked decision

A transit authority exposes a stable service for route and timetable queries so travel apps can integrate without custom interfaces for every partner.

Change the condition

If one partner has a one-off request with no expected reuse, a tailored bilateral contract may be cheaper.

Check the decision

Can a second partner build its integration from the same public contract without supplier-specific fields?

Relationships

Catalog note · Complements: Published Language

Sources

Automation pattern

Operator

Encode domain-specific operational knowledge in a controller over declared resources.

FamilyOperations architecture
ScopeApplication lifecycle
Editorial statusDraft

What it buys

Domain-specific upgrades and recovery steps can be carried out consistently across managed instances.

Apply when

Stateful services require repeated operations such as upgrade coordination or restore.

Reconsider when

A simple stateless rollout uses built-in controllers adequately.

Costs and failure modes

Controller bugs repeat at machine speed and can corrupt managed state.

Case file

A worked decision

A database operator interprets a cluster resource and orchestrates failover and backup using domain-specific checks.

Change the condition

For a stateless web process, ordinary deployment controls can already express the lifecycle.

Check the decision

What prevents two failover attempts from promoting different primaries?

Relationships

Catalog note · Specializes: Reconciliation loop

Referenced by other entries (2)

Sources

Type construction

Optional value / Maybe

Represent presence or absence without inventing a sentinel value.

FamilyTypes and polymorphism
ScopeType or public contract
Editorial statusDraft

Also indexed as · Option, Optional, Maybe

What it buys

A caller can distinguish a missing measurement from a legitimate measurement of zero without relying on a reserved sentinel.

Apply when

No match is an expected answer and no further explanation is required.

Reconsider when

Several failure reasons require distinct recovery actions.

Costs and failure modes

Converting all failures to absence destroys information a caller may need.

Case file

A worked decision

A function returning a user's optional middle name distinguishes an absent name from the empty text allowed by a legacy source.

Change the condition

A failed payment needs a reason such as declined or unavailable, not bare absence.

Check the decision

Can absence be propagated without being mistaken for a transport failure?

Relationships

Sources

Operating-system architectural style

OS Microkernel

Keep a small privileged core and move selected services behind isolated user-space interfaces.

FamilyOperating-system architecture
ScopeKernel / user-space services
Editorial statusDraft

What it buys

A failed user-space service can have a smaller fault domain, and less code must run with kernel privilege.

Apply when

Drivers or services need strong fault separation or a small trusted kernel.

Reconsider when

Frequent crossings on a hot path outweigh the isolation benefit.

Costs and failure modes

IPC and lifecycle management move complexity into user-space services.

Case file

A worked decision

A safety controller runs a device driver in its own address space and exchanges messages through the kernel.

Change the condition

For a simple embedded board with one trusted peripheral and tight IPC budgets, a single privileged image may suffice.

Check the decision

Can the driver crash and restart while other services remain responsive?

Relationships

Catalog note · Alternative: Monolithic Kernel. Distinct from a plug-in application microkernel.

Referenced by other entries (3)

Sources

Request dispatch pattern

Page Controller

Give a page or action its own request handler.

FamilyWeb presentation
ScopeIndividual page or action
Editorial statusDraft

What it buys

A page-specific validation or redirect can change without expanding a shared dispatcher full of unrelated branches.

Apply when

A small page-oriented application has distinct easy-to-follow actions.

Reconsider when

Controllers repeatedly duplicate dispatch, security or error-handling code.

Costs and failure modes

Inconsistent policies accumulate across pages.

Case file

A worked decision

A historical archive exposes a small set of distinct pages for a person, a place and a document. A separate page handler gathers each page's data and chooses its template.

Change the condition

If shared access and routing rules become duplicated across dozens of handlers, central dispatch can eliminate drift.

Check the decision

Add a new archive page and locate the code responsible for that page's input, model and response.

Relationships

Catalog note · Alternative: Front Controller

Sources

Paired workflow patterns

Parallel Split and Synchronization

Fork independent branches and wait for every required branch at their matching join.

FamilyWorkflow control flow
ScopeBusiness process instance
Editorial statusDraft

What it buys

Independent checks can proceed concurrently while the signing step retains a single, explicit barrier that requires every result.

Apply when

Credit and identity checks both need to finish before approval.

Reconsider when

Only a subset of branches is activated, or one result already suffices.

Costs and failure modes

The slowest branch sets latency. A join waiting for a branch that cannot arrive never progresses.

Case file

A worked decision

A release needs independent security and license scans, both successful before signing.

Change the condition

If the license scan consumes the security report, execute them in sequence.

Check the decision

Can signing begin after the security scan alone returns success?

Relationships

Catalog note · Alternative to Structured Synchronizing Merge when all branches always run.

Referenced by other entries (2)

Sources

Polymorphism mechanism

Parametric polymorphism

Abstract over a type parameter while preserving the relationship between argument and result types.

FamilyTypes and polymorphism
ScopeType or public contract
Editorial statusDraft

What it buys

A caller retrieving an item from a reusable container can retain its element type without casting or adding a domain superclass.

Apply when

One operation or container should preserve item types across unrelated domains.

Reconsider when

The only meaningful implementation uses one concrete type and a generic API obscures it.

Costs and failure modes

Unnecessary type parameters propagate complexity to callers.

Case file

A worked decision

Page of Invoice and Page of Product share pagination semantics while preserving item types, with no common base class.

Change the condition

A report used only by finance can return OverdueInvoices directly.

Check the decision

Can you name an independent caller or a type-level mistake each parameter prevents?

Relationships

Study this decision

Sources

Function technique

Partial application

Fix some arguments now and supply the remaining arguments later.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

A configured callback can be passed to downstream code without repeating the same fixed settings at every invocation.

Apply when

A configuration remains constant across many uses of a function.

Reconsider when

A named explicit call with all its arguments is just as clear and occurs once.

Costs and failure modes

Large or mutable captured values can outlive the operation and surprise the caller.

Case file

A worked decision

A tax calculator binds this report's ruleset and currency once, producing a function of a line item.

Change the condition

If each line can use a different currency, keep currency explicit in the call.

Check the decision

Can two generated calculators run side by side with different rulesets and no shared mutation?

Relationships

Sources

Presentation pattern

Passive View

The presenter reads and updates a deliberately passive view through an interface.

FamilyPresentation architecture
ScopeUI boundary
Editorial statusDraft

What it buys

Tests can observe exactly which values a presenter sends to controls using a simple substitute view.

Apply when

Critical interaction behavior needs automated tests without loading a GUI toolkit.

Reconsider when

Form behavior is simple and supported declaratively by existing bindings.

Costs and failure modes

Writing and maintaining view accessors creates repetitive code.

Case file

A worked decision

A point-of-sale presenter decides which buttons are enabled after a refund scan. The view exposes display operations and reports gestures without deciding refund eligibility.

Change the condition

If every displayed value can be directly and safely bound, manually assigning each field in the presenter adds noise.

Check the decision

Can an automated test assert every displayed button state from a sequence of presenter inputs alone?

Relationships

Catalog note · Variant of: Model–View–Presenter (MVP)

Referenced by other entries (1)

Sources

Consensus protocol

Paxos

Use numbered proposals, intersecting quorums and acceptance rules to choose one value per instance.

FamilyConsensus and commit
ScopeReplica group
Editorial statusDraft

What it buys

Competing proposers can converge on one chosen value despite crash failures when a quorum remains available and progress conditions hold.

Apply when

Crash-fault-tolerant agreement is required despite delays or lost proposers.

Reconsider when

A single trusted store meets durability and availability targets.

Costs and failure modes

Competing proposers can delay progress. Repeated decisions and membership changes add engineering work.

Case file

A worked decision

A coordination service must choose one configuration value despite competing proposers and a minority of crash failures.

Change the condition

If a single authority can halt safely until repaired, commit its decision locally.

Check the decision

Can a later proposer choose a different value after a majority already accepted one?

Relationships

Catalog note · Alternative to Raft when building a replicated state machine.

Sources

Architectural style

Peer-to-Peer

Peers contribute and consume resources; some designs retain centralized discovery.

FamilyNetwork architecture and protocols
ScopeDistributed participants
Editorial statusDraft

What it buys

Participants can contribute upload capacity or resources to one another instead of placing all distribution traffic on the original source.

Apply when

Capacity or availability can improve as participating nodes contribute resources.

Reconsider when

All participants are thin clients or one authority must make every decision.

Costs and failure modes

Churn, trust and discovery become operational problems.

Case file

A worked decision

A fleet distributes large public firmware images by allowing devices to fetch verified chunks from nearby peers.

Change the condition

If a small fleet shares a fast central source, use direct downloads.

Check the decision

Can a device validate a chunk from an untrusted peer against the signed manifest?

Relationships

Catalog note · Alternative: Client–Server; hybrid systems can combine both.

Referenced by other entries (1)

Sources

Data structure family

Persistent data structure

Return a new version on update while preserving access to older versions, often sharing unchanged structure.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

Undo or concurrent readers can retain an older snapshot while later updates share its unchanged parts.

Apply when

Multiple views, branches or undo history must safely retain earlier states.

Reconsider when

One hot single-owner buffer is mutated in place and no history is needed.

Costs and failure modes

Retained roots keep old structure alive. Updates can add pointer chasing and allocation.

Case file

A worked decision

A drawing editor stores each stroke as a new document version and Undo moves back to the preceding root.

Change the condition

A scratch vertex buffer rebuilt for every frame has no old state to preserve.

Check the decision

After hundreds of small edits, how much memory stays reachable when the undo limit expires?

Relationships

Sources

Architectural style

Pipes and Filters

Connect stages through streams so each filter transforms its input independently.

FamilyStructural architecture
ScopeProcessing pipeline
Editorial statusDraft

What it buys

A transformation can be tested on recorded input and reused in a second pipeline without reproducing upstream acquisition logic.

Apply when

Stages can be reused or reordered and intermediate representations have stable contracts.

Reconsider when

Multiple stages must coordinate mutable state or provide immediate interactive feedback.

Costs and failure modes

Format conversions, buffering and backpressure can dominate execution.

Case file

A worked decision

A telescope pipeline decodes, calibrates and classifies observation batches. Separate filters consume and emit documented record formats so calibration can be replaced independently.

Change the condition

If stages share a complex mutable object and repeatedly need each other's decisions, one explicit processing module may be clearer.

Check the decision

Reprocess a recorded batch through the replacement calibration filter and compare the downstream classifications.

Relationships

Catalog note · Complements: Backpressure

Referenced by other entries (4)

Study this decision

Sources

Integration pattern

Point-to-Point Channel

Direct each delivery to one consumer of a shared channel.

FamilyMessage delivery
ScopeBroker channel
Editorial statusDraft

Also indexed as · Work queue

What it buys

A producer can direct a work item to one processing role while the channel selects an available instance.

Apply when

A job should be claimed by one of several interchangeable workers.

Reconsider when

Independent applications each need their own copy of the event.

Costs and failure modes

A consumer crash can cause redelivery after an acknowledgement timeout.

Case file

A worked decision

A transcription company puts each recording on a work queue for one available transcriber. After completion it emits a separate fact for any interested systems.

Change the condition

If both an auditor and an analytics service must process every recording, sharing a single work queue would drop each other's copies.

Check the decision

Connect two worker instances, enqueue two uniquely tagged jobs and verify how redelivery behaves when one worker stops.

Relationships

Catalog note · Contrasts with Publish–Subscribe Channel, which fans out to subscriptions.

Referenced by other entries (2)

Study this decision

Sources

Generic composition technique

Policy-based design

Assemble a host type from independently supplied policy types that implement specific behavior.

FamilyProgramming model and architecture
ScopeType and library
Editorial statusDraft

What it buys

Independent choices such as allocation and locking can be combined without defining a bespoke subclass for every pairing.

Apply when

Several compile-time behavior dimensions vary independently and their combinations are useful.

Reconsider when

Variation must be selected at runtime or one concrete policy suffices.

Costs and failure modes

Combinatorial type complexity and unclear diagnostics can outweigh reuse.

Case file

A worked decision

A firmware packet writer assembles checksum and buffer policies at build time for a fixed device profile. Unsupported combinations fail validation before deployment.

Change the condition

If operators select a checksum per connection at runtime, injected behavior is easier than multiplying prebuilt writer types.

Check the decision

Compile every supported device profile and verify its packet bytes against an independent decoder.

Relationships

Catalog note · Alternative runtime representation: Strategy

Referenced by other entries (1)

Study this decision

Sources

Implementation pattern

Polling Publisher

Periodically claim and publish outstanding outbox records from a table.

FamilyTransactional messaging
ScopeDatabase and relay
Editorial statusDraft

What it buys

A team can relay committed outbox records using ordinary database queries when operational access to the transaction log is unavailable.

Apply when

Portability matters and polling meets the delivery deadline.

Reconsider when

Polling load or the required latency makes a change-log feed more economical.

Costs and failure modes

Poll intervals trade delay for load. A relay crash can duplicate publication.

Case file

A worked decision

A small billing service periodically claims committed outbox rows because the database exposes no change feed.

Change the condition

If the database already supplies an operationally supported change feed, read that stream.

Check the decision

Does a crash after sending but before marking a row sent yield a detectable duplicate?

Relationships

Catalog note · Implements Transactional Outbox as an alternative to Transaction Log Tailing.

Referenced by other entries (1)

Runnable labs

Sources

Architectural pattern

Presentation–Abstraction–Control (PAC)

Organize a hierarchy of cooperating agents, each with presentation, abstraction and control components.

FamilyPresentation architecture
ScopeInteractive application
Editorial statusDraft

What it buys

A complex interface can coordinate independently interactive regions while preserving local responsibility for each region's presentation and data.

Apply when

Several interdependent views or tasks need local behavior and explicit coordination between levels.

Reconsider when

A small screen with one state owner is simpler with a single presentation model.

Costs and failure modes

Inter-agent coordination creates extra indirect paths and can distribute UI state awkwardly.

Case file

A worked decision

A control-room application has a site map, an alarm panel and drill-down equipment panels. Each PAC agent manages its own presentation and abstraction, and its control component communicates with neighboring agents.

Change the condition

If one document and one view owner can coordinate the whole screen, a hierarchy of agents adds message paths without useful autonomy.

Check the decision

Open an alarm for a newly selected site and trace which agents resolve or reject stale selections.

Relationships

Catalog note · Alternative: Model–View–Controller (MVC)

Sources

Scheduling protocol

Priority Inheritance

Temporarily raise a lock owner's priority when a higher-priority task waits for it.

FamilyEmbedded and real-time control
ScopeRTOS / contended mutex
Editorial statusDraft

What it buys

A low-priority lock holder can finish a critical section sooner when a higher-priority task is waiting on it.

Apply when

High-priority tasks depend on locks held by lower-priority tasks.

Reconsider when

Independent work can avoid sharing a lock or the delay comes from long I/O.

Costs and failure modes

It does not bound time spent inside an unbounded critical section.

Case file

A worked decision

A low-priority telemetry task holding a device mutex inherits the priority of a blocked control task until it releases the mutex.

Change the condition

If one task owns the device and never blocks urgent work, omit the priority-aware mutex.

Check the decision

Can a medium-priority CPU hog still delay the urgent task beyond its deadline?

Relationships

Catalog note · Complements: Scoped Locking defines the region subject to contention.

Sources

Architectural pattern

Proactor

Submit I/O in advance and dispatch a handler after completion.

FamilyConcurrency and network I/O
ScopeProcess / asynchronous I/O
Editorial statusDraft

What it buys

An application can keep multiple operations in flight and devote its completion handlers to processing results already delivered by the I/O subsystem.

Apply when

The platform can execute asynchronous operations while callers continue.

Reconsider when

The platform offers readiness only and a Reactor already meets demand.

Costs and failure modes

Buffers and per-operation context must survive cancellation and late completion.

Case file

A worked decision

A file server submits asynchronous reads and resumes client work only after the OS reports completed bytes.

Change the condition

If the platform exposes only readiness, dispatch readiness and perform the reads in handlers.

Check the decision

Can a completed short read be distinguished from a request that merely became readable?

Relationships

Catalog note · Complements: Asynchronous Completion Token.

Referenced by other entries (3)

Sources

Integration pattern

Process Manager

Maintain conversation state in a coordinator that chooses each next step.

FamilyWorkflow coordination
ScopeBusiness process
Editorial statusDraft

What it buys

Operators can inspect what a particular case is waiting for and resume coordination when its next correlated result arrives.

Apply when

An approval flow branches, waits for external messages and resumes days later.

Reconsider when

A fixed linear sequence can carry its route with each message.

Costs and failure modes

The coordinator needs durable state, recovery and ownership.

Case file

A worked decision

A repair order records which parts arrived and schedules assembly only after all required parts are present.

Change the condition

If each arrival triggers one independent update, handle it directly.

Check the decision

Can a duplicate arrival make the manager schedule assembly twice?

Relationships

Catalog note · Can implement Saga orchestration when steps are local transactions.

Referenced by other entries (4)

Sources

Rule-based architecture

Production rules engine

Match facts against rule conditions and select eligible actions.

FamilyProgramming model and architecture
ScopeDecision subsystem
Editorial statusDraft

What it buys

A new rule can be introduced alongside existing rules while the engine determines which conditions match the current facts.

Apply when

Many interacting policies change independently and need an explicit rule vocabulary.

Reconsider when

A few stable conditions are clearer in direct control flow.

Costs and failure modes

Rule order, interaction and explanations become difficult to debug.

Case file

A worked decision

A customs workflow evaluates independently maintained export restrictions against shipment facts. Each rule explains which restriction flagged a shipment for review.

Change the condition

When the policy is one threshold and a single exemption, a direct predicate is easier to review and test.

Check the decision

Enter a shipment matching two restrictions and verify the resulting actions and justification are independent of accidental rule order.

Relationships

Catalog note · Alternative for finding feasible assignments: Constraint solver

Referenced by other entries (2)

Sources

Object-oriented design pattern

Prototype

Create an instance by copying a configured example, preserving its selected structure or state.

FamilyGoF · Creational
ScopeCreation from an existing object
Editorial statusDraft

What it buys

A client can create variations from an existing configured instance without restating its complete construction process.

Apply when

Objects are selected or configured at runtime and rebuilding equivalent configuration is cumbersome.

Reconsider when

Explicit construction is cheap or instances own unique resources and identities.

Costs and failure modes

Shallow copying aliases state while deep copying may duplicate external handles incorrectly.

Case file

A worked decision

A design tool creates a new diagram shape by cloning a configured stencil that includes custom line styles and anchors.

Change the condition

If objects have cheap, explicit construction with no meaningful preset state, use a constructor.

Check the decision

After editing the clone, which mutable fields are still shared with the stencil?

Relationships

Catalog note · Can implement: Abstract Factory

Referenced by other entries (1)

Sources

Object-oriented design pattern

Proxy

Place a substitute behind the subject's interface to mediate access, creation or remote calls.

FamilyGoF · Structural
ScopeObject reference and access
Editorial statusDraft

What it buys

Clients can retain a common interface while access, lazy loading or remote dispatch is controlled at one boundary.

Apply when

Clients need uniform access while work must be deferred, restricted or forwarded.

Reconsider when

Direct calls suffice or transparency would conceal important remote latency and failure.

Costs and failure modes

A seemingly cheap local method can unexpectedly allocate, block or fail remotely.

Case file

A worked decision

An image viewer holds a proxy that implements the image interface and loads the full image only when the user zooms in.

Change the condition

If every image is needed immediately and cheaply, construct it directly.

Check the decision

Can the first synchronous proxy call block the UI on disk or network I/O?

Relationships

Catalog note · Contrasts with behavior extension in: Decorator

Sources

Strategic design pattern

Published Language

Use a documented shared language for exchanging information across contexts.

FamilyDomain boundaries
ScopeInterchange contract
Editorial statusDraft

What it buys

Consumers can implement exchange contracts independently and test examples against a shared interpretation of the fields.

Apply when

Several parties need a stable format whose business meaning is explicit.

Reconsider when

A private two-party exchange changes so frequently that standardizing has no return.

Costs and failure modes

Version drift and superficially compatible semantics can compromise interoperability.

Case file

A worked decision

Several logistics providers publish the meaning and units of package dimensions in a versioned interchange specification. Each carrier translates its own scan records to that language.

Change the condition

If two components share one release cycle and one representation, a separate published schema may add unnecessary translation.

Check the decision

Ask two partners to encode the same irregular parcel and compare interpretations of its units and orientation.

Relationships

Catalog note · Complements: Open Host Service

Referenced by other entries (2)

Sources

Integration pattern

Publish–Subscribe Channel

Fan a publication out to the subscriptions interested in it.

FamilyMessage delivery
ScopeBroker channel
Editorial statusDraft

What it buys

A new subscriber can receive its own copy of future publications without disrupting existing subscribers.

Apply when

Billing and inventory independently react to the same sale.

Reconsider when

There is one job and five workers available to do it.

Costs and failure modes

Slow subscribers accumulate separate backlogs. Each needs delivery and replay policies.

Case file

A worked decision

A sports league publishes ScoreCorrected to scoreboard, standings and broadcast subscriptions. The standings subscription can add multiple workers while the others keep receiving their own copies.

Change the condition

If one operator must handle a single repair ticket, a work queue avoids creating independent copies for every worker.

Check the decision

Disconnect the standings worker and verify the scoreboard continues while the standings subscription follows its retention policy.

Relationships

Catalog note · Composes with Competing Consumers inside each subscription.

Referenced by other entries (4)

Study this decision

Sources

State transition pattern

Pure reducer

Derive the next state from the current state and an input action with a deterministic transition.

FamilyState and transitions
ScopeFunction or stateful component
Editorial statusDraft

What it buys

A recorded state and input can reproduce a transition exactly, making state-change bugs easier to isolate.

Apply when

History, deterministic replay or state-transition tests matter.

Reconsider when

The operation is mostly external I/O and has little state to compute.

Costs and failure modes

Moving effects out of the reducer introduces an explicit effect-handling boundary.

Case file

A worked decision

Replaying the same card-game moves with the same starting deck reproduces the same board state.

Change the condition

A command that sends a reminder immediately needs an effect handler, with no reducer if there is no local state transition.

Check the decision

Does replay produce the same state without reading the system clock or generating randomness inside the reducer?

Relationships

Study this decision

Sources

Resilience pattern

Queue-Based Load Leveling

Buffer arrivals and drain at a rate a downstream component can sustain.

FamilyFault isolation and overload
ScopeProducer and workers
Editorial statusDraft

What it buys

Workers can drain durable work at a sustainable rate after a burst, provided average demand and job deadlines permit catch-up.

Apply when

Traffic is bursty and a bounded delay is acceptable for background jobs.

Reconsider when

Long-term arrivals exceed capacity or the caller requires an immediate result.

Costs and failure modes

Backlog age can exceed the usefulness of jobs. Queue capacity and admission limits still matter.

Case file

A worked decision

A print vendor accepts a morning burst of durable label jobs and drains it at the printers' sustainable rate.

Change the condition

If labels expire before a backlog could drain, reject excess jobs promptly.

Check the decision

How old is the oldest unprinted job when incoming volume returns to normal?

Relationships

Catalog note · Composes with Competing Consumers to scale processing.

Referenced by other entries (1)

Sources

Consensus protocol

Raft

Elect a leader and commit log entries under quorum and term rules that preserve a replicated state machine.

FamilyConsensus and commit
ScopeConsensus group
Editorial statusDraft

What it buys

A service can recover the order of committed configuration changes after leadership changes without asking clients to reconstruct that ordering.

Apply when

A small group needs an authoritative ordered history across machine crashes.

Reconsider when

Disconnected minority replicas must keep committing writes, or Byzantine faults are in scope.

Costs and failure modes

Loss of a quorum stops commits. Snapshotting, membership changes and persistence need careful implementation.

Case file

A worked decision

A cluster needs a consistent sequence of routing-rule edits even when the node receiving edits crashes.

Change the condition

If routing rules are served from one durable host with an acceptable recovery window, use a single writer.

Check the decision

After a leader crash, do all surviving nodes apply committed rules in the same order?

Relationships

Catalog note · Implements Replicated Log with Majority Quorum.

Referenced by other entries (3)

Sources

Stream protocol / specification

Reactive Streams

A subscriber requests a bounded number of elements and a publisher respects that demand.

FamilyDistributed coordination models
ScopeAsynchronous stages / demand signaling
Editorial statusDraft

What it buys

An asynchronous producer and consumer from different components can agree how much work the consumer is ready to accept.

Apply when

A fast producer and slower consumer need a common asynchronous backpressure protocol.

Reconsider when

A synchronous iterator suffices or the physical producer cannot slow and needs a separately defined loss policy.

Costs and failure modes

Demand coordination, cancellation and terminal-signal races require careful handling.

Case file

A worked decision

A streaming exporter must propagate subscriber demand so its fast source does not overwhelm a slow uploader.

Change the condition

If the entire export fits comfortably in memory, pass a batch.

Check the decision

Can the exporter emit a data element before its subscriber has requested one?

Relationships

Catalog note · Related: Credit-Based Flow Control applies a similar constraint at transport scope.

Referenced by other entries (4)

Study this decision

Sources

Architectural pattern

Reactor

Dispatch a ready handle to a handler that performs the I/O.

FamilyConcurrency and network I/O
ScopeProcess / I/O loop
Editorial statusDraft

What it buys

One waiting thread can dispatch many mostly idle connections when each ready handler finishes promptly.

Apply when

Many mostly idle sockets can share a small set of threads.

Reconsider when

A handler may block for long periods without offloading its work.

Costs and failure modes

A slow handler delays unrelated clients on the same loop.

Case file

A worked decision

A chat relay observes which nonblocking sockets are readable and dispatches short handlers to drain available data.

Change the condition

If each connection runs a simple blocking conversation and concurrency is low, give each one a worker.

Check the decision

Can a handler tolerate readiness followed by a would-block result?

Relationships

Catalog note · Alternative: Proactor dispatches completions.

Referenced by other entries (3)

Study this decision

Sources

Synchronization pattern

Read-Copy-Update

Publish a replacement version, then defer reclamation until pre-existing readers complete.

FamilySynchronization and memory
ScopeShared memory / kernel
Editorial statusDraft

What it buys

Many readers can proceed through a stable version while an updater prepares a replacement.

Apply when

Reads dominate and concurrent readers need inexpensive traversal.

Reconsider when

Updates dominate or delayed reclamation cannot be tolerated.

Costs and failure modes

Tracking grace periods and object lifetimes complicates reclamation.

Case file

A worked decision

A routing service publishes an immutable replacement forwarding table and reclaims its predecessor after pre-existing readers finish.

Change the condition

If updates are frequent and the table is small, a reader-writer lock simplifies reclamation.

Check the decision

What bounds the lifetime of an old table when a reader stalls?

Relationships

Catalog note · Alternative: Monitor Object can serialize access.

Referenced by other entries (1)

Sources

Caching pattern

Read-through cache

Load missing entries through a cache-owned loader.

FamilyData access and caching
ScopeCache and data source
Editorial statusDraft

What it buys

Clients share one miss-loading policy and can treat a cache miss and hit through the same read interface.

Apply when

Several readers should share one miss policy and cache loading contract.

Reconsider when

Services need different authorization or loading semantics for the same keys.

Costs and failure modes

Slow loaders tie up cache resources and miss isolation needs attention.

Case file

A worked decision

A product lookup calls one cache interface whose loader fetches missing records from storage.

Change the condition

If a miss must trigger user-specific authorization or conditional joins, explicit application loading may be easier to review.

Check the decision

What happens when a hot key expires and many callers invoke its loader?

Relationships

Catalog note · Alternative: Cache-Aside

Referenced by other entries (2)

Sources

Process-lifecycle protocol

Readiness Notification

Have the application explicitly signal completion of essential initialization.

FamilyDaemon lifecycle and supervision
ScopeService / manager boundary
Editorial statusDraft

What it buys

A manager can delay dependent startup or routing until an application reports that its initialization is complete.

Apply when

Dependents must wait for the service to be usable after launch.

Reconsider when

Startup has no meaningful work beyond launching the executable.

Costs and failure modes

A missing or premature notification stalls dependents or releases them too early.

Case file

A worked decision

A search daemon signals readiness only after its index is loaded and it can answer queries.

Change the condition

If the service performs no initialization and its only startup dependency is a listening socket already owned by its manager, socket activation may suffice.

Check the decision

Can an orchestrator route a query during index loading after process launch but before the daemon signals readiness?

Relationships

Catalog note · Complements: Socket Activation covers listening socket availability.

Referenced by other entries (2)

Study this decision

Sources

Control pattern

Reconciliation loop

Continuously compare desired and observed state and drive convergence.

FamilyOperations architecture
ScopeManaged resource
Editorial statusDraft

What it buys

The controller can resume after interruption by inspecting actual state and taking the remaining steps.

Apply when

Resources drift or changes must recover from interrupted work.

Reconsider when

A simple one-shot action has no persistent desired state to reconcile.

Costs and failure modes

Unstable feedback or non-idempotent actions may repeat destructive work.

Case file

A worked decision

A controller compares requested worker count with observed healthy workers and creates only the missing capacity after each observation.

Change the condition

For a one-time export with no persistent target state, run a bounded job instead.

Check the decision

If the controller restarts immediately after creating a worker, does the next pass duplicate it?

Relationships

Catalog note · Specialized by: Operator

Referenced by other entries (4)

Sources

Query technique

Recursive query / fixed point

Build a relation from seed rows and repeated expansion until there are no more qualifying rows.

FamilyRelational operations and invariants
ScopeRelation, query or database boundary
Editorial statusDraft

What it buys

A hierarchy query can discover descendants of unknown depth without a new application round trip for every level.

Apply when

Reachability, ancestry or hierarchy must be evaluated close to relational data.

Reconsider when

A shallow, fixed relationship requires one join, or traversal state is naturally local to the caller.

Costs and failure modes

Cycles, duplicate paths and expanding intermediate results need explicit control.

Case file

A worked decision

A bill of materials expands assemblies into nested components before calculating required quantities.

Change the condition

A product catalog with exactly one category per product needs only an ordinary join.

Check the decision

What happens when an accidental cycle appears, and are distinct valid paths relevant to the total?

Relationships

Sources

Ownership technique

Reference-counted ownership

Release an object when its last owning reference is relinquished.

FamilyResource lifetime and ownership
ScopeResource or process lifetime
Editorial statusDraft

Also indexed as · Reference counting

What it buys

Independent users can retain a shared object through overlapping lifetimes without agreeing in advance on which will finish last.

Apply when

Several components independently retain a resource and no single scope owns its final release.

Reconsider when

One owner and scoped borrows cover every use, or cycles are central to the object graph.

Costs and failure modes

Cycles can retain unreachable objects. Atomic counts add work under contention.

Case file

A worked decision

A decoded image is shared by a thumbnail and an editor window. Each holds an owning reference until it releases the image.

Change the condition

If the editor owns both children and they cannot survive it, make the children borrow from the editor.

Check the decision

Can a cycle prevent the count from reaching zero after all visible windows close?

Relationships

Referenced by other entries (1)

Sources

Architectural pattern

Reflection

Expose selected aspects of an application's own structure or behavior to a metalevel that can inspect or alter them.

FamilyStructural architecture
ScopeRuntime and metalevel
Editorial statusDraft

What it buys

A serializer can discover declared fields at runtime, reducing hand-written wiring as supported model types evolve.

Apply when

The required runtime extensions include changing how objects, calls or types are interpreted.

Reconsider when

A fixed extension interface handles every supported variation.

Costs and failure modes

Changes at the metalevel can bypass invariants and make performance and behavior harder to predict.

Case file

A worked decision

A modeling tool lets customers describe new entity types and validation operations at runtime. Its metamodel is inspectable, and changes to it alter how the tool interprets entities.

Change the condition

If the supported variations are a fixed set of validators, a plug-in interface can expose just those hooks.

Check the decision

Can a tenant's metamodel add a valid field while still rejecting edits that violate protected invariants?

Relationships

Catalog note · Alternative for fixed hooks: Microkernel / Plug-in Architecture

Sources

Architectural style

Remote Evaluation

Ship executable instructions to a remote host that has the required data or resources.

FamilyNetwork architecture and protocols
ScopeClient / remote execution host
Editorial statusDraft

What it buys

A small restricted computation can travel to a large dataset and return a result without transferring the whole dataset to the caller.

Apply when

Moving bounded computation is cheaper than shipping a large data set.

Reconsider when

A fixed remote API suffices or arbitrary execution cannot be contained.

Costs and failure modes

Resource isolation and validation of submitted code become essential.

Case file

A worked decision

An analytics client submits a bounded expression to execute near a large dataset rather than transporting raw records.

Change the condition

If all users request the same aggregate, expose it as a predefined operation.

Check the decision

Will the remote evaluator reject an expression that exceeds its resource budget?

Relationships

Catalog note · Contrast: Remote Procedure Call normally selects preinstalled server behavior.

Referenced by other entries (1)

Sources

Distribution pattern

Remote Facade

Present coarse-grained remote operations over a finer-grained local interface.

FamilyEnterprise integration
ScopeRemote API boundary
Editorial statusDraft

What it buys

A client can complete one business operation in a single remote call and leave fine-grained interaction on the server.

Apply when

Remote clients otherwise make many small network calls per use case.

Reconsider when

The interface is used solely in process or already offers suitable coarse-grained operations.

Costs and failure modes

Remote contracts can become broad and lose flexibility.

Case file

A worked decision

An overseas depot needs to reserve all items for a repair order. A coarse reserve-order operation performs local checks together instead of issuing one remote call per stock line.

Change the condition

If the caller runs in the same process and needs independent item operations, a coarse facade may obscure useful granularity.

Check the decision

Use a network trace to count the round trips required to reserve a multi-line order and examine its failure semantics.

Relationships

Catalog note · Complements: Data Transfer Object

Referenced by other entries (1)

Sources

Communication model

Remote Procedure Call

Encode a procedure call and its reply as protocol messages between processes.

FamilyNetwork architecture and protocols
ScopeProcess / network boundary
Editorial statusDraft

What it buys

A stable operation contract lets clients invoke a remote service without implementing the wire exchange separately at each call site.

Apply when

An operation has a well-defined request and reply that callers need promptly.

Reconsider when

Long-lived work must survive disconnection or be consumed by several services.

Costs and failure modes

A timeout can leave the caller uncertain whether a side effect occurred.

Case file

A worked decision

An internal build scheduler invokes a typed artifact-signing operation on a dedicated service.

Change the condition

If the signing hardware and scheduler share a process and trust boundary, call the local interface.

Check the decision

After a timeout, can the scheduler tell whether it must query the signing result before retrying?

Relationships

Catalog note · Contrast: publish–subscribe decouples senders from individual responders.

Referenced by other entries (2)

Sources

Replication pattern

Replicated Log

Agree on or propagate an ordered sequence of updates for replicas to apply.

FamilyReplication and consistency
ScopeReplica group
Editorial statusDraft

What it buys

A recovering participant can replay a known sequence of committed operations from its last durable position.

Apply when

Multiple nodes must reconstruct state changes in the same order.

Reconsider when

Independent updates can merge without a single global sequence.

Costs and failure modes

Catch-up, truncation and commitment rules must be explicit. Persistence alone cannot guarantee agreement.

Case file

A worked decision

Several policy engines must apply the same sequence of approved changes and resume from known offsets.

Change the condition

If only one engine consumes decisions, store a local ordered journal.

Check the decision

If an engine restarts from an older offset, does it reconstruct the same policy state?

Relationships

Catalog note · Implemented with Raft for a crash-fault-tolerant committed order.

Referenced by other entries (2)

Sources

Persistence abstraction pattern

Repository

Expose domain-oriented collection operations while encapsulating query and persistence details.

FamilyEnterprise persistence
ScopeDomain access boundary
Editorial statusDraft

What it buys

Callers can express a domain query once and reuse it across workflows while the backing query plan or storage technology changes.

Apply when

Aggregates need a domain vocabulary for loading or saving and query rules recur.

Reconsider when

A generic wrapper only duplicates a capable query API or conceals essential query costs.

Costs and failure modes

An oversized repository leaks storage semantics or produces inefficient loads.

Case file

A worked decision

A loan analyst requests delinquent accounts in a specified risk band. A domain-facing repository expresses that query and reconstructs accounts without exposing SQL joins to the analyst workflow.

Change the condition

If every screen needs a different read projection and has no domain behavior, direct query objects may keep the use cases clearer.

Check the decision

Can the analyst ask for the intended set without importing persistence-specific predicates or knowing table names?

Relationships

Catalog note · Can use: Data Mapper

Referenced by other entries (1)

Study this decision

Sources

Architectural style

Representational State Transfer (REST)

Combine client–server, stateless interaction, caching, layering and a uniform interface for resources.

FamilyNetwork architecture
ScopeDistributed hypermedia system
Editorial statusDraft

What it buys

Independently developed clients and intermediaries can reuse standard resource, representation and cache semantics where the interface honors them.

Apply when

Independent clients and intermediaries need evolvable representations of network resources.

Reconsider when

A private specialized operation has tight round-trip or binary efficiency requirements.

Costs and failure modes

Uniformity constrains application-specific shortcuts and stateless requests can carry more context.

Case file

A worked decision

A document service exposes addressable resources, cacheable representations and links for allowed transitions so clients can navigate evolving workflows.

Change the condition

If both ends implement a tightly controlled operation such as invoking a compiler, expose a direct procedure call.

Check the decision

Can a client locate the permitted next transition from the response without constructing a private URL?

Relationships

Catalog note · Related: Client–Server

Sources

Integration pattern

Request–Reply

Return a reply message for a specific request message.

FamilyMessage contracts
ScopeService conversation
Editorial statusDraft

What it buys

A client can receive the result of a particular operation across messaging infrastructure without sharing a call stack with the worker.

Apply when

A caller needs a decision from a separate participant over messaging.

Reconsider when

Fire-and-forget event notification has no meaningful reply.

Costs and failure modes

The caller must track deadlines and distinguish late replies from retries.

Case file

A worked decision

A diagnostics client requests a machine's current vibration sample over a broker and waits for the corresponding reply until a deadline. It distinguishes timeout from a reported machine fault.

Change the condition

For periodic fleet telemetry with no individual caller waiting for an answer, publish observations independently.

Check the decision

Return the sample after the deadline and verify the client neither blocks indefinitely nor attaches it to a later request.

Relationships

Catalog note · Uses Correlation Identifier for several in-flight requests.

Referenced by other entries (1)

Sources

Integration pattern

Resequencer

Buffer numbered messages and release them in their intended order.

FamilyMessage routing
ScopeIntegration flow
Editorial statusDraft

What it buys

A consumer can apply order-sensitive updates in their intended sequence even when independent delivery paths run at different speeds.

Apply when

A downstream participant requires order that the transport cannot preserve.

Reconsider when

Operations commute, or the transport already guarantees the needed per-key order.

Costs and failure modes

A missing sequence number stalls the buffer unless gaps have a policy.

Case file

A worked decision

A tracking feed must display depot scans in shipment sequence despite parallel delivery.

Change the condition

If scans simply increment independent depot counts, consume them on arrival.

Check the decision

What happens to scans 14 and 15 when scan 13 never arrives?

Relationships

Catalog note · Contrasts with Aggregator, which combines inputs rather than restoring order.

Sources

Restart strategy

Rest-for-One Supervision

Restart an eligible child and later-started dependents according to restart policies.

FamilyDaemon lifecycle and supervision
ScopeSupervisor / ordered dependencies
Editorial statusDraft

What it buys

A supervisor can restart a failed prerequisite and later dependents while preserving healthy children earlier in the start order.

Apply when

The startup order expresses a dependency chain.

Reconsider when

Dependencies form a graph that cannot be represented safely by one order.

Costs and failure modes

An incorrect order can keep invalid dependents alive or restart healthy ones.

Case file

A worked decision

A connection process starts before a decoder and publisher that depend on it, so failure restarts it and its later siblings.

Change the condition

If the siblings do not depend on earlier children, restart only the failed child.

Check the decision

Does a publisher crash leave the earlier healthy connection and decoder running?

Relationships

Catalog note · Specializes: Supervision Tree.

Sources

Type construction

Result / Either

Return one of a success value and an explicit failure value.

FamilyTypes and polymorphism
ScopeType or public contract
Editorial statusDraft

Also indexed as · Result, Either, tagged error

What it buys

A caller can make a recovery decision from a typed failure while the successful value retains its ordinary domain type.

Apply when

Callers must inspect expected domain failures to select their next action.

Reconsider when

A missing item has one unambiguous meaning and an optional value suffices.

Costs and failure modes

Overly broad error unions create mapping work and can leak implementation details.

Case file

A worked decision

A ticket reservation returns Confirmed or a typed reason such as SeatTaken. The UI can offer a different seat for that case.

Change the condition

A lookup for an optional display hint needs no failure taxonomy.

Check the decision

Can the caller distinguish a conflicting reservation from a temporary system outage?

Relationships

Referenced by other entries (1)

Sources

Model-system architecture

Retrieval-augmented generation

Retrieve external evidence for a query and condition generation on the retrieved content.

FamilyML and AI systems
ScopeRetrieval and inference
Editorial statusDraft

Also indexed as · RAG

What it buys

An answer can draw on a changing, inspectable collection without embedding every fact in model parameters.

Apply when

Answers depend on a changing corpus or need evidence that can be inspected.

Reconsider when

A deterministic lookup already returns the authoritative answer.

Costs and failure modes

Retrieval omissions, stale indexes, access filtering and unsupported generations affect quality.

Case file

A worked decision

A field-support assistant retrieves manuals by equipment revision and provides the selected passages to its answer generator.

Change the condition

For an exact serial-number lookup, return the authoritative database value directly.

Check the decision

When the correct revision is absent, does the assistant expose the evidence gap or invent instructions?

Relationships

Catalog note · Can use: Data lake for source documents

Sources

Network intermediary role

Reverse Proxy

Expose an intermediary as the client-facing origin and forward requests to backends.

FamilyNetwork architecture and protocols
ScopeServer / inbound network boundary
Editorial statusDraft

What it buys

Operators can drain or replace origins while clients retain one public endpoint.

Apply when

Multiple backend services need one entry point, routing layer or TLS endpoint.

Reconsider when

A single directly reachable service has no policy, routing or isolation requirement.

Costs and failure modes

Header forwarding and origin trust can become security-sensitive.

Case file

A worked decision

A public download address fronts several origin servers and routes requests during origin maintenance.

Change the condition

If one origin directly meets security and traffic requirements, serve from that origin.

Check the decision

When an origin is drained, does the proxy stop directing new downloads to it?

Relationships

Catalog note · Contrast: Forward Proxy acts on behalf of clients.

Referenced by other entries (3)

Sources

Bounded data structure

Ring Buffer

Reuse a fixed circular region and advance producer and consumer positions.

FamilySynchronization and memory
ScopeProcess / kernel event transport
Editorial statusDraft

What it buys

A fixed-capacity queue gives a predictable storage budget and avoids allocating per enqueue.

Apply when

High-rate event transport needs bounded memory and reusable slots.

Reconsider when

Every item must survive arbitrary consumer lag and producers cannot block.

Costs and failure modes

When capacity is exhausted the design must reject, block or overwrite according to policy.

Case file

A worked decision

An audio callback consumes frames from a preallocated single-producer, single-consumer ring populated by a decoder.

Change the condition

If the application must retain every frame through arbitrary stalls, choose storage that can spill or block upstream.

Check the decision

What happens when the producer catches the consumer index?

Relationships

Catalog note · Complements: Deferred Interrupt Handling can use a ring for event handoff.

Referenced by other entries (1)

Sources

Authorization model

Role-based access control

Grant permissions to roles and assign roles to subjects.

FamilySecurity architecture
ScopeApplication or organization
Editorial statusDraft

Also indexed as · RBAC

What it buys

Permission review can focus on stable job responsibilities instead of numerous individual grants.

Apply when

Stable job functions share repeatable permission sets.

Reconsider when

Resource attributes and dynamic context dominate access decisions.

Costs and failure modes

Role proliferation and stale assignments obscure effective access.

Case file

A worked decision

A support desk grants refund approval to the supervisor role and reviews role assignments quarterly.

Change the condition

If access depends on each ticket's ownership and region, attributes or per-resource checks avoid a role per combination.

Check the decision

Can a transferred employee retain an obsolete refund-approval role?

Relationships

Catalog note · Alternative or complement: Attribute-based access control

Referenced by other entries (2)

Sources

Release pattern

Rolling update

Replace old instances in batches while keeping a serving population.

FamilyRelease architecture
ScopeReplica fleet
Editorial statusDraft

What it buys

A service can replace replicas gradually while continuing to serve through compatible remaining instances.

Apply when

Several replicas can run compatible versions during a rollout.

Reconsider when

Old and new protocols or data formats cannot coexist safely.

Costs and failure modes

Mixed versions and partially completed rollouts complicate diagnosis.

Case file

A worked decision

A catalog service replaces two replicas at a time and waits for readiness before exchanging the next batch.

Change the condition

If the wire protocol cannot support mixed versions, isolate parallel environments and plan the cutover.

Check the decision

At the minimum healthy replica count, can the fleet still handle peak requests?

Relationships

Catalog note · Complements: Expand and contract

Referenced by other entries (2)

Sources

Integration pattern

Routing Slip

Attach the remaining route to a message so each stage can forward it independently.

FamilyMessage routing
ScopeIntegration workflow
Editorial statusDraft

What it buys

Two items can follow different prescribed processing routes while each station needs to understand only its own step and how to pass the item on.

Apply when

Each request needs a different but knowable sequence of processing stages.

Reconsider when

The next step depends on unanticipated outcomes, human decisions or parallel branches.

Costs and failure modes

Changing a running itinerary and identifying failed stages become harder.

Case file

A worked decision

Each equipment return needs a different ordered subset of inspection, calibration and cleaning steps determined at intake.

Change the condition

If every return follows the same three stations, encode a fixed pipeline.

Check the decision

Can a station retry without advancing the slip past an unfinished operation?

Relationships

Catalog note · Alternative to Process Manager for per-message sequential routes.

Referenced by other entries (1)

Sources

Architecture pattern

Saga

Coordinate a series of local commits, with business-specific compensations or forward recovery for failures.

FamilyWorkflow coordination
ScopeBusiness process
Editorial statusDraft

What it buys

Services can complete a multi-step business operation using local commits and explicit recovery actions without holding one distributed transaction open.

Apply when

A long-lived business transaction spans independently owned resources.

Reconsider when

One short database transaction already covers the invariant.

Costs and failure modes

Intermediate states are visible. Some real-world effects cannot be undone.

Case file

A worked decision

A marketplace reservation spans inventory and payment services that can reverse holds after partial success.

Change the condition

If both resources share a database and owner, reserve them in one local transaction.

Check the decision

What state does the customer see when releasing an inventory hold itself fails?

Relationships

Catalog note · Can use Choreography or a Process Manager.

Referenced by other entries (2)

Sources

Coordination pattern

Saga Orchestration

Persist a saga’s progress in an orchestrator that commands local transactions and chooses recovery steps.

FamilyWorkflow coordination
ScopeBusiness process
Editorial statusDraft

What it buys

One coordinator can show which local transaction succeeded, which compensation it requested and what remains unresolved.

Apply when

Compensation, timeouts and branching need one inspectable business workflow.

Reconsider when

A handful of independent reactions can be expressed and operated through events.

Costs and failure modes

The orchestration state becomes a dependency and issuing each command must tolerate retries.

Case file

A worked decision

An order coordinator records the current reservation step and explicitly commands release when payment fails.

Change the condition

If two independent consumers only observe order completion, publish that event directly.

Check the decision

When the coordinator restarts after sending release, can it determine what remains outstanding?

Relationships

Catalog note · Specializes Saga with a Process Manager as coordinator.

Referenced by other entries (3)

Study this decision

Sources

Integration pattern

Scatter–Gather

Fan a request out to several recipients and collect useful responses.

FamilyMessage routing
ScopeDistributed request
Editorial statusDraft

What it buys

A caller can compare several independent offers within one decision window and account explicitly for providers that did not answer.

Apply when

A quote requires offers from several suppliers within a deadline.

Reconsider when

One identified authority owns the answer.

Costs and failure modes

Latency follows slow responders unless the caller can accept a partial result.

Case file

A worked decision

A fare broker queries eligible carriers concurrently and compares the quotes received by a booking deadline.

Change the condition

If one carrier owns the route, make one request.

Check the decision

Does a late low quote change a fare already offered to a passenger?

Relationships

Catalog note · Uses Aggregator to assemble replies.

Referenced by other entries (1)

Sources

Lifetime idiom

Scoped Locking

Bind lock release to scope exit, including early returns and exceptions.

FamilySynchronization and memory
ScopeCode block / critical section
Editorial statusDraft

What it buys

Releasing the lock follows scope exit, including early returns and exception unwinding.

Apply when

A lock should be held for a well-defined synchronous lexical region.

Reconsider when

Ownership must cross threads or outlive the scope.

Costs and failure modes

A large lexical scope can hold a lock across expensive work.

Case file

A worked decision

A ledger function binds its account mutex to a lexical guard so an exception releases it on exit.

Change the condition

When one actor exclusively owns the account, sending it a message removes the shared critical section.

Check the decision

Does any call inside the guard wait on I/O while other callers need the same lock?

Relationships

Catalog note · Specializes: scope-bound resource management.

Referenced by other entries (3)

Sources

Availability pattern

Self-contained Service

Arrange local data and processing so the critical request path avoids synchronous downstream dependencies.

FamilyService architecture
ScopeSynchronous service request path
Editorial statusDraft

What it buys

A request can complete from local state while a downstream service is temporarily unavailable, within the agreed freshness limit.

Apply when

Availability or latency budgets cannot tolerate the combined risk of a dependency chain.

Reconsider when

A decision requires fresh authoritative remote data that cannot safely be replicated.

Costs and failure modes

Local projections, lag and reconciliation must be managed.

Case file

A worked decision

A fulfillment service keeps a local copy of shipping eligibility rules from its supplier, allowing dispatch while the supplier's API is temporarily unavailable.

Change the condition

If dispatch requires the supplier's authorization at that instant, a local copy cannot replace the synchronous decision.

Check the decision

Disconnect the supplier and check the oldest rule version the service will act on.

Relationships

Catalog note · Can use: Materialized View

Sources

Legacy process idiom

Self-Daemonization

The program detaches itself and takes responsibility for its background lifecycle.

FamilyDaemon lifecycle and supervision
ScopeUnix process / terminal session
Editorial statusDraft

What it buys

On a legacy host without a service manager, a long-running process can outlive the login session that launched it.

Apply when

An existing SysV-style caller requires the traditional daemon contract.

Reconsider when

A modern supervisor expects to track the foreground main process.

Costs and failure modes

Forks and PID files complicate readiness, signal delivery and detection of failures.

Case file

A worked decision

A legacy Unix host starts a collector from a login shell and requires it to detach from the controlling terminal and redirect standard streams.

Change the condition

If a service manager owns the process, keep the collector in the foreground.

Check the decision

After the launching shell exits, does the detached collector persist with valid logging and file descriptors?

Relationships

Catalog note · Alternative: Supervised Foreground Service.

Referenced by other entries (1)

Sources

Relational operation

Semijoin / existence test

Retain an outer row when at least one matching inner row exists.

FamilyRelational operations and invariants
ScopeRelation, query or database boundary
Editorial statusDraft

Also indexed as · EXISTS, semi-join

What it buys

A qualifying outer row appears once even when several related records satisfy the same condition.

Apply when

The consumer wants qualifying parents without the matching children's columns.

Reconsider when

The caller needs the actual child values or the count of matches.

Costs and failure modes

Misplaced correlation conditions can turn a per-parent check into an unrelated global test.

Case file

A worked decision

List customers who have at least one past-due invoice. Three such invoices still produce one qualifying customer row.

Change the condition

If the collector needs each overdue invoice and amount, return the matched rows instead.

Check the decision

Does adding a second matching invoice duplicate the customer's result row?

Relationships

Referenced by other entries (1)

Study this decision

Sources

Strategic design pattern

Separate Ways

Allow contexts to solve their needs independently where integrating offers little return.

FamilyDomain boundaries
ScopeInter-context choice
Editorial statusDraft

What it buys

One team can deliver a local solution without waiting for a cross-team interface whose coordination would outweigh its value.

Apply when

Sharing a small capability would cost more than duplicating it locally.

Reconsider when

A common legally binding record or cross-context workflow requires coordination.

Costs and failure modes

Duplicate work and divergent behavior can accumulate.

Case file

A worked decision

A theatre's reservation system and payroll tool independently maintain their holiday lists. Sharing a library would save little and would couple a public booking release to payroll changes.

Change the condition

If both lists become the authoritative basis for contractual pay calculations, divergence may justify a shared governance boundary.

Check the decision

Introduce a holiday applying only to seasonal staff and check whether public booking behavior ought to change.

Relationships

Catalog note · Alternative: Shared Kernel

Referenced by other entries (1)

Sources

Synchronization mechanism

Sequence Lock

Writers mark changes with a sequence value; readers retry an inconsistent snapshot.

FamilySynchronization and memory
ScopeShared memory / reader snapshot
Editorial statusDraft

What it buys

A reader can obtain a consistent snapshot of several fields without taking the writer's lock when retries are affordable.

Apply when

Readers copy a small state while writes are brief and infrequent.

Reconsider when

Readers must follow unstable pointers or writes could starve readers.

Costs and failure modes

A preempted writer or a write burst can cause repeated reader retries.

Case file

A worked decision

A timekeeper publishes a pair of scalar counters using its platform's sequence-lock primitives. Readers copy both fields and retry if the sequence value changed or was odd.

Change the condition

If readers may follow pointers to reclaimed objects, use lifetime protection such as RCU.

Check the decision

Can continuous writes starve a reader that needs a bounded response time?

Relationships

Catalog note · Alternative: Read-Copy-Update supports versioned pointer traversal with a lifetime protocol.

Referenced by other entries (1)

Sources

Discovery pattern

Server-Side Service Discovery

A router resolves live instances and forwards client requests.

FamilyService access and discovery
ScopeRouter and service fleet
Editorial statusDraft

What it buys

Clients that cannot follow endpoint changes can keep their existing address while the routing tier absorbs instance churn.

Apply when

Clients should use a stable endpoint across a heterogeneous fleet.

Reconsider when

A constrained latency budget or workload-specific balancing requires endpoint selection by clients.

Costs and failure modes

The routing tier adds capacity, availability and configuration obligations.

Case file

A worked decision

Legacy devices send telemetry to a stable address whose load balancer tracks changing collectors.

Change the condition

If a single fixed collector suffices, configure its address directly.

Check the decision

Can a device keep its configuration when every collector is replaced?

Relationships

Catalog note · Alternative to Client-Side Service Discovery.

Referenced by other entries (2)

Sources

Architectural approach

Serverless architecture

Compose managed services and optionally functions while the provider runs much of the infrastructure.

FamilyCloud infrastructure
ScopeApplication and managed services
Editorial statusDraft

What it buys

A small team can delegate substantial provisioning and operational work to managed services.

Apply when

Spiky demand and a small operations team justify managed execution and storage.

Reconsider when

Hard runtime, locality or portability constraints require direct control of infrastructure.

Costs and failure modes

Vendor integration, distributed tracing and unit pricing complicate evolution.

Case file

A worked decision

A call-center system combines managed queues, object storage, and on-demand workers to transcribe irregular bursts of calls.

Change the condition

If workloads require privileged long-running processes, use a managed container or VM for that component.

Check the decision

Which quota first blocks end-to-end processing during a backlog surge?

Relationships

Catalog note · Can include: Function as a Service

Referenced by other entries (2)

Sources

Application boundary pattern

Service Layer

Provide application operations that coordinate domain behavior and transaction boundaries.

FamilyEnterprise application
ScopeUse-case interface
Editorial statusDraft

What it buys

A CLI and a web endpoint can invoke the same business operation with the same transaction and orchestration rules.

Apply when

Several clients need identical use-case orchestration or transaction policy.

Reconsider when

One delivery adapter calls a single simple domain operation directly.

Costs and failure modes

Pass-through wrappers proliferate or domain rules migrate into a giant service.

Case file

A worked decision

A customer-support portal and a nightly fraud job both need to freeze accounts. A service-layer operation loads the account, invokes the rule and commits an audit record in the same unit of work.

Change the condition

If a program has a single trivial caller that only reads a record, a pass-through service adds another stop to trace.

Check the decision

Can both entry points obtain the same authorization, transaction and audit behavior from one operation?

Relationships

Catalog note · Uses: Domain Model or Transaction Script

Referenced by other entries (1)

Sources

Infrastructure architecture

Service mesh

A data plane manages service traffic under a common control plane.

FamilyCloud infrastructure
ScopeInterservice network
Editorial statusDraft

What it buys

Traffic rules and service-to-service telemetry can be applied across applications using different languages.

Apply when

Many services need consistent traffic policy, workload identity and telemetry.

Reconsider when

A few services can configure clients and telemetry directly.

Costs and failure modes

Proxies, control-plane rollout and configuration introduce new failure modes.

Case file

A worked decision

A platform routes service traffic through a mesh to apply workload identity and telemetry across dozens of applications.

Change the condition

For two services with one runtime, built-in TLS and tracing can cover the requirement.

Check the decision

Can operators isolate a mesh policy failure from an application failure?

Relationships

Catalog note · Can use: Sidecar

Sources

Architecture pattern

Service Registry

Maintain the locations and health-related metadata of discoverable service instances.

FamilyService access and discovery
ScopeService fleet
Editorial statusDraft

What it buys

New instances can become discoverable without editing a separate endpoint list in each client.

Apply when

Instances move or scale too often for static endpoint configuration.

Reconsider when

A few permanent endpoints and platform DNS already provide the required mapping.

Costs and failure modes

Stale registrations or registry unavailability can disrupt routing.

Case file

A worked decision

Short-lived rendering workers register an endpoint and renew its membership while available.

Change the condition

If workers have stable addresses and rarely move, use a configuration list.

Check the decision

When a worker disappears without deregistering, when does discovery stop advertising it?

Relationships

Catalog note · Supports Client-Side Service Discovery and Server-Side Service Discovery.

Referenced by other entries (1)

Sources

Liveness mechanism

Service Watchdog

A running service periodically signals progress to a watchdog with a deadline.

FamilyDaemon lifecycle and supervision
ScopeDaemon / service manager
Editorial statusDraft

What it buys

A manager can initiate recovery from loss of event-loop progress even when the operating system still reports a live process.

Apply when

A daemon may hang indefinitely while its process stays alive.

Reconsider when

Health depends on a slow external system that restarts cannot repair.

Costs and failure modes

A heartbeat thread can mask deadlock elsewhere; tight deadlines cause restart loops.

Case file

A worked decision

A telemetry daemon sends periodic watchdog notifications from its event loop so its manager can restart a wedged loop.

Change the condition

If the daemon always exits on failure and hangs are outside the fault model, rely on ordinary exit supervision.

Check the decision

Does a deliberately blocked event loop stop watchdog updates even if a helper thread is alive?

Relationships

Catalog note · Complements: Supervision Tree gives failures a recovery owner.

Referenced by other entries (1)

Study this decision

Sources

Architectural style

Service-Based Architecture

Deploy a small number of coarse-grained business services behind a UI, optionally retaining a shared database.

FamilyService architecture
ScopeApplication and domain services
Editorial statusDraft

What it buys

A business unit can release or scale a large cohesive capability while keeping most of its internal calls in process.

Apply when

Distinct domain areas need separate deployment while workflows still benefit from local transactions inside each service.

Reconsider when

All work belongs to one release or small sub-capabilities truly need independent ownership and scaling.

Costs and failure modes

Services remain coarse scaling units and shared-schema changes may require coordinated releases.

Case file

A worked decision

A publishing company deploys editorial, subscriptions and distribution as a few coarse services. Each groups operations usually changed and released together.

Change the condition

If one subscription function alone has a materially different scale profile and a clear owner, it may deserve a narrower boundary.

Check the decision

Count independent feature releases blocked on deploying another coarse service.

Relationships

Catalog note · Alternative: Microservice Architecture

Sources

Architectural approach

Service-Oriented Architecture

Expose capabilities via services with explicit descriptions, contracts and interaction policies.

FamilyService architecture
ScopeCapabilities across ownership boundaries
Editorial statusDraft

What it buys

Several business processes can consume the same capability and rely on a documented interaction contract across platforms.

Apply when

Independent parties need to access reusable capabilities across technology or ownership boundaries.

Reconsider when

All behavior changes and deploys together and a local interface suffices.

Costs and failure modes

Contract governance, service discovery and ownership coordination add cost.

Case file

A worked decision

Three public agencies offer address verification through a documented contract with explicit owners and usage policies. A new licensing system consumes the shared capability.

Change the condition

A calculation used solely in one application needs no organizational service contract.

Check the decision

Can a new agency integrate through the documented policy and interface without gaining access to internal records?

Relationships

Catalog note · Related: Microservice Architecture

Referenced by other entries (2)

Sources

Relational operation

Set-based join

Match rows by a relation and express the complete result as a query.

FamilyRelational operations and invariants
ScopeRelation, query or database boundary
Editorial statusDraft

What it buys

The query planner can choose how to match indexed or scanned inputs without the application issuing a lookup for every outer row.

Apply when

A database can match many records in one operation and the required multiplicity is known.

Reconsider when

A one-to-many join duplicates a parent whose presence alone was required.

Costs and failure modes

Wrong join predicates or cardinality assumptions can multiply records and inflate sums.

Case file

A worked decision

A billing summary joins line items to their invoice by key before summing amounts at invoice grain.

Change the condition

If the product only asks whether an invoice has any overdue item, an existence predicate avoids duplicate parents.

Check the decision

Can one parent with two matching children change a total that should be counted once?

Relationships

Referenced by other entries (1)

Study this decision

Sources

Integration style

Shared Database Integration

Coordinate applications through tables and transactions in one database.

FamilyService data boundaries
ScopeMultiple applications
Editorial statusDraft

What it buys

Tightly governed components can enforce a genuinely shared invariant within one local transaction.

Apply when

Legacy participants must enforce a cross-application invariant in a shared transaction.

Reconsider when

Independent schema evolution and isolated capacity are essential.

Costs and failure modes

Schema changes and locks couple deployments and workloads.

Case file

A worked decision

Two tightly governed settlement components share tables to enforce a same-transaction ledger invariant during a staged migration.

Change the condition

If teams need independent schemas and settlement can cross a service contract, give each service ownership of its data.

Check the decision

Which consumers must change when a shared settlement column changes meaning?

Relationships

Catalog note · Alternative to Database per Service.

Sources

Strategic design pattern

Shared Kernel

Teams jointly own a deliberately small slice of model and implementation.

FamilyDomain boundaries
ScopeTwo collaborating contexts
Editorial statusDraft

What it buys

A jointly owned invariant can be specified and tested once across the teams that must implement it identically.

Apply when

Two teams genuinely agree on stable shared semantics and can coordinate changes.

Reconsider when

The teams need independent delivery or use superficially similar terms differently.

Costs and failure modes

Every shared change can force cross-team testing and negotiation.

Case file

A worked decision

Two divisions share a small versioned money-and-rounding model because invoices and settlements must reconcile to the cent. Changes require approval from both domain owners.

Change the condition

If each jurisdiction has legitimately different rounding rules, independently translated models avoid joint release negotiations.

Check the decision

Run both divisions' published rounding examples against a proposed kernel change before release.

Relationships

Catalog note · Alternative: Anti-Corruption Layer

Referenced by other entries (1)

Sources

Tenancy pattern

Shared multitenant database

Store several tenants together with a tenant key and enforced access controls.

FamilyMultitenancy
ScopeTenant data plane
Editorial statusDraft

What it buys

Small tenants can share spare capacity and one schema operation can update many of them.

Apply when

Small tenants share a schema and pooling capacity lowers cost.

Reconsider when

Independent tenant restore, hard isolation or divergent schemas are required.

Costs and failure modes

A missing tenant predicate or isolation policy can expose another tenant's data.

Case file

A worked decision

A scheduling service partitions shared appointment tables by tenant and validates tenant context on every read and write.

Change the condition

If a customer needs isolated restore or dedicated encryption and residency controls, evaluate separate storage.

Check the decision

Does every join, unique constraint, and cache key preserve tenant scope?

Relationships

Catalog note · Alternative: Database per tenant

Referenced by other entries (2)

Sources

Architectural style

Shared Repository Architecture

Independent components coordinate by reading and writing a common representation.

FamilyStructural architecture
ScopeSubsystems sharing data
Editorial statusDraft

Also indexed as · Repository architectural style

What it buys

A new analysis tool can consume another tool's results without a direct adapter between every pair of tools.

Apply when

Compilers or analysis tools must operate on the same evolving body of data.

Reconsider when

Participants require conflicting schemas, isolated failures or independent data ownership.

Costs and failure modes

The shared schema becomes a compatibility contract for every writer.

Case file

A worked decision

A chemical analysis suite lets a fitter, plotter and report writer share the same governed experiment model. A saved fit becomes available to the other tools without pairwise integrations.

Change the condition

If tools evolve independently and require incompatible representations, versioned messages may isolate them better.

Check the decision

Change the stored result format in a staging workspace and identify every tool that must migrate together.

Relationships

Catalog note · Specialized by: Blackboard

Referenced by other entries (1)

Sources

Deployment pattern

Sidecar

Co-locate a helper with an application and give the pair related lifecycles.

FamilyCloud infrastructure
ScopeProcess or container group
Editorial statusDraft

What it buys

Support functionality can be released or isolated alongside an application without being compiled into it.

Apply when

Logging, networking or security support must be reused across different runtimes.

Reconsider when

An inexpensive in-process library already fits the same release boundary.

Costs and failure modes

Each replica carries extra resources and another startup or shutdown dependency.

Case file

A worked decision

A rendering process emits a legacy log format and a colocated helper translates and ships it independently.

Change the condition

If the platform collector already parses that format, reuse it to avoid a helper per replica.

Check the decision

Are resource requests sufficient when both renderer and helper peak together?

Relationships

Catalog note · Can host: Ambassador

Referenced by other entries (2)

Sources

Hardware execution model

Single Instruction, Multiple Threads (SIMT)

Schedule groups of logical threads together on common instructions while allowing thread-local state.

FamilyParallel and scientific computing
ScopeGPU / execution lanes
Editorial statusDraft

What it buys

Uniform numeric work across many elements can exploit hardware designed to execute groups of lanes together.

Apply when

Large batches have similar control flow and coalescible memory access.

Reconsider when

Divergent paths, irregular memory or transfer overhead dominate useful work.

Costs and failure modes

Branch divergence can serialize paths, and sparse accesses waste bandwidth.

Case file

A worked decision

A GPU kernel assigns a pixel to each lane and applies the same color transform to adjacent pixels.

Change the condition

For a branch-heavy parser with unrelated control paths, a CPU worker pool may use resources better.

Check the decision

Do measurements show divergence or uncoalesced memory access dominating kernel time?

Relationships

Catalog note · Implements: Data Parallelism on suitable hardware.

Referenced by other entries (1)

Sources

Execution model

Single Program, Multiple Data (SPMD)

Each rank runs the same program on distinct data and may follow rank-specific branches.

FamilyParallel and scientific computing
ScopeWorker ranks / parallel program
Editorial statusDraft

What it buys

One program can express a parallel algorithm while ranks operate on different local partitions.

Apply when

A distributed problem has similar control logic on each partition.

Reconsider when

Independent roles require different programs and evolution schedules.

Costs and failure modes

Divergent branches around collective calls can deadlock peers.

Case file

A worked decision

Ocean-model ranks run the same executable, derive their own subdomain, and exchange boundaries with the appropriate neighbors.

Change the condition

For a small task with distinct long-lived server and client roles, separate programs can express the topology more directly.

Check the decision

Do rank-conditional paths still enter compatible communication operations in the same order?

Relationships

Catalog note · Complements: Data Parallelism; SPMD does not require instruction lockstep.

Referenced by other entries (2)

Sources

Concurrency pattern

Single-writer ownership

Serialize mutations to a state partition through a single owner.

FamilyConcurrency boundaries
ScopeTask, process or partition
Editorial statusDraft

What it buys

Related updates within one owned partition can maintain their invariants without coordinating several competing writers through locks.

Apply when

Operations contend over the same mutable state and can be submitted to one sequencer.

Reconsider when

One owner cannot sustain the mutation rate for this partition, or operations genuinely require coordination across multiple owners.

Costs and failure modes

The owner becomes a sequencing bottleneck and an unavailable owner stalls its partition.

Case file

A worked decision

One matching-engine shard owns an instrument's order book and applies submitted updates in order.

Change the condition

If the only shared update is a commutative trade count, an atomic counter can replace an instrument-wide command sequencer.

Check the decision

Who owns recovery and ordering if the single writer fails after acknowledging a command?

Relationships

Study this decision

Sources

Object-oriented design pattern

Singleton

Let a type control the creation of one instance and expose access to it.

FamilyGoF · Creational
ScopeInstance lifetime within a runtime
Editorial statusDraft

What it buys

A genuinely process-wide coordinator can have a single initialization and ownership point.

Apply when

A resource truly must have a single owner within that runtime and the lifetime is explicit.

Reconsider when

Only convenient access is needed or tests and multiple tenants require independent instances.

Costs and failure modes

Hidden dependencies, shared mutation and shutdown ordering make isolation difficult.

Case file

A worked decision

A plugin host exposes one process-wide registry because competing registrations must resolve through one arbitration point.

Change the condition

If multiple independent hosts must coexist in one test process, give each host an explicitly owned registry.

Check the decision

Does the required uniqueness scope end at a host, process, or cluster boundary?

Relationships

Catalog note · Alternative for ownership: Dependency Injection

Referenced by other entries (1)

Sources

Service activation pattern

Socket Activation

A manager owns a listening socket and passes it to an activated service.

FamilyDaemon lifecycle and supervision
ScopeOS socket / process startup
Editorial statusDraft

What it buys

A manager-owned listener can accept connection attempts while the service is starting, within the socket backlog and client timeout limits.

Apply when

An infrequently used service should start on demand or retain its listener across restarts.

Reconsider when

Startup latency is unacceptable or the process cannot accept inherited descriptors.

Costs and failure modes

An accepted or in-flight request can still fail during a restart.

Case file

A worked decision

A service manager holds an infrequently used diagnostics socket and launches the handler on demand with the inherited listener.

Change the condition

If the handler already runs continuously with negligible startup cost, bind its own listener.

Check the decision

Can the first diagnostics request survive the time between socket readiness and worker startup?

Relationships

Catalog note · Complements: Supervised Foreground Service.

Study this decision

Sources

Architectural approach

Software-defined networking

Separate programmable decisions about forwarding from devices that forward packets.

FamilyNetwork architecture
ScopeNetwork control and forwarding
Editorial statusDraft

What it buys

Operators can express network-wide forwarding policy centrally and propagate rules to switches without configuring each one independently.

Apply when

Policy must be changed consistently across a large heterogeneous network.

Reconsider when

A small stable network is readily managed with native device policies.

Costs and failure modes

Controller reachability and safe policy propagation affect a large blast radius.

Case file

A worked decision

A campus network changes tenant isolation rules frequently and programs forwarding devices from a control system with a network-wide policy view.

Change the condition

If one router serves a stable subnet, use its static local configuration.

Check the decision

When the controller is unreachable, which flows continue and which new flows fail?

Relationships

Catalog note · Can support: Service mesh at a different network layer

Sources

Architectural style

Space-based architecture

Keep working data and processing together in an in-memory grid of processing units.

FamilyStateful architecture
ScopeDistributed application
Editorial statusDraft

Also indexed as · Space-based architectural style

What it buys

Partition-local processing can relieve a shared database bottleneck on a high-volume request path.

Apply when

Bursty transactional workloads hit a shared database bottleneck and state can be partitioned.

Reconsider when

Durability or cross-partition constraints dominate and an ordinary database meets latency goals.

Costs and failure modes

Consistency, persistence and grid recovery become explicit design duties.

Case file

A worked decision

A ticket exchange partitions active offers by venue into processing units with local working state. Each unit can match orders without repeatedly fetching each offer from a central store.

Change the condition

If one authoritative database already handles the burst and matches frequently span venues, keep the centralized transaction.

Check the decision

Fail a processing unit mid-match and verify the recovered offer, reservation and durable sale agree.

Relationships

Catalog note · Related: Cell-based architecture

Sources

Model architecture

Sparse mixture of experts

Route each input token to a subset of expert subnetworks.

FamilyML and AI systems
ScopeModel and compute cluster
Editorial statusDraft

What it buys

A token can use a selected subset of experts, increasing model capacity without activating every expert for each input.

Apply when

Conditional computation can expand parameter capacity within a limited per-token compute budget.

Reconsider when

A dense model meets quality and latency targets with simpler deployment.

Costs and failure modes

Load imbalance and inter-device traffic can erase the expected gain.

Case file

A worked decision

A multilingual prediction service routes each token to a small subset of learned experts under a bounded expert-capacity policy.

Change the condition

If the dense baseline already meets quality and serving constraints, switching experts introduces avoidable routing complexity.

Check the decision

Which languages or token groups overflow expert capacity at peak batch size?

Relationships

Catalog note · Can use: Data Parallelism

Sources

Data-organization pattern

Spatial Partition

Index objects by location so neighborhood queries examine a limited region.

FamilyGame and simulation architecture
ScopeWorld model / spatial queries
Editorial statusDraft

What it buys

A collision or proximity query can skip distant objects before running expensive intersection tests.

Apply when

Collision or proximity lookups dominate scans in a populated scene.

Reconsider when

Small object counts or highly volatile positions make index upkeep more expensive than scanning.

Costs and failure modes

Moving objects require index maintenance; skew can overload a region.

Case file

A worked decision

A drone simulator places obstacles into grid cells so a drone checks nearby candidates instead of every obstacle. A moving obstacle updates its occupied cells.

Change the condition

For a test map with a handful of obstacles, a linear scan is simpler and may already meet the frame budget.

Check the decision

Repeat proximity queries while moving an obstacle across a cell boundary and compare the candidates against a full scan.

Relationships

Catalog note · Alternative: linear scanning for small populations.

Sources

Refactoring

Split phase

Separate a transformation into stages with an explicit intermediate representation.

FamilyControl flow and decomposition
ScopeExpression, function or module
Editorial statusDraft

What it buys

The result of parsing or preparation can be inspected and tested before the next phase applies business decisions.

Apply when

Parsing, validation or planning changes for different reasons from execution.

Reconsider when

The intermediate record would only rename a value that is already clear.

Costs and failure modes

The intermediate format creates its own contract and can retain more input in memory.

Case file

A worked decision

A payroll importer first parses a complete row into a typed candidate, then validates it against payroll rules. A new delimiter changes only parsing.

Change the condition

A fixed two-column internal file with one rule may be easier to read in one loop.

Check the decision

Can the rules be tested from a candidate without creating a physical file?

Relationships

Sources

Integration pattern

Splitter

Turn one composite input into a sequence of separately processable messages.

FamilyMessage routing
ScopeIntegration flow
Editorial statusDraft

What it buys

Large manifests can make progress item by item, with failures and retries attributed to the affected item.

Apply when

Line items need independent validation or parallel enrichment.

Reconsider when

The complete input must change atomically in one transaction.

Costs and failure modes

Partial progress complicates error handling and tracking.

Case file

A worked decision

A wholesaler receives one manifest whose pallets need independent warehouse assignments.

Change the condition

If the shipment must stay intact, assign the manifest as a unit.

Check the decision

Can operators trace a rejected pallet back to its manifest and position?

Relationships

Catalog note · Composes with Aggregator if an order-level result is required.

Sources

Object-oriented design pattern

State

Delegate state-sensitive behavior to a state object and switch that delegate on transitions.

FamilyGoF · Behavioral
ScopeState-dependent object behavior
Editorial statusDraft

What it buys

A change to one state's behavior can be localized when state-specific conditionals have spread across operations.

Apply when

Several operations branch on the same evolving lifecycle state.

Reconsider when

A small fixed transition table or an enumerated state and switch is clearer.

Costs and failure modes

Distributed transition logic can obscure legal transitions and grows the number of types.

Case file

A worked decision

A parcel permits rerouting before dispatch, then switches to a transit state that enforces different actions.

Change the condition

For a small stable transition table with little state-specific behavior, a tagged value and table are clearer.

Check the decision

Can the delivered state perform a transition that the shipping policy forbids?

Relationships

Catalog note · Alternative representation: Finite-State Machine transition table

Referenced by other entries (3)

Sources

Process design approach

Stateless application processes

Keep durable request or session state in a backing service so instances can be replaced.

FamilyCloud infrastructure
ScopeApplication fleet
Editorial statusDraft

What it buys

Instances can be replaced or scaled without keeping a client tied to one instance's memory.

Apply when

Requests must move freely among replicas during failures or scaling.

Reconsider when

Local authoritative state or strict data locality determines performance.

Costs and failure modes

Backing services become availability dependencies and remote state access adds latency.

Case file

A worked decision

A checkout frontend stores carts outside its workers so any replica can resume the next request after a rollout.

Change the condition

When a long-lived simulation depends on large local state, explicitly assigning a stateful owner can avoid constant serialization.

Check the decision

Does killing a replica mid-session lose a cart or duplicate its submission?

Relationships

Catalog note · Supports: Rolling update

Sources

Delivery pattern

Static content hosting

Serve static assets directly from object storage or an edge cache.

FamilyCloud infrastructure
ScopeClient and edge
Editorial statusDraft

What it buys

Edge or object storage can deliver assets without using application workers for unchanged bytes.

Apply when

Asset traffic consumes application capacity without requiring dynamic processing.

Reconsider when

Every response requires per-user generation or access controls the edge cannot enforce.

Costs and failure modes

Cache invalidation, versioned assets and authorization require care.

Case file

A worked decision

A museum publishes versioned exhibition pages and images to object storage behind a CDN.

Change the condition

For visitor-specific admission entitlements, generate the protected response on an authenticated backend.

Check the decision

After publication, can an old cached page still retrieve its referenced assets?

Relationships

Catalog note · Can combine with: Valet Key

Sources

Migration pattern

Strangler Fig

Route behavior to new implementations in slices as the legacy footprint shrinks.

FamilyModernization
ScopeIncremental application replacement
Editorial statusDraft

What it buys

One customer journey can move to a replacement system while other journeys continue to run on the legacy system.

Apply when

A large system must remain operational and has separable entry points or responsibilities.

Reconsider when

A small replaceable system can be cut over simply or there is no interceptable seam.

Costs and failure modes

Coexistence, data ownership and retiring old pathways can outlast the rewrite.

Case file

A worked decision

An insurer moves claim-status reads off a legacy module ahead of claim submission. Route only status requests to the new implementation and preserve the old submission route.

Change the condition

If the legacy program runs once a month and can be replaced in one rehearsed cutover, incremental routing adds an unnecessary coexistence period.

Check the decision

After one migrated route fails, can it return to the old handler without losing claims written during coexistence?

Relationships

Catalog note · Complements: Anti-Corruption Layer

Referenced by other entries (1)

Study this decision

Sources

Design pattern

Strategized Locking

Select a component's synchronization implementation through a policy.

FamilySynchronization and memory
ScopeReusable component / synchronization
Editorial statusDraft

What it buys

A component with the same core algorithm can select a synchronization policy appropriate to each deployment.

Apply when

One tested component ships in both confined and shared environments.

Reconsider when

Every deployment has the same synchronization requirements.

Costs and failure modes

Choosing the wrong policy can silently remove required synchronization.

Case file

A worked decision

A reusable in-memory index accepts a mutex policy for shared use and a no-op policy for proven thread confinement.

Change the condition

With only one supported threading contract, a fixed lock makes misuse harder.

Check the decision

Can a thread-confined configuration escape into a shared request handler?

Relationships

Catalog note · Specializes: Strategy for locking.

Referenced by other entries (1)

Sources

Object-oriented design pattern

Strategy

Provide a collaborator implementing the chosen algorithm behind a common contract.

FamilyGoF · Behavioral
ScopeInterchangeable algorithm within an operation
Editorial statusDraft

What it buys

Callers can substitute a policy independently of the workflow that invokes it.

Apply when

The same business step needs independently selectable policies or algorithms.

Reconsider when

One stable algorithm exists or a small pure function parameter suffices.

Costs and failure modes

Additional policy types and selection logic may obscure a simple calculation.

Case file

A worked decision

A route planner receives a cost policy for shortest distance, lowest toll, or wheelchair access and reuses the same search engine.

Change the condition

When only one route objective exists, a fixed cost function avoids unnecessary configuration.

Check the decision

Does each policy satisfy the search algorithm's assumptions about edge costs?

Relationships

Catalog note · Functional realization: Higher-Order Function

Referenced by other entries (8)

Study this decision

Runnable labs

Sources

Protocol mechanism

Stream Multiplexing

Carry independently identified logical streams on one connection.

FamilyNetwork architecture and protocols
ScopeTransport connection
Editorial statusDraft

What it buys

Independent exchanges can share an authenticated connection without setting up a new transport for each logical stream.

Apply when

Many concurrent exchanges can reuse a transport connection and its setup.

Reconsider when

Flows need independent failure boundaries or strict physical isolation.

Costs and failure modes

Streams still share some connection-wide limits and failure modes.

Case file

A worked decision

A remote IDE interleaves diagnostics, terminal output and document updates over one authenticated connection.

Change the condition

If the client sends only a single uninterrupted file, use one plain stream.

Check the decision

Can a stalled terminal stream monopolize connection-level capacity needed by document edits?

Relationships

Catalog note · Complements: Credit-Based Flow Control at stream and connection scope.

Sources

Program structure

Structural recursion

Define a result from smaller parts of the input structure and explicit base cases.

FamilyFunctional transformations and evaluation
ScopeValue, collection or function
Editorial statusDraft

What it buys

A tree algorithm can express one local rule for leaves and another for branches without maintaining its own traversal stack in the source code.

Apply when

Input is inductively shaped, such as a tree, and each branch naturally recurses on children.

Reconsider when

A deep or cyclic graph requires explicit visited state, stack limits or iteration.

Costs and failure modes

Unbounded depth can exhaust the stack. Shared subtrees may be recomputed.

Case file

A worked decision

Compute a document outline by visiting each section and recursively processing its subsections.

Change the condition

If a link can point to an ancestor, use a graph traversal with a visited set.

Check the decision

What makes the input strictly smaller on every recursive edge?

Relationships

Sources

Data layout

Structure of arrays

Store each field of a collection in its own contiguous array.

FamilyData layout and locality
ScopeIn-memory data and hot loop
Editorial statusDraft

Also indexed as · SoA, column-oriented memory layout

What it buys

A loop that reads only one field can use a greater share of each fetched cache line for values it actually consumes.

Apply when

A measured hot loop processes a few fields across many elements and benefits from locality or vectorization.

Reconsider when

Updates frequently walk every field of one element and object coherence dominates.

Costs and failure modes

Fields must stay aligned by index. Insertions and cross-field edits become more complex.

Case file

A worked decision

A simulator updates all particle positions and velocities each frame while rarely reading their metadata.

Change the condition

A form edits one particle's entire record at a time. An array of records is simpler.

Check the decision

With a representative workload, do cache behavior and frame time actually improve after changing layout?

Relationships

Study this decision

Sources

Concurrency model

Structured concurrency

Keep spawned tasks within an owning scope that joins or cancels them according to an explicit policy.

FamilyConcurrency boundaries
ScopeTask, process or partition
Editorial statusDraft

What it buys

A parent operation can account for its child tasks at exit, reducing abandoned work after cancellation or failure.

Apply when

Concurrent subrequests serve one parent operation and must not leak after it finishes.

Reconsider when

The task is a durable job meant to continue after the initiating request or process exits.

Costs and failure modes

Cancellation remains cooperative and cleanup or simultaneous failures still need handling.

Case file

A worked decision

A product page fetches price and stock as child tasks in a request-owned scope. The HTTP handler forwards cancellation to the scope and waits for both tasks to finish cleanup.

Change the condition

An accepted video-transcoding job must survive the parent request. Persist it for a worker instead.

Check the decision

When one lookup fails or the client disconnects, which tasks remain alive after the scope closes?

Relationships

Sources

Workflow pattern

Structured Discriminator

Let the first finishing branch trigger the continuation once, then consume remaining completions before resetting.

FamilyWorkflow control flow
ScopeBusiness process instance
Editorial statusDraft

What it buys

A process that can accept any one valid response can continue as soon as the first arrives without starting a second continuation for later replies.

Apply when

Any one of several concurrently running checks suffices to advance a case.

Reconsider when

All answers or a specified number of approvals are required, or unfinished work must be cancelled immediately.

Costs and failure modes

Remaining branches still consume resources and complete after the decision. Reentry before reset breaks the structure.

Case file

A worked decision

A dispatch workflow pages three response desks and proceeds on the first response while the remaining branches finish without triggering dispatch again.

Change the condition

If every desk must approve, wait for all three.

Check the decision

Does the second desk response start another dispatch before the group resets?

Relationships

Catalog note · Contrasts with Parallel Split and Synchronization, which waits for every required completion.

Sources

Workflow pattern

Structured Synchronizing Merge

Join the branches actually selected by a matching earlier multi-choice, firing once per activation.

FamilyWorkflow control flow
ScopeBusiness process instance
Editorial statusDraft

What it buys

An instance waits for every review it requested and can still finish when other optional branches never started.

Apply when

A case launches a variable subset of optional checks, and all selected checks must finish.

Reconsider when

Every branch always starts, so a simple parallel join suffices.

Costs and failure modes

Unstructured loops, repeated activations or cancelled branches can invalidate the matching assumptions.

Case file

A worked decision

A permit requests environmental and fire reviews only when applicable, then waits for every review actually opened.

Change the condition

If both reviews are mandatory in every case, use a fixed parallel join.

Check the decision

Can a fire-only permit finish without waiting for an environmental review that never started?

Relationships

Catalog note · Refines Parallel Split and Synchronization for a selected subset of branches.

Referenced by other entries (1)

Sources

Polymorphism mechanism

Subtype polymorphism

Invoke an operation through a base contract whose concrete implementations supply behavior.

FamilyTypes and polymorphism
ScopeType or public contract
Editorial statusDraft

What it buys

A caller can operate on a base contract and accept a new conforming implementation without adding a type switch.

Apply when

New implementations should plug into a stable contract under independent ownership.

Reconsider when

All variants are closed and many new operations must inspect their data.

Costs and failure modes

Subtypes that weaken guarantees or require caller type checks undermine substitution.

Case file

A worked decision

A renderer accepts output devices that satisfy the same drawing contract. A new printer driver supplies the contract independently.

Change the condition

For three fixed shape variants with dozens of geometric queries, a sum type may localize the operations better.

Check the decision

Can every implementation pass the same behavioral contract tests?

Relationships

Sources

Type construction

Sum type / discriminated union

Represent a value as exactly one of a closed set of cases, each carrying its own data.

FamilyTypes and polymorphism
ScopeType or public contract
Editorial statusDraft

Also indexed as · Tagged union, discriminated union, sum type

What it buys

An approved result can carry its receipt while a rejected result carries its reason, eliminating meaningless combinations of flags and fields.

Apply when

The valid variants are known and different variants require different fields.

Reconsider when

Third-party plugins must add new cases without updating existing consumers.

Costs and failure modes

Adding a case requires revisiting operations that promise exhaustive coverage.

Case file

A worked decision

A transfer is Pending, Settled with a timestamp, or Rejected with a reason. The type rules out a settled transfer that has only a rejection reason.

Change the condition

If customers upload independently defined transfer types, use an open extension contract.

Check the decision

Can the representation express impossible combinations without bypassing its public constructor?

Relationships

Referenced by other entries (2)

Sources

Process-lifecycle pattern

Supervised Foreground Service

Keep the main process in the foreground and let a manager track it.

FamilyDaemon lifecycle and supervision
ScopeOS process / service manager
Editorial statusDraft

What it buys

The service manager can track the process it started, capture output and apply a consistent restart policy.

Apply when

The deployment platform owns restarts, logs and process identity.

Reconsider when

A legacy environment explicitly requires self-daemonization.

Costs and failure modes

Readiness and exit semantics must match the manager's contract.

Case file

A worked decision

A metrics exporter runs as a foreground process under a service manager that captures logs and restarts it on failure.

Change the condition

If the tool produces a one-off report and exits, run it as a job.

Check the decision

When the exporter crashes, does the manager identify its exit and restart the correct process?

Relationships

Catalog note · Alternative: Self-Daemonization.

Referenced by other entries (3)

Study this decision

Sources

Presentation pattern

Supervising Controller

Allow simple model-to-view binding while a controller handles complex presentation behavior.

FamilyPresentation architecture
ScopeUI boundary
Editorial statusDraft

What it buys

Simple fields can follow standard bindings while the controller handles the interactions that actually need imperative coordination.

Apply when

Bindings cover ordinary fields and selected interactions need explicit orchestration.

Reconsider when

All behavior must be testable outside the concrete view.

Costs and failure modes

Binding plus imperative updates can obscure which mechanism owns a field.

Case file

A worked decision

A product editor binds ordinary name and price fields directly. A supervising controller handles conditional promotion fields and validation that spans several widgets.

Change the condition

If a safety audit requires every visible state transition to be testable without a UI toolkit, move toward a passive view.

Check the decision

Verify that a simple price change needs no controller code but an invalid promotion produces the prescribed widget states.

Relationships

Catalog note · Variant of: Model–View–Presenter (MVP)

Referenced by other entries (1)

Sources

Fault-containment architecture

Supervision Tree

Assign a hierarchy of supervisors to start and recover subordinate workers.

FamilyDaemon lifecycle and supervision
ScopeRuntime processes / worker hierarchy
Editorial statusDraft

What it buys

Different subsystems can choose recovery boundaries that limit local failures and escalate repeated faults to an appropriate parent.

Apply when

Independent workers fail and need explicit recovery boundaries.

Reconsider when

A restart cannot reconstruct essential state or safely repeat in-flight effects.

Costs and failure modes

A badly chosen boundary turns one worker fault into a cascading restart.

Case file

A worked decision

A messaging node supervises independent client sessions below one branch and coupled persistence workers below another.

Change the condition

If a single worker owns the entire service, use one supervised process.

Check the decision

Does repeated failure in one session escalate only after its branch restart policy is exhausted?

Relationships

Catalog note · Specialized by: One-for-One, One-for-All and Rest-for-One supervision.

Referenced by other entries (2)

Sources

Dataflow computation model

Synchronous Dataflow

Assign fixed token consumption and production rates to every firing of each node.

FamilyDistributed coordination models
ScopeSignal-processing graph / stream pipeline
Editorial statusDraft

What it buys

Known token rates let the designer derive a repeating execution schedule and analyze buffer requirements before running the pipeline.

Apply when

A multirate signal-processing pipeline needs a predictable schedule and buffer sizes.

Reconsider when

Data-dependent stages produce unpredictable numbers of outputs.

Costs and failure modes

Changing stage rates may invalidate an analyzed schedule or buffer allocation.

Case file

A worked decision

An audio graph knows each filter's production and consumption rate, allowing a repeating firing schedule to be computed before playback.

Change the condition

If a parser emits a variable number of records, use a dynamically scheduled stream.

Check the decision

Over one schedule period, do token counts return each internal FIFO to its starting occupancy?

Relationships

Catalog note · Specializes: dataflow with known token rates; contrasts with general Kahn Process Network.

Referenced by other entries (1)

Study this decision

Sources

Systems architecture category

System of Systems

Coordinate independently useful systems through interfaces to deliver a larger capability.

FamilySpecialized architecture
ScopeOperationally and managerially independent systems
Editorial statusDraft

What it buys

Existing systems can contribute to a coordinated capability while remaining independently useful to their own users.

Apply when

Separate organizations retain operating authority but must interoperate toward a shared outcome.

Reconsider when

One owner can design, release and operate the components as a single system.

Costs and failure modes

Contract evolution, incentives and behavior across independent participants resist central control.

Case file

A worked decision

A regional emergency network coordinates ambulance dispatch, hospitals and traffic control. Each organization retains its own mission and can continue operating when the shared coordination platform is unavailable.

Change the condition

If one owner controls every component's requirements, release schedule and recovery, conventional system decomposition may suffice.

Check the decision

Disconnect one participant and verify both its independent mission and the coordination system's degraded operating policy.

Relationships

Catalog note · Contrast: Client–Server describes interaction roles rather than governance and autonomy.

Sources

Persistence pattern

Table Data Gateway

One gateway holds the database operations for a whole table or view.

FamilyEnterprise persistence
ScopeAccess to a table or view
Editorial statusDraft

What it buys

A column rename or database-specific query change can be handled at one access boundary for that table.

Apply when

SQL needs containment and callers already operate on record sets.

Reconsider when

Users need aggregate-level semantics spanning several tables.

Costs and failure modes

The schema surfaces in callers and table-at-a-time access can inflate round trips.

Case file

A worked decision

A ledger import has several callers that read and update one settlement table. A gateway centralizes the SQL used by all of them without assigning one persistence object per row.

Change the condition

For one short-lived report query with one caller, a named query may be sufficient.

Check the decision

Change the settlement column name and count the modules that require a SQL edit.

Relationships

Catalog note · Complements: Table Module

Referenced by other entries (1)

Sources

Domain logic pattern

Table Module

Place operations for all rows of one table in a single module.

FamilyEnterprise application
ScopeLogic for a set of records
Editorial statusDraft

What it buys

A calculation over an entire record set can live beside the other operations for that table without allocating an object per row.

Apply when

Calculations naturally work on tabular sets and identity-specific behavior is limited.

Reconsider when

Rich entity lifecycles span multiple tables and need individual behavior.

Costs and failure modes

Database structure can dominate business terminology and coupling.

Case file

A worked decision

A benefits administrator recalculates payroll deductions for rows in a pay-period dataset. A table module owns operations on that row set, keyed by employee number.

Change the condition

If each benefit election develops independent lifecycle rules and collaborators, a domain object can express behavior more directly.

Check the decision

Can a correction target the right rows for one pay period without creating an object graph per employee?

Relationships

Catalog note · Alternative: Domain Model

Referenced by other entries (1)

Sources

Execution architecture

Task Dependency Graph

Represent tasks and dependencies as a graph. In a DAG, the runtime or batch scheduler releases ready tasks as predecessors finish.

FamilyParallel and scientific computing
ScopeParallel runtime or batch workflow scheduler
Editorial statusDraft

Also indexed as · Task Dependency DAG, workflow DAG

What it buys

A scheduler can release ready tasks independently and expose opportunities for parallel execution.

Apply when

Independent branches can overlap while dependent tasks must wait for upstream results.

Reconsider when

A short fixed sequence is clearer to execute directly.

Costs and failure modes

Very fine-grained nodes inflate scheduling and metadata costs.

Case file

A worked decision

A build engine captures relationships between generated schemas, compilation, and packaging, and starts tasks when prerequisites finish.

Change the condition

For a fixed three-step recipe that always runs serially, a short script avoids graph bookkeeping.

Check the decision

Can a missing dependency produce an occasionally broken build only under parallel execution?

Relationships

Catalog note · Alternative: Bulk Synchronous Parallel synchronizes whole supersteps.

Sources

Telemetry deployment pattern

Telemetry collector gateway

Route signals through a shared collector tier for processing and export.

FamilyOperations architecture
ScopeFleet telemetry pipeline
Editorial statusDraft

What it buys

Telemetry can be filtered and routed consistently before it reaches independent backends.

Apply when

Central filtering, routing or sampling is needed across many producers.

Reconsider when

A single application can export directly within cost and reliability limits.

Costs and failure modes

Buffer exhaustion and a failed collector tier can hide incidents.

Case file

A worked decision

A telemetry gateway receives agent exports from several regions, applies tenant routing and forwards batches to the monitoring backend.

Change the condition

For a few independent services with low export volume, direct export removes a shared hop.

Check the decision

When the backend slows, how much telemetry can the gateway buffer before dropping data?

Relationships

Catalog note · Supports: Distributed tracing

Referenced by other entries (2)

Sources

Object-oriented design pattern

Template Method

A superclass fixes the order of an algorithm and delegates selected steps to overridable hooks.

FamilyGoF · Behavioral
ScopeInherited algorithm skeleton
Editorial statusDraft

What it buys

The common order of an algorithm can stay consistent while subclasses supply selected steps.

Apply when

A framework must keep invariant workflow steps while allowing controlled variation.

Reconsider when

Callers need to mix policies at runtime or vary independent steps without subclasses.

Costs and failure modes

Subclass behavior depends on an implicit hook order and fragile superclass assumptions.

Case file

A worked decision

An importer fixes parse, validate, and commit order while format-specific subclasses implement parsing.

Change the condition

If steps must be reordered at runtime, compose functions or strategy objects instead of relying on subclass hooks.

Check the decision

Can a subclass bypass validation or commit partially parsed input?

Relationships

Catalog note · Alternative through composition: Strategy

Referenced by other entries (1)

Sources

Design pattern

Thread-Safe Interface

Lock at public entry and delegate already-protected work to internal operations.

FamilySynchronization and memory
ScopeComponent / public entry points
Editorial statusDraft

What it buys

Callers can rely on a documented thread-safe boundary while private operations reuse already-held locks.

Apply when

Public methods call shared logic that otherwise reacquires the same lock.

Reconsider when

Objects are confined to one execution context.

Costs and failure modes

Exposing an unlocked helper can break the object's safety contract.

Case file

A worked decision

A session store locks each public operation and calls private helpers that assume the lock is already held.

Change the condition

When an actor is the only caller allowed to mutate session state, keep the invariant in its single-threaded handler.

Check the decision

Can two legal public calls interleave between checking and reserving a slot?

Relationships

Catalog note · Complements: Scoped Locking.

Referenced by other entries (1)

Sources

Design pattern

Thread-Specific Storage

Resolve the same logical key to a value local to the current thread.

FamilyConcurrency and network I/O
ScopeThread / runtime
Editorial statusDraft

What it buys

A long-lived worker can reuse private scratch state without paying for a shared lock on each access.

Apply when

Native per-thread caches or library context should be isolated cheaply.

Reconsider when

Logical requests move between worker threads or share pooled threads.

Costs and failure modes

A value can leak into a later request when a pooled thread is reused.

Case file

A worked decision

A native library maintains a scratch parser buffer per long-lived worker thread to avoid contention.

Change the condition

If requests migrate among threads and need their own state, pass request context explicitly.

Check the decision

Can a reused worker leak text from the previous parse into a new request?

Relationships

Catalog note · Alternative: explicit per-request context.

Sources

Traffic-control pattern

Throttling

Limit accepted work per key, tenant or time interval to protect capacity.

FamilyTraffic and resilience
ScopeBoundary or service
Editorial statusDraft

What it buys

Admission limits can preserve one tenant's entitlement when another tenant produces sustained demand.

Apply when

Unbounded callers threaten fair use or a finite downstream resource.

Reconsider when

Queueing a short burst preserves required work within its latency target.

Costs and failure modes

Poor limits reject legitimate traffic or shift the burst downstream through retries.

Case file

A worked decision

A public geocoding API limits requests per tenant so one importer cannot consume the whole daily service allocation.

Change the condition

If the only constraint is global CPU saturation, shed work according to current capacity.

Check the decision

Can one tenant exhaust another tenant's admission allowance through shared counters?

Relationships

Catalog note · Complements: Bounded Retry with Backoff and Jitter

Referenced by other entries (1)

Sources

Service activation pattern

Timer-Activated Job

A timer starts a short-lived service for work due at a time or interval.

FamilyDaemon lifecycle and supervision
ScopeHost / scheduled process
Editorial statusDraft

What it buys

A bounded maintenance task can release its resources between runs while a manager owns the trigger, status and scheduling policy.

Apply when

Work is periodic and the process can exit between runs.

Reconsider when

A long-lived connection or sub-scheduler latency budget requires a resident worker.

Costs and failure modes

Downtime, overlap and missed-run semantics need a deliberate policy.

Case file

A worked decision

A host starts a short-lived certificate-expiry scan each morning and records the exit result.

Change the condition

If expiry alerts must react to each certificate insertion immediately, perform that check in the insertion path.

Check the decision

When the host sleeps through the scheduled run, does the configured timer catch up as required?

Relationships

Catalog note · Alternative: Supervised Foreground Service.

Sources

Validation pattern

Traffic mirroring

Send a copy of production requests to a shadow target and discard its response.

FamilyRelease architecture
ScopeNetwork and staging
Editorial statusDraft

What it buys

A candidate receives realistic request shapes while users continue receiving the original service's answers.

Apply when

Candidate behavior or capacity needs realistic traffic without controlling user responses.

Reconsider when

The shadow target may execute real payments, messages or other irreversible effects.

Costs and failure modes

Side effects must be isolated and shadow results need separate comparison.

Case file

A worked decision

A routing team duplicates sampled lookup requests to a shadow implementation and compares results offline while serving the original answer.

Change the condition

For commands that charge cards, use sanitized recordings or isolate all external effects before replay.

Check the decision

Could the shadow path mutate production state even though its response is discarded?

Relationships

Catalog note · Complements: Canary release

Referenced by other entries (1)

Sources

Implementation pattern

Transaction Log Tailing

Stream committed outbox records from the database change log into a broker.

FamilyTransactional messaging
ScopeDatabase and relay
Editorial statusDraft

What it buys

A relay can follow committed changes from a checkpoint without repeatedly scanning application tables for new work.

Apply when

Low-latency publication is needed and the database exposes a reliable log feed.

Reconsider when

A simple periodic poll meets latency targets with less platform coupling.

Costs and failure modes

Offsets, failover, log retention and schema changes need operational ownership.

Case file

A worked decision

A catalog service relays committed outbox inserts from its database log, preserving an offset across restarts.

Change the condition

For a modest outbox with no supported log access, poll indexed rows.

Check the decision

Can the relay recover when its saved offset is older than the retained log?

Relationships

Catalog note · Implements Transactional Outbox as an alternative to Polling Publisher.

Referenced by other entries (1)

Sources

Domain logic pattern

Transaction Script

Implement a use case as a procedure that coordinates validation, data changes and response.

FamilyEnterprise application
ScopeSingle business operation
Editorial statusDraft

What it buys

A maintainer can trace a small use case from validation to commit in one procedure and see which writes belong together.

Apply when

Business operations are simple and share little evolving policy.

Reconsider when

Repeated branching and copied invariants proliferate across scripts.

Costs and failure modes

Policies diverge as the number of scripts grows.

Case file

A worked decision

A permits office offers a simple address correction. One transaction script validates the postal code, updates the address and writes a change note.

Change the condition

If several permit operations acquire overlapping eligibility rules and state transitions, independently extending each script invites drift.

Check the decision

Run the correction twice and verify the intended changes and audit entries in one transaction boundary.

Relationships

Catalog note · Alternative: Domain Model

Referenced by other entries (1)

Sources

Architecture pattern

Transactional Outbox

Commit the business change and outgoing record together, then publish that record via a relay.

FamilyTransactional messaging
ScopeDatabase and broker
Editorial statusDraft

What it buys

After a business commit succeeds, a relay can recover the durable intent to notify another system even if the application crashed before publishing.

Apply when

A committed state change must lead to a message despite crashes between database and broker calls.

Reconsider when

There is no cross-resource publication, or both effects genuinely share a supported transaction.

Costs and failure modes

Publication is delayed and the relay may send duplicates.

Case file

A worked decision

A payment service must record a capture and the intent to notify accounting in one local commit.

Change the condition

If accounting reads the same ledger directly, keep the single ledger write.

Check the decision

If the relay crashes after publishing but before marking the outbox row sent, can accounting process the redelivery without a second ledger posting?

Relationships

Catalog note · Implemented by Polling Publisher or Transaction Log Tailing.

Referenced by other entries (2)

Study this decision

Runnable labs

Sources

Network intermediary role

Tunnel

After setup, relay bytes between connections without interpreting the tunneled traffic.

FamilyNetwork architecture and protocols
ScopeTransport / intermediary path
Editorial statusDraft

What it buys

Endpoints can carry an inner protocol across a transit network that does not natively route it.

Apply when

Endpoints need an end-to-end protocol through an authorized intermediary.

Reconsider when

The intermediary must inspect or transform application messages.

Costs and failure modes

Policy and observability are limited after the tunnel is established.

Case file

A worked decision

Two gateways encapsulate private network packets across a transit network that cannot directly route their addresses.

Change the condition

If the transit network already routes the endpoints with the required isolation, use native routing.

Check the decision

Does the path still carry maximum application payloads once encapsulation adds headers?

Relationships

Catalog note · Contrast: Reverse Proxy participates in application messaging.

Sources

Coordination architecture

Tuple Space (Linda)

Write tuples to a shared space; receivers read or remove a tuple matching a template.

FamilyDistributed coordination models
ScopeProcess group / associative space
Editorial statusDraft

Also indexed as · Tuple-space coordination, generative communication

What it buys

A producer can leave work for an as-yet-unknown eligible worker, selected later by the contents of the tuple.

Apply when

Producers and workers can coordinate by content without knowing one another's address.

Reconsider when

Strict per-recipient ordering or direct ownership is central to the protocol.

Costs and failure modes

Ambiguous patterns, blocking matches and space availability complicate diagnosis.

Case file

A worked decision

Lab instruments post tagged samples into a shared space, and compatible analysis workers remove matching tuples.

Change the condition

If one known instrument always talks to one worker, use a dedicated channel.

Check the decision

When two workers match the same sample, can only one destructive take succeed?

Relationships

Catalog note · Alternative: Actor Model directs messages to explicit actor addresses.

Sources

Atomic commit protocol

Two-Phase Commit

Ask every participant to prepare, then record and distribute a common commit or abort decision.

FamilyConsensus and commit
ScopeTransaction participants
Editorial statusDraft

Also indexed as · 2PC

What it buys

Participating resource managers can recover one shared commit-or-abort decision for changes that must be atomic across them.

Apply when

Supported transaction managers must atomically change multiple resources.

Reconsider when

Participants cannot hold prepared state, or a business workflow lasts minutes or days.

Costs and failure modes

Prepared participants can block awaiting a decision after coordinator failure.

Case file

A worked decision

A clearing operation must commit in both transactional resource managers or in neither. Both support durable prepare, and the transaction coordinator records its decision so recovery can finish it.

Change the condition

If both changes can reside in one database, use a local transaction.

Check the decision

If the coordinator disappears after prepare, what blocks, and where can a participant recover the authoritative decision?

Relationships

Catalog note · Alternative to Saga where true atomic commitment is required.

Referenced by other entries (1)

Sources

Data model pattern

Type 2 slowly changing dimension

Give a changed dimension member a new version row and preserve earlier versions.

FamilyAnalytical architecture
ScopeHistorical data
Editorial statusDraft

What it buys

Reports can reproduce a classification as it stood on the date of a historical transaction.

Apply when

Reports must reproduce the customer segment that applied when a sale occurred.

Reconsider when

Only the current value matters and simple overwrites meet reporting needs.

Costs and failure modes

Keys, effective periods and late-arriving facts require careful joins.

Case file

A worked decision

A distributor inserts a new effective-dated customer-region row after a territory reassignment so earlier invoices retain their original region.

Change the condition

If reporting intentionally restates all sales under current territories, overwrite the current attribute.

Check the decision

Which dimension version matches a late invoice whose sale date precedes the reassignment?

Relationships

Catalog note · Refines: Dimensional star schema

Referenced by other entries (2)

Study this decision

Sources

Capability abstraction

Type class / trait bound

Express the capability that a type argument must provide and dispatch through an implementation of that contract.

FamilyTypes and polymorphism
ScopeType or public contract
Editorial statusDraft

What it buys

A generic function can demand ordering or serialization while unrelated types supply their own implementations of that capability.

Apply when

An algorithm needs an operation such as ordering across unrelated types.

Reconsider when

A single callback already states the only capability and is chosen at runtime.

Costs and failure modes

Instances can clash or violate semantic laws that the compiler cannot check.

Case file

A worked decision

A sorting library accepts any type with a lawful ordering. Measurements supplied by different libraries can participate without inheriting a shared base class.

Change the condition

If one screen chooses a different order for every request, pass a comparator directly.

Check the decision

Does the ordering satisfy transitivity across actual domain values?

Relationships

Sources

State management approach

Unidirectional Data Flow

State flows toward rendering and user actions travel back toward the state owner.

FamilyPresentation architecture
ScopeInteractive state boundary
Editorial statusDraft

What it buys

When a view displays a bad value, a developer can trace the action and state transition that produced the rendered input.

Apply when

Multiple user actions or data sources must update displayed state consistently.

Reconsider when

A single isolated widget has no shared state or coordination pressure.

Costs and failure modes

Every update needs an explicit path and high-frequency updates can trigger excessive rendering.

Case file

A worked decision

An image editor routes tool selections and document actions to a state owner. Toolbar and canvas read that state, preventing each view from writing changes directly into the other.

Change the condition

For two unrelated local inputs with no shared state, forcing both through a central store adds routing without coordination value.

Check the decision

Can the toolbar and canvas disagree about the active tool after replaying the same action sequence?

Relationships

Catalog note · Specialized by: Elm Architecture

Referenced by other entries (2)

Sources

Persistence pattern

Unit of Work

Track changed objects and coordinate writes at completion of a business operation.

FamilyEnterprise persistence
ScopeBusiness transaction
Editorial statusDraft

What it buys

A use case can stage several related changes and flush them together within the intended transaction boundary.

Apply when

Several object changes must be persisted consistently and efficiently.

Reconsider when

The operation is one atomic statement or an existing persistence context already supplies this behavior.

Costs and failure modes

Long-lived units accumulate stale state, memory use and contention.

Case file

A worked decision

A repair order edit adds parts, changes labor and removes an obsolete fee. A unit of work tracks these changes and writes them at one transaction boundary.

Change the condition

If a command changes one field with an atomic database statement, change tracking adds little value.

Check the decision

Inject a failure while saving the fee change and confirm that the parts and labor edits also roll back.

Relationships

Catalog note · Complements: Identity Map

Referenced by other entries (1)

Sources

Access delegation pattern

Valet Key

Issue a narrowly scoped, short-lived token for direct client access to a resource.

FamilySecurity architecture
ScopeClient and storage
Editorial statusDraft

What it buys

A client can transfer a large object directly with narrowly scoped authorization, avoiding an application data relay.

Apply when

Large uploads would otherwise pass through an application purely for authorization.

Reconsider when

Each byte requires synchronous inspection that direct access would bypass.

Costs and failure modes

An overbroad or leaked token remains usable until expiry or revocation.

Case file

A worked decision

A video portal issues a short-lived signed upload URL scoped to a particular staging object. Its upload workflow tolerates overwrites until that URL expires.

Change the condition

For small uploads that need inline inspection before any storage write, proxy the bytes through the application.

Check the decision

Can a holder write outside the assigned staging key, and can the release step be tricked into publishing bytes uploaded after validation?

Relationships

Catalog note · Alternative for mediated access: Gateway offloading

Referenced by other entries (1)

Sources

Tactical design pattern

Value Object

Model a concept by its constituent values and replace it as a whole.

FamilyDomain modeling
ScopeDomain type
Editorial statusDraft

What it buys

Equivalent amounts or ranges compare by content and can carry their own validation wherever they are used.

Apply when

Currency, units or intervals need value equality and locally enforced invariants.

Reconsider when

The business tracks identity and history independently of current attribute values.

Costs and failure modes

Equality, normalization and precision choices become part of the domain contract.

Case file

A worked decision

A geofence represents a radius as a distance with explicit units. Two independently created distances representing the same length compare equally and can be substituted.

Change the condition

If the business tracks calibration, custody and lifetime history of a particular measuring instrument, that instrument needs identity.

Check the decision

After unit conversion, do equivalent distances compare consistently and preserve the geofence's inclusion rule?

Relationships

Catalog note · Contrasts with: Entity

Referenced by other entries (2)

Sources

Version-tracking mechanism

Version Vector

Keep per-participant counters to identify causal ancestry and concurrent versions.

FamilyDistributed time and causality
ScopeReplicated data item
Editorial statusDraft

What it buys

An offline merge can distinguish an update that supersedes an earlier version from concurrent edits that need a conflict policy.

Apply when

Active replicas need to distinguish a true conflict from a superseded value.

Reconsider when

A single writer orders every update or cluster identity churn makes metadata excessive.

Costs and failure modes

Vectors grow with tracked participants and detecting conflicts does not resolve them.

Case file

A worked decision

An offline editor must distinguish edits descended from earlier versions from concurrent edits needing reconciliation.

Change the condition

If one server serializes every edit before acceptance, use a revision counter.

Check the decision

Can the system distinguish two edits made from the same base on disconnected devices?

Relationships

Catalog note · Contrasts with Lamport Clock.

Referenced by other entries (3)

Sources

Object-oriented design pattern

Visitor

Use dispatch through each element to select a type-specific operation on a visitor.

FamilyGoF · Behavioral
ScopeOperations on a stable family of element types
Editorial statusDraft

What it buys

New operations over a stable set of element types can be added without modifying each element class.

Apply when

A stable syntax tree needs many independently evolving analyses or transformations.

Reconsider when

New element types appear frequently or exhaustive pattern matching is already clearer.

Costs and failure modes

Adding an element forces changes across visitors and may expose representation details.

Case file

A worked decision

A compiler with stable syntax node kinds adds formatting, linting, and symbol inspection as separate visitors.

Change the condition

If plugins introduce new node kinds frequently and each owns its formatting behavior, dispatch formatting through a method on the plugin contract.

Check the decision

When a syntax kind is added, which visitor fails visibly instead of silently skipping it?

Relationships

Catalog note · Commonly applied to: Composite

Sources

Architectural style

Web–Queue–Worker

Accept a request in a front end, enqueue deferred work and let separate workers process it.

FamilyApplication topology
ScopeRequest path and background work
Editorial statusDraft

What it buys

The web tier can acknowledge accepted work promptly and scale worker capacity independently when jobs accumulate.

Apply when

An expensive task can finish after the caller receives acknowledgment.

Reconsider when

The caller must receive the final result synchronously and the work is quick.

Costs and failure modes

Queue delays, retries and reporting completion become application responsibilities.

Case file

A worked decision

A video editor accepts an upload and returns a job identifier while a worker generates a preview. A status endpoint shows completion or failure for that identifier.

Change the condition

If a preview is a tiny precomputed asset, a direct synchronous response avoids tracking a job.

Check the decision

Kill the worker after it saves a preview but before acknowledgement and verify that redelivery creates no duplicate asset.

Relationships

Catalog note · Can use: Competing Consumers

Sources

Scheduling strategy

Work Stealing

Let an idle worker acquire ready work from another worker's local queue.

FamilyParallel and scientific computing
ScopeWorkers / task runtime
Editorial statusDraft

What it buys

Idle workers can pick up remaining tasks from busier workers when task lengths are difficult to predict.

Apply when

Irregular or recursively discovered tasks leave some workers idle.

Reconsider when

Known equal-sized tasks favor static partitioning or strict affinity is required.

Costs and failure modes

Steals add coordination and can move computation away from its data.

Case file

A worked decision

A theorem prover produces uneven search subtrees and idle workers steal available branches from busy peers.

Change the condition

For uniform fixed partitions with strong cache locality, static placement can avoid stealing overhead.

Check the decision

Does stealing improve tail completion time after accounting for data movement?

Relationships

Catalog note · Complements: Fork–Join Parallelism.

Referenced by other entries (2)

Sources

Identity architecture

Workload identity

Issue verifiable workload identities for authenticating service peers.

FamilySecurity architecture
ScopeService and trust domain
Editorial statusDraft

What it buys

Short-lived workloads can authenticate one another without embedding a long-lived shared secret in each deployment.

Apply when

Short-lived workloads move between hosts and static shared secrets are hard to rotate.

Reconsider when

One offline process communicates only within an existing local trust boundary.

Costs and failure modes

Attestation, identity issuance and rotation become availability dependencies.

Case file

A worked decision

A report worker exchanges its runtime identity for short-lived storage access restricted to its input bucket.

Change the condition

For an entirely offline worker that reads one local file, filesystem permissions may suffice.

Check the decision

After replacing the worker, can the retired instance still obtain fresh credentials?

Relationships

Catalog note · Complements: Service mesh

Referenced by other entries (3)

Sources

Design pattern

Wrapper Facade

Group low-level platform operations behind a cohesive object interface.

FamilyMiddleware structure
ScopeModule / platform boundary
Editorial statusDraft

What it buys

Callers can work with typed handles and meaningful errors instead of repeatedly translating low-level platform conventions.

Apply when

Repeated resource and error-handling code spans several callers.

Reconsider when

A thin pass-through adds no invariant, adaptation or portability.

Costs and failure modes

A wrapper can conceal platform-specific semantics its users depend on.

Case file

A worked decision

A cross-platform tool wraps native file descriptors and error codes in a small typed file-handle API.

Change the condition

If a single platform-specific syscall already matches the only call site, call it directly.

Check the decision

Does the wrapper preserve the distinction between end of file and interrupted read?

Relationships

Catalog note · Related: Facade abstracts a subsystem more generally.

Sources

Storage recovery pattern

Write-Ahead Log

Record updates durably in an ordered log before corresponding data pages are persisted.

FamilyReplication and consistency
ScopeDurable storage engine
Editorial statusDraft

What it buys

A store can acknowledge a durable commit before every changed data page reaches disk, provided recovery can reconstruct it from the durable log.

Apply when

Crash recovery must restore committed work without synchronously flushing every data page.

Reconsider when

Transient or cheaply reconstructible state needs no durable recovery contract.

Costs and failure modes

Flush policy governs durability. Recovery time and log truncation need management.

Case file

A worked decision

A page-based store must recover after a crash midway through flushing modified pages, so it durably records changes ahead of affected pages.

Change the condition

If the data can be regenerated cheaply after a crash, rebuild the cache.

Check the decision

Can a crash after durable commit but before a dirty page flush recover the committed change?

Relationships

Catalog note · Can underpin a Replicated Log but local durability alone supplies no replica agreement.

Referenced by other entries (1)

Sources

Caching pattern

Write-behind cache

Queue changes in a cache and flush them to the backing store asynchronously.

FamilyData access and caching
ScopeCache and backing store
Editorial statusDraft

What it buys

A burst of compatible writes can be absorbed or coalesced before the backing store must handle it.

Apply when

Write spikes can be coalesced and the durability contract allows deferred persistence.

Reconsider when

Each success must imply a durable authoritative write immediately.

Costs and failure modes

Failures can lose unflushed writes and concurrent readers may see older data.

Case file

A worked decision

An image editor acknowledges autosave after staging a change in a cache and flushes dirty changes to storage in batches.

Change the condition

When an acknowledged financial transfer must survive a cache loss, persist it to durable storage before acknowledgement.

Check the decision

What acknowledged changes could disappear if the cache node fails before flushing?

Relationships

Catalog note · Related: Read-through cache

Sources

Reference architecture

Zero trust architecture

Authenticate and authorize access to protected resources using explicit policy and context.

FamilySecurity architecture
ScopeIdentity and resources
Editorial statusDraft

What it buys

Compromise of a network location alone grants less access when individual resources require explicit authorization.

Apply when

Users and workloads cross network boundaries and location gives weak evidence of trust.

Reconsider when

A static offline component has no remote access path to govern.

Costs and failure modes

Policy, telemetry and the availability of the identity plane become critical.

Case file

A worked decision

An internal build system authenticates the runner, checks the requested repository, and limits access to the specific artifact on each request.

Change the condition

For a single offline utility with no network resource access, local OS isolation can meet the threat model.

Check the decision

Would possession of an internal network address alone grant access to a private artifact?

Relationships

Catalog note · Can use: Workload identity

Sources

Browse the reference

Subject areas

28 entries

Application and service structure

Application boundaries

Application topology

Modernization

Service architecture

Stateful architecture

Structural architecture

25 entries

Cloud, delivery and operations

Cloud infrastructure

Operations architecture

Release architecture

42 entries

Code and programming foundations

Concurrency boundaries

Control flow and decomposition

Data layout and locality

Functional transformations and evaluation

Logic and search

Metaprogramming

Module construction

Reactive sequences

Relational operations and invariants

Resource lifetime and ownership

State and transitions

Types and polymorphism

16 entries

Data platforms and analytics

Analytical architecture

Data access and caching

Stream processing

31 entries

Distributed data and coordination

Cluster coordination

Consensus and commit

Data replication

Distributed coordination models

Distributed time and causality

Partitioning and placement

Replication and consistency

Service data boundaries

24 entries

Domain and enterprise application

Domain boundaries

Domain modeling

Enterprise application

Enterprise persistence

23 entries

Gang of Four object design

GoF · Behavioral

GoF · Creational

GoF · Structural

35 entries

Integration and messaging

Enterprise integration

Event-driven architecture

Event-driven integration

Message contracts

Message delivery

Message routing

Service access and discovery

Transactional messaging

33 entries

Networks, resilience and I/O

Concurrency and network I/O

Fault isolation and overload

Middleware structure

Network architecture

Network architecture and protocols

Traffic and resilience

25 entries

Operating systems and daemons

Daemon lifecycle and supervision

Embedded and real-time control

Operating-system architecture

Synchronization and memory

16 entries

Parallel computing and ML

ML and AI systems

Parallel and scientific computing

Parallel computation

14 entries

Presentation and client

Client and edge architecture

Presentation architecture

Web presentation

15 entries

Programming models and specialization

Compiler architecture

Game and simulation architecture

Programming model and architecture

Specialized architecture

9 entries

Security and tenancy

Multitenancy

Security architecture

16 entries

Workflow and business processes

Human and case workflows

Workflow control flow

Workflow coordination

Workflow execution

Browse the reference

Programming paradigms

4 entries

Actor-based

Concurrency and network I/O

Concurrency boundaries

Daemon lifecycle and supervision

Distributed coordination models

32 entries

Concurrent / parallel

Concurrency and network I/O

Concurrency boundaries

Distributed coordination models

Message delivery

Parallel and scientific computing

Parallel computation

Synchronization and memory

3 entries

Constraint

Logic and search

Programming model and architecture

6 entries

Data-oriented / array

Data layout and locality

Game and simulation architecture

Parallel and scientific computing

Specialized architecture

14 entries

Declarative

Analytical architecture

Operations architecture

Parallel and scientific computing

Programming model and architecture

Relational operations and invariants

Types and polymorphism

14 entries

Event-driven

Concurrency and network I/O

Domain modeling

Event-driven architecture

Event-driven integration

Message delivery

Presentation architecture

Reactive sequences

Service data boundaries

State and transitions

Structural architecture

22 entries

Functional

Functional transformations and evaluation

Parallel computation

Presentation architecture

Programming model and architecture

State and transitions

Structural architecture

Types and polymorphism

7 entries

Generic / type-level

Programming model and architecture

Synchronization and memory

Types and polymorphism

16 entries

Imperative / procedural

Control flow and decomposition

Enterprise application

Functional transformations and evaluation

Module construction

Programming model and architecture

Resource lifetime and ownership

Structural architecture

4 entries

Logic / rule-based

Logic and search

Programming model and architecture

2 entries

Metaprogramming

Metaprogramming

Structural architecture

36 entries

Object-oriented

Concurrency and network I/O

Domain modeling

Enterprise application

Enterprise persistence

GoF · Behavioral

GoF · Creational

GoF · Structural

Module construction

Presentation architecture

Resource lifetime and ownership

Structural architecture

Types and polymorphism

7 entries

Reactive / dataflow

Analytical architecture

Distributed coordination models

Reactive sequences

Stream processing

Structural architecture

12 entries

Relational

Analytical architecture

Data access and caching

Enterprise application

Enterprise persistence

Programming model and architecture

Relational operations and invariants

Reference

Glossary

Browse every entry alphabetically or follow a name to its scope, cases and related decisions.

A

B

C

D

E

F

G

H

I

K

L

M

N

O

P

Q

R

S

T

U

V

W

Z

Decision finder

Start with a problem

Compare the approaches that address the specific constraint you face.

The import routine is five branches deep. Where can I cut it safely?

Mark the branch exits. An exit that only rejects bad input can become a guard, while a block that finishes building input for the next block suggests a phase boundary.

Is our nested generic type buying us anything when all callers use one concrete type?

Inspect what actually changes across callers. A change of element type supports a type parameter, a change of operation can be passed as a function, and identical uses support a concrete type.

Our checkout has one subclass for every combination of discount and tax rule. How can we stop multiplying classes?

List the combinations requested by real callers. Independently selected rules can be passed as policies, while one fixed sequence with a single variation point may only need a hook.

Does a quote preview that changes the invoice mean we need CQRS?

Identify the smallest boundary where change is needed. A side effect in arithmetic, a mutating preview method, and independently evolving read and write models point to three different entries.

How should our parser distinguish an absent value from a malformed one?

Look at what the caller does next. If a rejected value requires a diagnostic or recovery choice, an empty result loses information the caller needs.

Why does adding a second matching permission row duplicate a person in my report?

Check the required output grain. One row per qualifying person needs only an existence test, while one row per permission match needs the matching rows themselves.

Can the database stop double-bookings, or do we need a scheduling engine?

Observe where the failure occurs. Rejecting one conflicting assignment at commit needs an authoritative invariant, while finding a feasible combination for the entire roster needs a search over choices.

An import fails opening the fifth file. Who closes the first four?

Count acquisitions on each execution path. A known set of owners fits fixed scopes, while a runtime-sized set benefits from registering each successful acquisition as it occurs.

Our dashboard shows stock levels from two different ticks. Where should we fix it?

Capture the first inconsistent snapshot. A mixed snapshot at publication points to producer buffering, while competing updates inside the view point to its state transition path.

A fast producer keeps exhausting memory when the consumer pauses. How should it slow down?

Check whether the producer can honor a pause. A blocking handoff or demand protocol needs a cooperative producer, while expendable work may need an explicit drop rule.

An order is marked paid but its event never arrives, and our retry sometimes credits the account twice. Which boundary failed?

Locate the failure relative to publication. A crash between commit and publish exposes the dual write, while two deliveries reaching the same side effect expose duplicate processing.

Can two people edit the same offline note without silently losing one person's work?

Write the expected outcome for two concurrent edits. Detecting a conflict for a person to resolve and automatically merging operations require different guarantees.

One team wants to split billing out of our application. Which boundary should we test first?

Try shipping a billing change through an internal module boundary and record what still forces a coordinated release. That remaining coupling determines what an independent deployment could buy.

Two teams mean different things by “customer.” Should they share a model?

Inspect one real translation between the teams. Collapsing two identities or lifecycle rules loses meaning, while a genuinely identical and jointly maintained subset may be shared.

Why are users refused connections just after the service manager says the daemon started?

Identify who owns the listener during startup. An unopened application socket, a manager-owned listening socket, and a bound but unready application call for different lifecycle contracts.

A network transfer slows down. Should the sender wait for the receiver or for the network?

Measure where the first queue builds. Receiver buffer exhaustion calls for receiver feedback, while growing queues along the path call for congestion control.

One broken dependency consumes every request worker. Should we divide capacity or stop calling it?

Find the resource exhausted first. A shared pool needs isolation, while repeated calls to a dependency with a sustained failure rate can be interrupted at the call boundary.

How can we try a new search service with production traffic without affecting every reader?

Decide whose response users receive. Shadow requests can test behavior with discarded results, while candidate responses for a limited cohort expose actual user impact.

A code rollback still leaves the old service unable to read new records. What must change?

Run the old reader against an actual record written by the candidate. A failed compatibility check requires a data transition in addition to any traffic or replica switch.

A manager could open a record yesterday but moved departments today. Where should access change?

Name the fact that revokes access. A change of job role can drive a role grant, while the relationship between the current department and a particular record requires request context.

A territory reassignment changes last year's sales totals. Which version should reports use?

Ask whether the report promises historical or current territory membership for the same invoice. That choice determines which dimension row each fact must join.

Our model scored well in training and poorly online. Are we retraining the wrong thing?

Reconstruct the feature vector available at prediction time for one known case. A mismatch directs attention to feature construction before another round of training.

We scan millions of particles each frame. Should we change the data layout or parallelize the loop?

Profile the stalled part of a representative frame. Fetching unused fields points to layout, while independent compute-heavy updates may benefit from parallel execution.

A workflow charges a card, books a courier, then loses its worker. Where should it resume?

Check the durable evidence for the last external action. A recorded outcome permits resumption, an uncertain outcome needs safe retry or reconciliation, and a known completed action may need business compensation.

Reference

Design comparisons

Each comparison identifies where a relationship holds and the condition that limits it.

informs

Actions and calculations / Functional Core, Imperative Shell

When a price depends only on supplied inputs, keep the pricing calculation pure and let the shell read the clock or charge the card.

A time-sensitive read remains an action even when it changes no application state.

analogous at another scope

Command–Query Separation (CQS) / CQRS

CQS separates an operation that reports a result from one that changes observable state, while CQRS separates the models serving reads and writes.

A type with separate getters and mutators can still use one model and gives no architectural reason to introduce CQRS.

distinguishes a different property from

Actions and calculations / Command–Query Separation (CQS)

Treat a time-dependent query as an action in functional reasoning even if it meets a CQS interface contract by leaving observable state unchanged.

Calling an operation a query gives no guarantee that the same arguments always produce the same result.

can combine with

CQRS / Event Sourcing

When the write model already retains authoritative event history, a subscriber can build projections tailored to the read model.

Separate models can share a conventional database, and a separate projection introduces a freshness and rebuild policy.

can use

CQRS / Materialized View

Precompute a read model when its joins or aggregates dominate read cost and consumers can tolerate the chosen refresh delay.

Maintaining a projection adds avoidable work if indexed queries on the write schema meet the requirement.

analogous at another scope

Command / Command Message

An editor command carries executable behavior, while a command message can carry the intention and data an independent receiver needs to act.

Crossing a process boundary requires a serializable contract and delivery policy even when both objects describe the same action.

can be represented by

Domain Event / Event Message

Publish a domain occurrence across contexts when consumers need to react to a business fact under an explicit public contract.

Mirroring private domain objects into public messages couples consumers to internal model changes.

analogous at another scope

Observer / Publish–Subscribe Channel

Use local notification for in-process dependents and a channel when subscribers have independent process lifetimes.

Moving a callback to a broker changes failure, timing and delivery behavior and may require idempotent handling.

can combine with

Transactional Outbox / Idempotent Receiver

Store an outgoing event with the business update and let receivers safely handle a repeated event if the relay crashes after publishing.

Deduplicating by message ID only works for the effects actually covered by the receiver's deduplication boundary.

alternative under a condition

Event Notification / Event-Carried State Transfer

Send a small signal when consumers can fetch current state, or include needed state when they must keep working while the producer is unavailable.

A notification adds a read dependency, while carrying state increases payload, contract and freshness obligations.

can use

Saga / Saga Orchestration

Choose explicit coordination when a long-running business transaction has several compensations, deadlines or participants that require a visible sequence.

A centralized coordinator adds coupling and recovery work when two parties can handle the exchange directly.

alternative under a condition

Choreography / Saga Orchestration

Choose event reactions when each participant can make its local decision using a small number of well-defined events.

When the end-to-end outcome is hard to reconstruct or compensation order matters, explicit coordination becomes easier to reason about.

alternative under a condition

Generic algorithm and concept / Strategy

A generic algorithm can accept any type satisfying its required operations, while an object strategy is useful when the policy must be replaceable at runtime.

The need for generic input types establishes no need for an inheritance hierarchy, and some languages can express runtime choice with a function.

can implement

Policy-based design / Strategy

Select a policy by a type parameter when the choice is fixed before execution and the host needs that policy's operations.

Nested policy combinations increase type complexity and are a poor fit for per-request policy changes.

analogous at another scope

OS Microkernel / Microkernel / Plug-in Architecture

Both preserve a small core, but an OS microkernel places selected services outside the privileged kernel while a product core defines extension contracts.

Moving a feature into an application plug-in provides no automatic process, privilege or fault isolation.

distinguishes a different role from

Leader/Followers / Leader and Followers

A thread-pool leader waits for work and hands leadership to another thread, while a replication leader orders updates for followers.

Thread handoff supplies no replica agreement, election or durability guarantee.

alternative under a condition

Reactor / Proactor

Choose readiness dispatch when a handler should attempt I/O after notification, or completion dispatch when the runtime can finish a submitted operation and report its result.

Treating readiness as completion can lead to partial reads or writes and lost progress.

can use

Hexagonal Architecture / Ports and Adapters / Adapter

Implement a port with an object adapter when an external SDK expresses compatible behavior through different methods and types.

A wrapper that simply exposes the SDK's model leaves the application dependent on the external contract.

can be deployed as

Layered Architecture / N-tier Architecture

Move a logical boundary into a separate tier when its trust boundary, isolation or scaling profile requires a separate deployment.

Separating every logical layer introduces network failures and latency where a local call may suffice.

can guide

Bounded Context / Decompose by Subdomain

Use differences in language, invariants and ownership to investigate service boundaries around business subdomains.

A context boundary need not become a network boundary, and a subdomain may be addressed by more than one model.

specializes

Elm Architecture / Unidirectional Data Flow

Use model, update and view when actions can be represented as messages and state transitions need deterministic tests.

An architecture can propagate state in one direction without adopting this specific set of components.

can combine with

Generic algorithm and concept / Iterator

Define a traversal algorithm over the operations it needs when several collection types expose compatible iterators.

Indexing, stable references or multipass traversal require stronger contracts than a single-pass iterator.

can combine with

Data mesh / Lakehouse

Let domain teams publish owned data products backed by lakehouse tables when independent ownership and shared storage capabilities both serve the organization.

Changing table storage does not assign owners, define data product contracts or establish federated governance.

can combine with

Dimensional star schema / Type 2 slowly changing dimension

Attach facts to the dimension version valid at the event time when historical reports must reflect attributes as they were then.

Simple overwrite is cheaper for corrections or attributes whose history has no analytical value.

can feed

Log-based change data capture / Materialized View

Capture committed changes and apply them to a derived view when reads need a different shape and asynchronous refresh is acceptable.

Schema transitions, duplicates and rebuilding the initial view require explicit handling.

alternative under a condition

Lambda architecture / Kappa architecture

Keep separate batch and speed paths when each has a necessary processing model, or replay one retained stream when one pipeline can compute both results.

Two paths can diverge semantically, while a single replay path depends on retained input and tolerable rebuild time.

alternative under a condition

Database per tenant / Shared multitenant database

Isolate databases when tenants need independent restore, residency or capacity policies, and share storage when per-tenant operations would dominate cost.

A shared database requires reliable row isolation, while separate databases add migration and fleet-management work.

can use

Zero trust architecture / Workload identity

Give each workload verifiable credentials when authorization must follow the caller across dynamic network boundaries.

A verified workload can still lack permission for a particular resource and action.

can combine with

Role-based access control / Attribute-based access control

Use stable job functions for broad entitlements and resource or request attributes when contextual restrictions are meaningful.

Overlapping rules need explicit precedence and auditable decisions to avoid accidental access.

can perform

API Gateway / Gateway offloading

Centralize common API concerns when a gateway can authenticate requests or terminate TLS consistently for many services.

A gateway check alone cannot authorize domain-object access if the service owns facts used by that decision.

can use

Service mesh / Sidecar

Attach a proxy to each workload when the mesh needs per-workload routing or mutual authentication without application changes.

A sidecar raises per-instance resource and upgrade costs, and a mesh can use other data-plane arrangements.

can implement a choice in

Strategy / Strategized Locking

Make a lock policy replaceable when components share an algorithm but have different synchronization requirements.

A selectable no-lock policy is unsafe unless the caller can prove exclusive access.

underlies

Reconciliation loop / Operator

Encode operational knowledge in a controller when it can observe resource state and repeatedly move it toward a declared target.

A non-idempotent external action needs a durable progress marker or repeated reconciliation may repeat the action.

analogous at another scope

Credit-Based Flow Control / Reactive Streams

Both limit producer progress using downstream capacity, while a stream subscriber signals demand in items and a transport defines its own credit units.

Subscriber demand does not imply a limit on every intervening network buffer or on total bytes.

can combine with

Event-time windowing and watermarks / Kappa architecture

Use event-time windows in a single stream pipeline when late events must be assigned according to their occurrence time even during replay.

The watermark and late-data policies still determine when results may be published or revised.

can be scheduled by

Task Dependency Graph / Work Stealing

Allow idle workers to steal ready tasks when dependencies leave many independent tasks with uneven runtimes.

Stealing cannot shorten the critical dependency chain, and moving tasks can harm data locality.

can combine with

Circuit Breaker / Bounded Retry with Backoff and Jitter

Bound retries of transient safe operations and suppress calls while a dependency is persistently failing.

Retrying across multiple layers can multiply load, and retrying an unsafe operation can duplicate its effects.

can govern

Supervision Tree / Actor Model

Organize actors under supervisors when independent workers may fail and a restart policy can restore a valid state.

The actor model alone supplies no restart guarantee, and restarting a worker cannot undo its external effects.

Study

Learning paths

Follow a problem through changing constraints. Each step includes an exercise and a condition under which the simpler design remains sufficient.

Learning path

Separate business decisions from effects

01

Actions and calculations

An invoice total changes between runs because pricing reads the clock and a tax service.

Try it

Mark each operation that observes or changes the outside world. Pass a fixed effective date and rate into the pricing calculation.

Stop here when

Keep the extracted function if the remaining workflow is a short sequence of effects.

02

Functional Core, Imperative Shell

Several pricing decisions now require the same awkward infrastructure test setup.

Try it

Run the pricing core against ordinary values, then make the shell perform lookup and persistence. Identify which failures stay in the shell.

Stop here when

Keep individual pure functions where an explicit core module would add navigation without reuse or test benefit.

03

Command–Query Separation (CQS)

A preview method increments a revision when the invoice is merely displayed.

Try it

Separate preview from approval. Document the appropriate result of the approval operation at the API boundary.

Stop here when

Retain one model if reads and writes share the same business shape. An operation-level split is enough.

04

Materialized View

Only one report is slow; business reads and writes otherwise fit one model.

Try it

Branch for a reporting bottleneck. Compare an indexed query against a stored summary, including freshness and refresh cost.

Stop here when

Stop at the query or index if peak report load meets the target.

05

CQRS

Reservation rules and a family of read views are evolving independently and changes to a shared model repeatedly break the other side.

Try it

Branch for model divergence. Design separate write and read models over one database and justify any later storage split.

Stop here when

Keep the shared model if only one expensive report or a naming issue motivates the split.

Learning path

Operate a process that accepts connections

01

Supervised Foreground Service

A single network daemon loses its logs and needs manual restarts after it exits.

Try it

Run it under a manager, force process exit and observe restart, log capture and main-process tracking.

Stop here when

A single foreground process suffices when the manager provides the required recovery.

02

Readiness Notification

A dependent service connects after process creation but before initialization completes.

Try it

Delay initialization and verify that dependents advance only after actual readiness.

Stop here when

Skip a readiness handshake when initialization adds no meaningful delay or clients tolerate startup retries.

03

Socket Activation

The daemon is idle most of the day and the listener must remain available while the process restarts.

Try it

Branch for lifecycle pressure. Let a manager own the listening socket, then measure cold-start latency and behavior for existing connections.

Stop here when

Keep the resident supervised service when its idle cost is acceptable and first-request latency matters.

04

Reactor

Thousands of mostly idle connections exhaust the thread budget; supervised lifecycle is already adequate.

Try it

Branch for concurrency pressure. Handle readiness on one loop, add a slow handler, and measure its effect on unrelated clients.

Stop here when

Keep blocking threads with a bounded pool if peak load meets latency and resource targets.

05

Half-Sync/Half-Async

A necessary blocking operation stalls the event loop and creates tail-latency spikes.

Try it

Put blocking work behind a bounded queue and choose what to do at saturation. Measure end-to-end latency.

Stop here when

Keep the event loop alone if every handler reliably completes within its latency budget.

Learning path

Evolve one application and migrate a boundary

01

Monolithic Architecture

One team can deploy and restore the application together, but expects the product to grow.

Try it

Map the current deployment, transaction boundaries and observed release bottlenecks.

Stop here when

Keep one deployable when a single release cadence fits and module changes stay local.

02

Modular Monolith

Changes frequently cross unrelated packages although independent deployment has little value.

Try it

Draw a candidate module boundary and enforce its public API before introducing a network call.

Stop here when

Stop with modules if defects and release coordination improve.

03

Bounded Context

Two teams use the same word for concepts with incompatible business rules.

Try it

Give the term a definition in each context and design a translation at their boundary.

Stop here when

Keep one model where the same rules, language and owners really apply.

04

Branch by Abstraction

A replaceable internal implementation has many callers and cannot be swapped in one release.

Try it

Branch for an in-process migration. Introduce one seam, switch implementations incrementally, and remove the seam if it no longer earns its place.

Stop here when

Make a direct replacement when there are few callers and rollback is easy.

05

Strangler Fig

A capability needs a separately deployed replacement and traffic can be routed at its boundary.

Try it

Branch for a deployment migration. Move one route or business capability, define data authority and rehearse rollback.

Stop here when

Prefer an internal replacement when no safe request or ownership boundary exists.

Learning path

Deliver work and coordinate independent services

01

Point-to-Point Channel

A producer must hand a job to one downstream worker and continue.

Try it

Contrast a direct call with a queued job. Specify who owns accepted work after the producer exits.

Stop here when

Keep the direct call when the result is needed immediately and both parties can block together.

02

Idempotent Receiver

A worker commits its update, crashes before acknowledgement, and receives the job again.

Try it

Replay the same logical job and confirm the business effect occurs once. Distinguish identity from matching payloads.

Stop here when

Avoid a deduplication store if the operation is already idempotent under repeats and no ancillary effects duplicate.

03

Transactional Outbox

A local business update succeeds but publishing its event sometimes fails.

Try it

Persist the change and outgoing event together, crash after commit, and trace how a relay resumes.

Stop here when

Use one local transaction alone when no external message must accompany the change.

04

Choreography

Independent services can each act on events without needing a single controller.

Try it

Branch for local autonomy. Trace a workflow through named events, including a failure and a delayed response.

Stop here when

Keep direct handoff for two steps if independent reaction and deployment bring no benefit.

05

Saga Orchestration

A multi-service process acquires conditional sequencing, deadlines and compensations that are hard to reconstruct from events.

Try it

Branch for explicit coordination. Model a failed step, its compensation and how the coordinator resumes. Compare with choreography.

Stop here when

Keep a local transaction when one database can enforce the whole invariant. Retain choreography if participants can coordinate clearly.

Learning path

Serve analytical questions without burdening writes

01

Dimensional star schema

Business users repeatedly need totals sliced by the same descriptive attributes.

Try it

Specify the grain of a fact first, then model two dimensions and check a representative aggregate.

Stop here when

Keep a direct reporting query when the workload has one simple question and little reuse.

02

Type 2 slowly changing dimension

An old sale must remain attributed to the customer region valid on its sale date.

Try it

Version one dimension and join a fact to the appropriate historical version. Test the change-date boundary.

Stop here when

Overwrite the attribute when only the current value matters.

03

Materialized View

Users repeatedly run the same expensive aggregation and can tolerate bounded staleness.

Try it

Branch for read latency. Compare recomputation, a better index and a stored summary against measured refresh and storage costs.

Stop here when

Keep the ordinary query when it meets its latency target or every read requires immediate freshness.

04

Log-based change data capture

A reporting copy must stay fresher than full extracts allow, without repeatedly scanning source tables.

Try it

Branch for feed freshness. Resume from a log position after failure, then test duplication and schema change.

Stop here when

Stay with scheduled extraction when its load and lag are acceptable.

05

Event-time windowing and watermarks

An event-time dashboard miscounts records arriving out of order in the incremental feed.

Try it

Define lateness tolerance and correction policy. Replay a late sale before and after the watermark.

Stop here when

Use an ordinary batch aggregation if all data is available before publication.

Learning path

Choose a concurrency model for streaming work

01

Pipes and Filters

An ingestion program has several reusable transformation stages with distinct responsibilities.

Try it

Describe each stage's inputs and outputs, then run the stages synchronously against a sample stream.

Stop here when

Retain simple composed functions if they already express the pipeline clearly.

02

Data Parallelism

Independent records receive the same expensive transformation and one worker misses the throughput target.

Try it

Partition a representative workload; measure speedup including transfer, skew and merge overhead.

Stop here when

Keep sequential processing when scheduling costs exceed the measured gain.

03

Reactive Streams

Independent asynchronous stages produce and consume at different rates and memory use grows.

Try it

Branch for asynchronous demand. Slow a consumer and verify bounded outstanding demand, cancellation and completion.

Stop here when

Keep a synchronous iterator if it already bounds memory and meets throughput.

04

Synchronous Dataflow

A sensor pipeline has fixed production and consumption rates and needs a predictable schedule.

Try it

Branch for known rates. Annotate each stage, derive a repeatable firing schedule and estimate buffers.

Stop here when

Keep demand-driven streaming if rates depend on the data and static scheduling adds no benefit.

05

Actor Model

Workers own independent state and must handle commands over time as well as stream items.

Try it

Branch for isolated mutable state. Assign ownership, specify a message protocol and identify a cross-actor invariant.

Stop here when

Keep stateless stages when partitioned records need no long-lived, independently owned state.

Learning path

Keep ownership clear as a file importer grows

01

Guard clause

A parcel-manifest importer opens a file before checking whether the request names an allowed depot.

Try it

Move depot and filename validation ahead of opening the file. Feed it an unknown depot and count how many files it opens.

Stop here when

Keep the checks at the entry point if malformed requests can all be rejected before acquisition.

02

Deterministic resource lifetime (RAII)

A valid manifest can still fail halfway through parsing, leaving its file handle open.

Try it

Bind the open file to a scope that releases it on normal return and exceptional exit. Inject a parse failure on line three and try to reopen the file exclusively.

Stop here when

One scoped owner suffices while reading and closing happen in the same operation.

03

Borrowed access

A new checksum helper closes the caller's stream, so the parser fails on the next record.

Try it

Give the helper temporary access to one record buffer. State who owns that buffer, and demonstrate that a retained view would become invalid when the next record reuses it.

Stop here when

Keep the buffer borrow synchronous if the helper can finish before reuse. Copy a small record if it must outlive the owner's scope.

04

Context-managed dynamic resource stack

One import now merges a runtime-selected list of manifests, any of which can fail to open.

Try it

Register each close immediately after its open succeeds. Fail on the third open and record the order and count of closes for the first two.

Stop here when

Keep a pair of ordinary nested scopes for two fixed inputs. A dynamic stack earns its place when resource counts vary.

05

Bounded Graceful Shutdown

The importer becomes a daemon. Deployment can interrupt one manifest while others are queued.

Try it

Stop accepting new imports, let one in-flight import finish to a deadline, then cancel and clean up. Interrupt it during a write and verify recovery from the last committed checkpoint.

Stop here when

A single bounded run already owned by its caller can use its existing cancellation and cleanup path.

Learning path

Choose how a reusable algorithm receives its policy

01

Filter by predicate

A job board returns every vacancy, then three separate screens repeat the same rule for hiding expired ones.

Try it

Write a visibility predicate over a vacancy and a supplied date. Exercise a vacancy closing today and decide whether the closing date is inclusive.

Stop here when

Keep a direct filter when every caller wants this one rule.

02

Higher-order function

Saved searches now use different eligibility rules but repeat the same scan and selection workflow.

Try it

Pass the eligibility function into the scan. Supply two rules in a test and count how many times each evaluates a vacancy.

Stop here when

One function parameter is enough while a policy is a single operation with no independent lifecycle.

03

Parametric polymorphism

A second team needs the same first-eligible operation for applicants and application slots. Their records share no meaningful parent type.

Try it

Give the operation one element type parameter and an element-to-boolean predicate. Try it on both record types and express an empty result explicitly.

Stop here when

Retain the concrete vacancy function if the second operation has different selection semantics.

04

Generic algorithm and concept

The operation must also work on a stream of candidates that cannot be indexed or rewound.

Try it

Specify the minimal input capability and return as soon as a candidate qualifies. Test with a one-pass input that rejects a second traversal.

Stop here when

Ask only for one-pass iteration if the algorithm never needs random access, ordering, or a collection hierarchy.

05

Strategy

A hiring campaign chooses a selection policy at runtime and each policy needs independently configured scoring behavior.

Try it

Install two interchangeable policies behind the same selection contract. Show that callers can switch policies without changing traversal, and compare a function implementation with a state-owning object.

Stop here when

Keep the function when one callable expresses the whole policy. Introduce an object when shared policy state or multiple operations justify it.

Learning path

Find a valid assignment and keep it valid at commit

01

Set-based join

A training center needs a report pairing instructors with the course sessions they are certified to teach.

Try it

Join sessions to certifications on course identity. Hand-check a tiny fixture containing two certified instructors and one session without any qualifying instructor.

Stop here when

Stop at the query for a planning report that people review and assign manually.

02

Semijoin / existence test

The coordinator now needs one row per session that has any available certified instructor. Multiple matches currently duplicate sessions.

Try it

Rewrite the eligibility test as an existence query and add a second matching instructor. Confirm the session appears once, even before anyone is assigned.

Stop here when

Keep a join when the output needs each instructor's name. Use existence when only eligibility matters.

03

Declarative integrity constraint

Two coordinators can book the same instructor into the same fixed time slot after both screens report availability.

Try it

Put uniqueness on instructor and slot in the authoritative assignment table and require non-null keys. Try two concurrent inserts and decide how the losing caller gets an updated choice.

Stop here when

For fixed slots, let a local uniqueness rule enforce this invariant. Variable-length overlapping intervals would require a different rule.

04

Constraint propagation

Finding a whole day's feasible assignments by hand becomes difficult when some sessions have only one qualified instructor.

Try it

Represent each session's eligible instructors as a finite domain. Fix a mandatory assignment and remove incompatible choices from overlapping sessions until nothing more is forced.

Stop here when

If propagation assigns every session, verify the resulting schedule and skip branching.

05

Constraint solver

Several feasible candidates remain after propagation, and picking the first one can leave another session unstaffed.

Try it

Encode qualification and slot conflicts as hard constraints. Construct a case where a greedy choice fails, find a feasible assignment, and rerun after removing the only substitute.

Stop here when

Use the solver for candidate schedules and recheck invariants when committing. Keep the manual assignment and database constraint while they meet planning needs.

Learning path

Publish coherent snapshots from a live simulation

01

Pure reducer

A conveyor simulator sometimes reports different bin counts when replaying a shift's sensor events.

Try it

Define the next count from the previous count and one event. Replay a short trace including a reset and compare every intermediate state.

Stop here when

A serial update function and a list of events suffice for a small deterministic simulation.

02

Structure of arrays

Profiling shows the simulator scans the position and velocity of every carrier while fetching cold maintenance fields.

Try it

Create separate position and velocity arrays keyed by a stable carrier index. Compare one simulation tick on the same input, including the cost of updating indices after a carrier is removed.

Stop here when

Keep ordinary records if field separation gives no material benefit under representative access patterns.

03

Double Buffer

A dashboard now observes some carriers before a tick and others after the same tick.

Try it

Write the next tick into a spare buffer, then publish the completed buffer in one synchronized handoff. Hold a reader across a later tick and specify when a buffer may safely be reused.

Stop here when

With one synchronous reader already scheduled between ticks, the timing guarantee may remove the need for a second buffer.

04

Single-writer ownership

Two sensor adapters sometimes update the same carrier during a tick, even with front and back buffers.

Try it

Route inputs to one simulation owner. Define the tie-break for simultaneous events and test it by interleaving sensor arrival with dashboard publication.

Stop here when

Keep one writer while it meets the tick deadline. Additional writers need a partition or synchronization rule.

05

Observable stream

A live display and a recorder need different reactions each time the simulation publishes a complete tick.

Try it

Expose completed ticks as a subscription and give each consumer an unsubscribe path. Disconnect and reconnect the display, then count callbacks and check buffer lifetimes.

Stop here when

A direct callback is enough for one synchronous observer with the same lifetime as its publisher.

06

Reactive Streams

A recorder stalls during disk rotation and a fast simulation accumulates unbounded queued snapshots.

Try it

Build a demand-aware subscription and test a subscriber that requests two items and then pauses. State where unrequested ticks go and whether the source can pause, the display can skip frames, or the recorder needs durable buffering.

Stop here when

Use explicit demand only when its contract fits the producer. A loss-tolerant dashboard can keep just the latest snapshot.

Practice

Casebook

Work through one design as the requirements change. Each case ends with an observable check.

Is reading a seat count a query, an action, or a reason to use CQRS?

A venue exposes a seat count, sells reservations and sends availability to partner venues. Which distinctions actually change the design?

When should a generic abstraction survive a design review?

A permit office proposes a repository with type parameters for the entity, key, filter and projection. Which parts genuinely vary?

When should a committed release create a durable event?

A label finalizes a recording release. Accounting must open a royalty account and independent partners want a release notice. What happens if a process crashes between those actions?

When can a supervised process accept useful work?

A label-print daemon for a sorting line receives print requests over a network socket. How should it start, admit work and stop without silently losing jobs?

Does changing a game's movement model require an object hierarchy?

A tactics game starts with a few movement rules and later adds mods, replays and large crowds. Which requirements affect rule representation and which affect runtime data layout?

Python 3 and SQLite

Two buyers see the last seat

Two readers see an available seat. Observe the difference between a valid preview and an atomic reservation.

Try it

Save the program as last_seat.py, or use the ready-made file in the downloadable package.

python3 last_seat.py

Expected behavior

Two previews see 1. A succeeds, B is rejected, and one committed booking remains.

View program
"""Two observed reads, followed by two competing claims in a fixed order."""
import sqlite3
from pathlib import Path
from tempfile import TemporaryDirectory


def preview(conn):
    return conn.execute("SELECT remaining FROM showing WHERE id = 1").fetchone()[0]


def claim(conn, buyer):
    with conn:
        changed = conn.execute(
            "UPDATE showing SET remaining = remaining - 1 WHERE id = 1 AND remaining > 0"
        ).rowcount
        if changed:
            conn.execute("INSERT INTO booking(buyer) VALUES (?)", (buyer,))
    return bool(changed)


def main():
    with TemporaryDirectory() as tmp:
        path = Path(tmp) / "cinema.db"
        a = sqlite3.connect(path)
        b = sqlite3.connect(path)
        try:
            a.executescript("""
                CREATE TABLE showing(id INTEGER PRIMARY KEY, remaining INTEGER NOT NULL CHECK(remaining >= 0));
                CREATE TABLE booking(buyer TEXT PRIMARY KEY);
                INSERT INTO showing VALUES (1, 1);
            """)
            seen = (preview(a), preview(b))
            assert seen == (1, 1)
            print(f"Preview A={seen[0]} B={seen[1]}")
            claims = (claim(a, "A"), claim(b, "B"))
            assert claims == (True, False)
            print(f"Claim A={claims[0]} B={claims[1]}")
            bookings = a.execute("SELECT COUNT(*) FROM booking").fetchone()[0]
            assert preview(b) == 0 and bookings == 1
            print(f"Remaining={preview(b)} bookings={bookings}")
        finally:
            a.close()
            b.close()


if __name__ == "__main__":
    main()

Explore these entries

Python 3 and SQLite

Relay interruption and duplicate delivery

Inject three failures across the publishing, relay and consumer boundaries and reconcile the local effects.

Try it

Save the program as outbox_replay.py, or use the ready-made file in the downloadable package.

python3 outbox_replay.py

Expected behavior

The failed release leaves zero outbox rows. The relay publishes twice and the consumer opens one royalty account.

View program
"""Named failure points exercise transaction and message-delivery boundaries."""
import sqlite3


class Interrupted(Exception):
    pass


def release(db, interrupt=False):
    with db:
        db.execute("INSERT INTO releases VALUES ('r1')")
        if interrupt:
            raise Interrupted
        db.execute("INSERT INTO outbox VALUES ('release:r1', 0)")


def relay(db, broker, interrupt=False):
    row = db.execute("SELECT id FROM outbox WHERE sent = 0").fetchone()
    if row:
        with broker:
            broker.execute("INSERT INTO deliveries(id) VALUES (?)", row)
        if interrupt:
            raise Interrupted
        with db:
            db.execute("UPDATE outbox SET sent = 1 WHERE id = ?", row)


def consume(db, key, interrupt=False):
    with db:
        first = db.execute("INSERT OR IGNORE INTO receipts VALUES (?)", (key,)).rowcount
        if first:
            if interrupt:
                raise Interrupted
            db.execute("UPDATE royalties SET accounts = accounts + 1")


def expect_interruption(action, *args):
    try:
        action(*args, interrupt=True)
    except Interrupted:
        return
    raise AssertionError("Expected injected failure")


def scalar(db, statement):
    return db.execute(statement).fetchone()[0]


def main():
    app, broker, ledger = [sqlite3.connect(":memory:") for _ in range(3)]
    try:
        app.executescript("CREATE TABLE releases(id TEXT PRIMARY KEY); CREATE TABLE outbox(id TEXT PRIMARY KEY, sent INTEGER);")
        broker.execute("CREATE TABLE deliveries(id TEXT)")
        ledger.executescript("CREATE TABLE receipts(id TEXT PRIMARY KEY); CREATE TABLE royalties(accounts INTEGER); INSERT INTO royalties VALUES (0);")
        expect_interruption(release, app)
        assert scalar(app, "SELECT COUNT(*) FROM releases") == scalar(app, "SELECT COUNT(*) FROM outbox") == 0
        print("Interrupted release: releases=0 outbox=0")
        release(app)
        expect_interruption(relay, app, broker)
        relay(app, broker)
        ids = [x[0] for x in broker.execute("SELECT id FROM deliveries ORDER BY rowid")]
        assert ids == ["release:r1", "release:r1"]
        print("Relay replay: deliveries=2 distinct events=1")
        expect_interruption(consume, ledger, ids[0])
        assert scalar(ledger, "SELECT COUNT(*) FROM receipts") == scalar(ledger, "SELECT accounts FROM royalties") == 0
        for key in ids:
            consume(ledger, key)
        assert scalar(ledger, "SELECT COUNT(*) FROM receipts") == scalar(ledger, "SELECT accounts FROM royalties") == 1
        print("After redelivery: receipts=1 royalty accounts opened=1")
    finally:
        for conn in (app, broker, ledger):
            conn.close()


if __name__ == "__main__":
    main()

Explore these entries

JavaScript (Node.js)

When a movement rule needs an extension point

Compare a closed switch, function registration and an object-based policy before and after a new mod adds a piece.

Try it

Save the program as movement.mjs, or use the ready-made file in the downloadable package.

node movement.mjs

Expected behavior

Three representations agree on 98 closed cases. The registries accept a new policy and the unchanged switch rejects it.

View program
import assert from "node:assert/strict";

const rook = (dx, dy) => (dx === 0) !== (dy === 0);
const knight = (dx, dy) => Math.abs(dx) * Math.abs(dy) === 2;
function closedRule(name, dx, dy) {
  switch (name) {
    case "rook": return rook(dx, dy);
    case "knight": return knight(dx, dy);
    default: throw new Error("Unknown piece kind");
  }
}
const registry = new Map([["rook", rook], ["knight", knight]]);
const objectRules = new Map([...registry].map(([kind, allows]) => [kind, {allows}]));

for (const kind of ["rook", "knight"]) {
  for (let dx = -3; dx <= 3; dx++) {
    for (let dy = -3; dy <= 3; dy++) {
      const expected = closedRule(kind, dx, dy);
      assert.equal(registry.get(kind)(dx, dy), expected);
      assert.equal(objectRules.get(kind).allows(dx, dy), expected);
    }
  }
}
assert.equal(closedRule("knight", 2, 1), true);
assert.equal(closedRule("knight", 2, 2), false);
assert.equal(closedRule("rook", 0, 0), false);
console.log("Closed cases: switch, functions and objects agree on 98 trials");

class LimitedDiagonal {
  constructor(limit) { this.limit = limit; }
  allows(dx, dy) { return dx !== 0 && Math.abs(dx) === Math.abs(dy) && Math.abs(dx) <= this.limit; }
  describe() { return "diagonal up to " + this.limit + " squares"; }
}
const plugin = new LimitedDiagonal(2);
objectRules.set("scout", plugin);
registry.set("scout", (dx, dy) => plugin.allows(dx, dy));
assert.throws(() => closedRule("scout", 1, 1), /Unknown/);
assert.equal(registry.get("scout")(1, 1), true);
assert.equal(objectRules.get("scout").allows(3, 3), false);
console.log("New policy: registration succeeds; closed switch rejects unknown kind");
console.log("Configured object: " + objectRules.get("scout").describe());

Explore these entries

Practice

Runnable design labs

Run the examples locally. Each uses a standard runtime and checks its own result.

Python 3 and SQLite

Two buyers see the last seat

Two readers see an available seat. Observe the difference between a valid preview and an atomic reservation.

Python 3 and SQLite

Relay interruption and duplicate delivery

Inject three failures across the publishing, relay and consumer boundaries and reconcile the local effects.

JavaScript (Node.js)

When a movement rule needs an extension point

Compare a closed switch, function registration and an object-based policy before and after a new mod adds a piece.

Worked case

Is reading a seat count a query, an action, or a reason to use CQRS?

A venue exposes a seat count, sells reservations and sends availability to partner venues. Which distinctions actually change the design?

Starting design

For a small booking desk, one transactional booking model can serve both edits and the seating screen. Reading the current stock is a query in the API's command–query vocabulary. It is also an action in functional reasoning because another purchase can change the result between calls. These two labels describe different properties of the same operation.

01

The desk introduces a standby quota, and the rule is hard to test against a changing clock and database.

Read inventory and policy once in the shell. Pass those snapshots and the requested party size into a calculation that decides whether a reservation fits. Revalidate at the transaction boundary before committing.

A deterministic calculation is easy to replay, but an earlier availability snapshot cannot guarantee that the sale will succeed.

02

A reservation claim must both change the seat allocation and return a confirmation.

Make the claim atomic and return its receipt. Keep a separate side-effect-free operation for previewing eligibility.

Splitting the claim into an availability check followed by an unguarded write would let simultaneous buyers claim the same seat.

03

Partners require a zone-by-zone summary while booking rules change on a different schedule.

Consider a distinct read model over the same database. Introduce asynchronous projection only when measured pressure and a freshness agreement justify it.

A request dispatcher supplies neither a distinct model nor a freshness guarantee.

Check the decision

Hold one seat, place two competing claims, and change the clock between previews. Verify one confirmed sale, repeatable pure calculations for the same inputs, and the documented behavior of any stale partner display.

Explore these entries

Worked case

When should a generic abstraction survive a design review?

A permit office proposes a repository with type parameters for the entity, key, filter and projection. Which parts genuinely vary?

Starting design

Begin with the actual call the office needs: find permits expiring before a supplied date. A named query returning permit summaries expresses its intent, authorization scope and ordering. Four type parameters allow numerous combinations the office has never requested and may never want to support.

01

Permit and inspection screens need the same continuation-token protocol while returning different item types.

Share a typed page and its continuation-token rules. Each query keeps its own authorization and filter semantics.

The abstraction earns its parameter by preserving item types. A token meaningful to one query must still be rejected by the other.

02

Three screens need to sort different records according to caller-supplied rules.

Keep the sorting algorithm generic and pass the comparison function as an argument. Document required ordering properties.

A type checker may verify the comparison signature while accepting an inconsistent ordering rule.

03

One ranking policy now has dependencies, keeps explanatory evidence and is selected for an entire review session.

Give that policy an object with a small contract. Keep the ordinary named permit query and the reusable page type.

Object-based Strategy makes the session's behavior explicit, but a class per trivial comparison would obscure the common path.

Check the decision

Ask the reviewer to name one invalid use prevented by each proposed type parameter. Run paging tests for both record types, exercise an unreliable comparator, and inspect whether the permit use case is still recognizable at the call site.

Explore these entries

Worked case

When should a committed release create a durable event?

A label finalizes a recording release. Accounting must open a royalty account and independent partners want a release notice. What happens if a process crashes between those actions?

Starting design

If publication only updates a screen inside the editor, a direct in-process notification after a successful change may meet the requirement. There is no need for a durable subscriber merely to refresh a screen that can reload the release on startup.

01

Several partner systems now require independent copies of every release.

Publish a release fact to separate subscriptions. Competing workers can share the work within a subscription that processes recordings independently.

Subscriber progress and retention must be monitored separately. Parallel workers may complete recordings in a different order.

02

Accounting may miss a fact if the publishing process crashes between committing the release and sending the message.

Store an outbox record in the same local transaction as the release. A relay retries publication after the process recovers.

A relay crash after sending but before recording success can produce a duplicate. Downstream consumers must expect redelivery.

03

Royalty account creation includes a call to a partner outside the accounting database.

Deduplicate the local change atomically with the message ID. Use the partner's idempotency contract or reconcile the partner operation by a durable business key before retrying.

A local deduplication table cannot make an external action atomic. Without partner support, an uncertain outcome needs reconciliation or manual handling.

Check the decision

Crash the publisher before and after commit, crash the relay immediately after send, and drop the partner response after the partner accepts the operation. Count durable releases, outbox entries, local royalty accounts and actual partner accounts separately.

Explore these entries

Worked case

When can a supervised process accept useful work?

A label-print daemon for a sorting line receives print requests over a network socket. How should it start, admit work and stop without silently losing jobs?

Starting design

For an attended printer, a foreground process can serve requests and exit on failure. For an unattended sorting line, start it under a supervisor and let the supervisor own restart policy and process identity. The mere existence of its PID shows only that the executable has begun.

01

Clients can send jobs as soon as the line starts, but the daemon still needs to check its spool and attach the printer.

A service manager can own the listening socket and pass it to the daemon. Advertise application readiness only when the daemon can apply its stated acceptance policy.

A queued connection proves neither that a job has been accepted nor that paper can be printed. Define whether durable spooling counts as acceptance.

02

The process remains alive while its worker loop is stuck.

Drive a service watchdog from meaningful progress of the monitored loop, and keep hardware or downstream reachability separate from process liveness.

A heartbeat emitted by an unrelated thread can hide deadlock. Restarting every process during a shared printer outage can worsen recovery.

03

Rolling upgrades interrupt in-flight labels.

Withdraw readiness, stop admission, drain until a deadline, and persist or explicitly reject outstanding jobs before exit.

A printed label followed by a lost acknowledgement creates uncertainty about the physical effect. Record job identity and plan operator reconciliation.

Check the decision

Start the daemon with an unavailable printer, freeze its worker, and send a stop signal during a print. For each run, compare connection status, readiness, durable job status, actual labels and restart behavior.

Explore these entries

Worked case

Does changing a game's movement model require an object hierarchy?

A tactics game starts with a few movement rules and later adds mods, replays and large crowds. Which requirements affect rule representation and which affect runtime data layout?

Starting design

For a closed set of pieces, a direct function taking a piece kind, a position and a proposed destination can be easy to inspect. The baseline can expose a complete list of cases and return an explanation for an illegal move. Keep it while this representation makes changes inexpensive and stays inside the measured frame budget.

01

Mods must supply new movement behavior independently of the base game.

Let mods register a movement function or Strategy object under a stable contract. Choose an object when a policy has its own configuration, state or several related operations.

Loading untrusted or incompatible extensions requires an explicit compatibility and isolation policy.

02

A replay diverges when drawing the same match on slower hardware.

Advance simulation with explicit, fixed-duration steps and recorded input ordering. Make random seeds and other nondeterministic inputs reproducible.

A fixed timestep alone cannot guarantee deterministic replay across different numeric implementations or nondeterministic iteration orders.

03

Profiling shows that updating independent crowd positions dominates simulation time.

Group position and velocity data for batch updates, and consider an ECS movement system. Keep mod policy decisions and high-volume integration separate where their workloads differ.

Component storage and scheduling bring structural-change and ownership costs. Interactions crossing entities can prevent safe parallel writes.

Check the decision

Replay a captured input stream at different render rates and compare simulation state at fixed ticks. Profile an agreed crowd scene before and after the storage change, including memory, update time and cost of adding one new rule.

Explore these entries

Research

Source index

Source links identify literature for the underlying concepts. Retrieval labels describe the supplied source ledger, whose check dates are unavailable; they do not establish review of each claim. Scenarios, countercases, design comparisons and exercises are authored teaching examples, not production case reports or benchmarks.

12factor.net (1)
airflow.apache.org (1)
alistair.cockburn.us (1)
allthingsdistributed.com (1)
amazon.science (1)
aosabook.org (1)
arxiv.org (2)
aws.amazon.com (3)
beam.apache.org (1)
blog.cleancoder.com (1)
cidrdb.org (1)
clojure.org (2)
cloud.google.com (1)
cs.cmu.edu (1)
cs.tufts.edu (1)
csrc.nist.gov (4)
dafny.org (1)
debezium.io (1)
destroyallsoftware.com (1)
developer.android.com (2)
developers.google.com (1)
doc.rust-lang.org (5)
docs.aws.amazon.com (2)
docs.camunda.io (7)
docs.dask.org (1)
docs.feast.dev (1)
docs.kernel.org (3)
docs.nvidia.com (1)
docs.oasis-open.org (1)
docs.oracle.com (2)
docs.python.org (3)
docs.racket-lang.org (2)
docs.spring.io (1)
docs.temporal.io (2)
docs.unity.cn (1)
docs.zephyrproject.org (2)
domainlanguage.com (1)
dre.vanderbilt.edu (8)
enterpriseintegrationpatterns.com (20)
ericnormand.me (1)
erlang.org (2)
freedesktop.org (4)
fsharpforfunandprofit.com (2)
gafferongames.com (1)
gameprogrammingpatterns.com (3)
github.com (2)
go.dev (2)
guide.elm-lang.org (1)
haskell.org (2)
hpc.llnl.gov (1)
ibm.com (1)
ics.uci.edu (2)
incose.onlinelibrary.wiley.com (1)
informit.com (3)
inkandswitch.com (1)
intel.com (1)
isocpp.github.io (1)
istio.io (2)
jeffreypalermo.com (1)
jmlr.org (1)
kernel.org (1)
kimballgroup.com (2)
kubernetes.io (3)
learn.microsoft.com (28)
llvm.org (1)
lmax-exchange.github.io (1)
man7.org (1)
martin.kleppmann.com (1)
martinfowler.com (45)
metalevel.at (1)
microservices.io (17)
mitp-content-server.mit.edu (1)
nathanmarz.com (1)
opengitops.dev (1)
openmp.org (1)
openpolicyagent.org (1)
opentelemetry.io (2)
oreilly.com (6)
osl.cs.illinois.edu (1)
pdos.csail.mit.edu (1)
peps.python.org (1)
petsc.org (1)
postgresql.org (4)
proceedings.mlr.press (1)
ptolemy.berkeley.edu (2)
pure.tue.nl (1)
qnx.com (1)
reactive-streams.org (1)
reactivex.io (1)
redux.js.org (1)
refactoring.com (3)
refactoring.guru (22)
research.google (2)
research.tue.nl (1)
rfc-editor.org (8)
samnewman.io (1)
sei.cmu.edu (1)
sel4.systems (1)
smallmemory.charlesweir.com (1)
souffle-lang.github.io (1)
spiffe.io (1)
sre.google (2)
state-machine.com (1)
stepanovpapers.com (1)
swi-prolog.org (1)
typescriptlang.org (1)
usenix.org (2)
web.mit.edu (1)

Areas for further research

Field guide to software design

Gevawo Patterns

Choose a design by its scope, tradeoffs and the guarantees your system needs.

Open the glossary Find a decision

Start with a design decision

Take the guide with you

Download the catalog and runnable labs (ZIP). Includes the offline reader, Markdown articles, JSON, SQLite and local examples.