Layered Architecture
The default shape, its clarity, and where a technical partition fails.
4 to work through
-
beginner Multiple choice
A design has four layers. The service layer contains no logic - it forwards every call from the controller to the repository. What would you change?
2 min answer -
beginner
A team's rule is that the domain layer must not import the persistence layer. Today the rule lives in a wiki page and in code review. What changes when the same rule becomes a check that fails the build, and what does the violation count over time tell you that today's count does not?
3 min answer -
intermediate
A layered architecture is described as outdated. When is it still the right choice, and what is its real limitation?
2 min answer -
intermediate
A team applies a strict layered architecture and finds every change touches nine files. Is layering wrong, or is the application wrong?
2 min answer
3 terms in this topic
Architecture Sinkhole
A request that passes through every layer of a layered architecture without any layer adding logic, indicating that the layering is pure overhead for…
practiceLayer Enforcement Ratchet
Gating a layering rule on a recorded baseline of existing violations that may shrink but never grow, so an architectural boundary becomes mechanical …
patternLayered Architecture
Organising a system into horizontal layers with a strict dependency direction — the default structure, valuable for its constraint rather than its shape.
Neighbouring topics
Architecture Patterns
General material on architectural patterns and their trade-offs.
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.