Architectural patterns define how a system’s components are organized, how data flows between them, and where the boundaries of responsibility lie. They matter because choosing the wrong boundary or data flow shape creates problems that no amount of refactoring within a component can fix — the pain shows up as coupling, consistency bugs, and scaling walls.

The three patterns here compose naturally: Domain-Driven Design establishes bounded contexts and a shared language so the code matches the business domain. CQRS separates the read path from the write path so each can be optimized independently. Event Sourcing stores state as an immutable event stream, giving you audit trails, temporal queries, and the ability to rebuild read models from history. You can use DDD without CQRS, and CQRS without Event Sourcing, but in complex domains teams often adopt all three because each one solves a problem the others expose.

Integration and data-flow patterns by failure and coupling

First identify what must vary. An API gateway, request-response call, and publish-subscribe topology decide how components interact. Streaming, batching, and ETL decide how data moves and when it becomes visible. Event Sourcing decides how state is recorded and reconstructed. Orchestration decides who owns a multi-step workflow. They can coexist; treating the nine labels below as mutually exclusive choices mixes different design layers.

NeedPreferCoupling and orderingFailure ownerOperational cost
Immediate answer from one dependencyRequest-responseCaller knows the callee; ordering follows the callCaller owns timeout, retry budget, and fallbackLow until fan-out or tail latency grows
One fact delivered to many consumersPublish-subscribeProducers know the contract, not consumers; per-key ordering is broker-specificBroker and each consumer own delivery, lag, and idempotencyMedium: topics, schemas, replay, and dead letters
Continuous high-volume processingStreamingConsumers depend on stream contracts and partitioningPipeline owns checkpoints, backpressure, and replayHigh: state stores, lag, and repartitioning
Periodic bounded processingBatching or ETLJobs couple to input/output schemas, not request latencyScheduler owns retries and partial-run recoveryMedium: windows, staging, and reruns
Auditable state reconstructed from historyEvent SourcingAggregate depends on ordered immutable eventsEvent store owns append order; projectors own replayHigh: schema evolution and projections
Coordinated multi-step business processOrchestrationSteps couple to an explicit workflow contractOrchestrator owns compensation and progressMedium to high: durable state and recovery

The selection rule is failure ownership: choose the shape whose operator can explain where a failed item waits, who retries it, whether order matters, and how processing resumes without duplicating side effects.

Architecture selection matrix

The families below also overlap. A service can use hexagonal boundaries internally, publish events, expose a client-server API, and deploy as one monolith or several services. A diagram labels a dominant organizing idea; it does not grant independent deployment or fault tolerance by itself.

PatternPrimary boundaryChange cost it reducesCost it introducesUse when
LayeredTechnical responsibilityReplacing presentation or persistence behind stable interfacesCross-layer changes and pass-through codeDomain is straightforward and team boundaries follow layers
MicroservicesIndependently owned business capabilityDeploying and scaling one capability without the whole systemNetwork failure, data ownership, and platform overheadTeam autonomy and uneven scaling justify distributed operations
Event-drivenEvent contract and asynchronous consumerAdding consumers without changing the producerEventual consistency, ordering, and replay workProducers should not wait for every downstream reaction
Client-serverRequest contract between consumer and serviceEvolving clients and server behind a stable protocolCompatibility and availability couplingA central service owns data or policy for many clients
PluginStable host extension pointAdding optional capabilities without changing the coreVersioned extension contracts and isolationFeatures are independently installable or supplied by third parties
HexagonalDomain ports versus infrastructure adaptersReplacing databases, transports, and frameworks around domain logicMore interfaces and mapping codeDomain rules must remain testable and independent of infrastructure

References

6 items under this folder.