Bookmarks

Architectural style

A repeatable way of organising a system as a whole: which major parts it is split into, how those parts are connected and which rules of their interconnection must not be broken.

Also: software architectural style

checked 8 Nov

All terms

A style is a standard framework for how a system is put together: it says what counts as the major parts and how to connect them, but does not describe any particular system. Choosing a style is one of the first architectural decisions and the hardest one to change later: a monolith does not turn into microservices with a single refactoring.

What a style specifies

By the definition from Roy Fielding’s dissertation, a style is a coordinated set of architectural constraints that determines the roles of elements and the relationships allowed between them. For example:

  • components — major roles: a client, a server, a data store, a service, a gateway;
  • connectors — ways of communicating: a function call, an HTTP request, a message queue, an event stream;
  • constraints — rules that any system in the style must obey: “a layer talks only to its neighbours”, “services do not read each other’s databases directly”.

How a style differs from a pattern

A style describes the system as a whole, while a design pattern is a repeatable solution to a local problem within modules and classes. Styles and patterns work together: in a system built in the microservices style, an individual service may apply the transactional outbox pattern, while a monolith has a layered structure inside.

CriterionStyleDesign pattern
Scalethe whole system and its major partsa module, classes, a single task
What it definesa framework: which parts exist and which links are alloweda ready-made solution to a recurring problem
Examplemonolith, microservices, event-driven architecturetransactional outbox, repository

Examples of styles

StyleIdeaWhen it is used
Monoliththe whole system is a single deployable unita small team, early stages of a product
Layeredlayers for presentation, logic and data accesstypical enterprise applications
Hexagonalthe core with the logic is separated from the outside world by ports and adapterscomplex business logic, testability matters
Microservicesmany small services connected over the networklarge teams, independent deployments
Event-drivencomponents exchange events through a brokerevent flows, loose coupling between parts

Where the term comes from

One of the first definitions of a style was given by Dewayne Perry and Alexander Wolf in a 1992 paper. In 2000, Roy Fielding showed in his dissertation that REST is assembled from the constraints of several well-known styles — that is how the style became a working concept for web development as well.

Sources

the term is written from these pages

Verified 8 Nov

Not to be confused with

what it is mixed up with and how it differs

  • design patterns

    A design pattern solves a recurring problem within a module or classes; a style defines the framework of the whole system.

  • software architecture

    Architecture describes how a particular system is built; a style is a standard way of organising it, from which that structure is assembled.

In depth in the references

where the topic is covered in detail