skip to content

Architectural Styles (Catalog)

A pointer into the catalogue of named macro-structures — layered, hexagonal, event-driven, microkernel, CQRS, space-based, microservices — with the emphasis on choosing one from your quality-attribute drivers. Full treatment of each style lives in the architectural-styles area.

part ofSoftware design & architectureoverview, primer and where to startread it →
on this pageshow

questions

6

In software architecture, what is an architectural style (such as layered, event-driven, or microservices), and how does it differ from a design pattern?

level: juniorimportance: must knowfreq 62%

answer

  1. Style = components + connectors + constraints
  2. Macro vs micro scope
  3. Styles buy quality attributes
  4. Hard to reverse = architecture
  5. Real systems are hybrids

basics

~20 s

An architectural style is a named, whole-system shape — how the big pieces are split and how they talk (layered, event-driven, microservices). A design pattern is a small, local solution inside one piece (e.g. Strategy, Observer). Style = macro, pattern = micro.

solid answer

~50 s

An architectural style is a named macro-structure: a vocabulary of component types, the connectors between them, and the constraints on how they may be wired. "Layered" constrains calls to flow downward through layers; "event-driven" constrains components to communicate through asynchronous messages instead of direct calls; "microservices" constrains each service to be independently deployable with its own data. A design pattern is a much smaller, localized solution — Strategy, Observer, Repository — that lives inside one component and does not decide the system's deployment or communication topology. The practical differences: styles are chosen once (and are expensive to reverse), they determine which quality attributes you can achieve (scalability, deployability, fault isolation), and they are usually combined rather than used purely. Patterns are cheap, local, and reversible in an afternoon. A useful test: if changing the decision changes how you deploy, scale, or fail, it is architecture; if it only changes code inside one deployable, it is a pattern.

go deeper

for a junior

State the scope difference plainly — style shapes the whole system, pattern solves a local problem — and name one or two of each correctly.

for a middle

Add the defining constraint of each style you name and note that styles determine quality attributes while patterns mostly affect internal code quality.

for a senior

Frame it by cost of reversal and by which quality attributes each style buys and sells; mention that pure styles are rare and hybrids are normal.

for a principal

Discuss vocabulary inconsistency across sources, the Conway's-law coupling between style and org, how you keep style decisions explicit (ADRs, fitness functions) and reversible where possible.

### Definitions from scratch **Component** — a runtime or build-time unit of the system you can name and reason about: a module, a service, a layer, a plugin. **Connector** — the mechanism by which components interact: an in-process method call, an HTTP request, a message on a queue, a shared database, a file drop. **Constraint** — a rule about what wiring is *allowed*. Constraints are what make a style a style; without them you just have "some boxes and some arrows". An **architectural style** (also called an architecture pattern in some books) = component types + connector types + constraints, given a name so a team can say one word instead of drawing a diagram. Examples in the standard catalog: | Style | Components | Connectors | Core constraint | |---|---|---|---| | **Layered (n-tier)** | presentation / business / persistence / database layers | in-process calls | calls go downward only; a layer knows only the layer beneath it | | **Hexagonal (ports & adapters)** | domain core, ports (interfaces), adapters | calls through ports | all dependencies point *inward* toward the domain; the core knows no technology | | **Event-driven** | event producers, processors, broker or mediator | asynchronous events/messages | producers do not know consumers; communication is fire-and-forget | | **Microkernel (plugin)** | minimal core system + plugins | plugin contract/registry | domain-varying behavior lives only in plugins; the core stays generic | | **CQRS** | command (write) model, query (read) model | separate paths, often events between them | reads and writes use different models/stores | | **Space-based** | processing units holding in-memory replicated data + messaging grid | replication + messaging | no central database on the hot path; scale by adding identical units | | **Microservices** | independently deployable services, each owning its data | network calls / events | a service may not reach into another's database; deploy independently | A **design pattern** operates one or more levels down. Strategy swaps an algorithm behind an interface. Observer notifies subscribers inside a process. Repository hides persistence behind a collection-like interface. Circuit Breaker wraps a remote call. These are choices *inside* a component, expressible in a class diagram, and they do not change the deployment topology. ### Why the distinction matters practically 1. **Cost of reversal.** Ralph Johnson's often-quoted line — architecture is "the decisions you wish you could get right early because they are perceived as hard to change" — captures it. Swapping Strategy for a lookup table is a refactor; converting a monolith into microservices is a program of work spanning data ownership, deployment, monitoring, and org structure. 2. **Quality attributes.** Styles are how you *buy* quality attributes: microservices buy independent deployability and fault isolation and pay in latency and operational complexity; layered buys simplicity and low cost and pays in poor scalability and slow change; event-driven buys elasticity and decoupling and pays in eventual consistency and hard debugging. Patterns rarely move a system-level quality attribute on their own. 3. **Vocabulary.** Naming the style compresses a huge amount of shared expectation. Saying "we're hexagonal" tells a new engineer where the database code lives and which way the dependency arrows point, without a tour. ### Edge cases and nuance - **Terminology is not standardized.** Some authors (Richards & Ford) say *architecture style*; the POSA series says *architectural pattern*; Fowler's *Patterns of Enterprise Application Architecture* mixes granularities. Do not let vocabulary policing hide the real question of scope. - **Some things sit in between.** CQRS, saga, and API gateway are structural enough to constrain a system yet small enough to apply to one bounded context. Treat scope, not the label, as the discriminator. - **Pure styles are rare.** Real systems are hybrids: microservices *internally* organized hexagonally, with an event-driven backbone and CQRS in the two contexts whose read load justifies it. The catalog is a menu, not a set of religions. - **Style ≠ topology diagram.** A drawing without constraints is not a style; the constraints are what let you predict behavior ("a request can never skip a layer", "a service can never read another's tables"). ### Answering the question well Give the scope contrast (system-wide vs local), name two or three styles with their *constraint* (not just their name), name two patterns, and close with the reversibility/quality-attribute test. Mentioning that real systems combine styles shows you have shipped one.

  • Give an example where the same design pattern appears in two different architectural styles.
    Repository appears inside a layered monolith's persistence layer and inside a microservice's domain core; the pattern is identical, while the style decides whether that repository talks to a shared corporate database or to a database owned solely by that service.
  • Is 'microservices' a style or an organizational choice?
    Both, and that is the point. Its technical constraint is independent deployability plus private data, but the constraint only pays off if teams are aligned to services (Conway's law). A microservices topology run by one central team usually gets the costs without the benefits — a distributed monolith.
  • How would you record the choice of a style so it survives staff turnover?
    An Architecture Decision Record: context and the ranked quality-attribute drivers, the options considered, the decision, and the consequences accepted. It is the artifact that stops the next team from re-litigating or, worse, silently violating the constraint.

A style is the building type — apartment block, warehouse, hospital — which fixes the floorplan, load paths, and how people move through it. A design pattern is a fixture choice inside a room: a sliding door instead of a hinged one. You can swap the door on Saturday; converting the warehouse into a hospital is a different project.

context

open as a page

How do you pick an architectural style (layered, hexagonal, event-driven, microkernel, CQRS, space-based, microservices) from quality-attribute drivers rather than from fashion?

level: middleimportance: must knowfreq 72%

basics

~20 s

Start from the two or three qualities that matter most — say, deployability and fault isolation, or simplicity and cost — rank them, and pick the style that scores highest on those while accepting its known weaknesses. Every style trades some qualities away; none wins everywhere.

open as a page

When does an event-driven architecture beat synchronous request/response, and what does that choice cost you?

level: seniorimportance: must knowfreq 68%

basics

~20 s

Choose event-driven when a producer should not wait for, or even know about, its consumers — bursty load, many independent reactions to one fact, long-running work. You pay with eventual consistency, harder debugging, duplicate and out-of-order messages, and error handling that is no longer a simple exception.

open as a page

Compare layered (n-tier) architecture with hexagonal architecture (ports and adapters): which way do dependencies point in each, and which quality attributes does each optimize?

level: middleimportance: should knowfreq 58%

basics

~20 s

In layered architecture, calls flow downward — UI depends on business logic, which depends on the database layer, so the domain ends up depending on infrastructure. In hexagonal, all dependencies point inward to the domain; the database and UI are interchangeable adapters plugged into interfaces (ports).

open as a page

What problem does CQRS (Command Query Responsibility Segregation) solve, what does it not require, and when is it not worth adopting?

level: seniorimportance: should knowfreq 52%

basics

~20 s

CQRS splits the write side (commands that change state) from the read side (queries), letting each use its own model and store. It helps when reads and writes have very different shapes or volumes. It does not require event sourcing, and for ordinary CRUD it is pure overhead.

open as a page

Which quality-attribute drivers point specifically to microkernel (plugin) or space-based architecture, and how do you responsibly combine several architectural styles into one hybrid system?

level: principalimportance: nice to knowfreq 34%

basics

~20 s

Microkernel fits when behavior varies a lot per customer, region, or product and must be extended without touching the core — a small core plus plugins. Space-based fits when huge, unpredictable user spikes make a central database the bottleneck: keep data in replicated memory instead. Combine styles by scope, not by blending them everywhere.

open as a page