Architecture Patterns
General material on architectural patterns and their trade-offs.
4 to work through
-
intermediate
Design a URL shortener handling 100 million new links per month and 10 billion redirects. Where is the real difficulty?
2 min answer -
intermediate Multiple choice
Orders must trigger inventory reservation, a confirmation email, an analytics record and a fraud check. Queue, topic, or both — and what breaks if you choose wrong?
2 min answer -
advanced
A design review proposes a system using service discovery, a message broker, CQRS, event sourcing and distributed locks for a workload expected to have a few thousand users. What would you simplify, and how would you justify it?
2 min answer -
advanced Multiple choice
Prime Video reported a 90% cost cut by consolidating a serverless distributed service into one process. Does that mean microservices were the wrong choice, and what is the actual decision rule?
2 min answer
12 terms in this topic
Backend for Frontend
A separate, narrow backend per client experience, which aggregates and reshapes downstream services for exactly that client's needs.
patternEvent-Driven Architecture
A style in which components communicate by emitting and reacting to facts about what happened, rather than by calling each other.
patternHexagonal Architecture
Putting the domain at the centre and letting everything external — UI, database, queues — attach through ports implemented by replaceable adapters.
patternLayered Architecture
Organising code into horizontal layers — presentation, application, domain, data — where each layer may only call the one beneath it.
patternModular Monolith
A single deployable unit internally partitioned into modules with enforced boundaries, explicit interfaces and no shared internal state.
patternPipes and Filters
Decomposing processing into independent steps connected by channels, each transforming its input and passing it on.
case-studyPrime Video's Move Back to a Monolith
Amazon Prime Video consolidated a serverless, distributed audio/video monitoring service into a single process and reported a 90% cost reduction — th…
patternPublish/Subscribe
A messaging pattern where each published message is delivered to every interested subscriber, rather than to one competing worker.
toolService Mesh
An infrastructure layer of sidecar proxies that handles service-to-service networking — mTLS, retries, timeouts, routing, telemetry — outside the app…
case-studyShopify's Pods and Modular Monolith
Shopify handles Black Friday scale with isolated pods — complete stacks each serving a subset of merchants — while keeping the application itself a d…
patternSidecar
Deploying a helper process alongside the main application in the same unit, to supply cross-cutting behaviour without changing the application.
patternStrangler Fig
Replacing a legacy system incrementally by routing individual capabilities to new implementations behind a facade, until nothing routes to the old system.
Neighbouring topics
Layered Architecture
The default shape, its clarity, and where a technical partition fails.
Event-Driven Architecture
Publishing facts, and trading comprehensibility for decoupling.
Pipes and Filters
Independent transformation steps composed into a pipeline.
Publish/Subscribe
Broadcast to every subscriber, as distinct from work distribution.
Competing Consumers
Scaling throughput with instances, at the cost of ordering.
Saga
Local transactions with compensating actions across services.
CQRS
Separate models for writing and reading, each optimised for its job.
Event Sourcing
The event log as the system of record, with state as a projection.
Outbox
Making the event atomic with the business write it describes.
Strangler Fig
Incremental replacement behind a routing facade.
Anti-Corruption Layer
Translating a foreign model at the boundary so it does not leak in.
Sidecar & Ambassador
Cross-cutting behaviour in a co-deployed process.
Service Mesh
Sidecars applied estate-wide, and the scale at which that pays.
API Gateway
A single entry point for policy, routing and protocol translation.
Backend for Frontend
A narrow backend per client experience, owned by that client's team.
Cell-Based Architecture
Complete isolated copies each serving a subset of customers.
Sharding Patterns
Directory versus embedded keys, logical shards and rebalancing.
Materialized Views
Precomputed query results, refreshed incrementally or in full.
Orchestration vs Choreography
A coordinator that knows the flow, or services that react to events.