My account

More Architecture Styles and How to Choose One

Besides the monolith, the modular monolith and microservices, there are other well-known styles: layered, pipeline, microkernel, service-based, event-driven, space-based and orchestration-driven. Each one is good at a few characteristics and bad at others. Choose by starting from measurable scenarios and limits, compare two or three real candidates, test the riskiest guess, and write an ADR with a review date.

Not reviewedWritten with AI helpReading time: 16 minOnline shop exampleEight stylesA simple choosing process

Author: bezzad

Contents

The problem: “Monolith or microservices?” is too small a question

In the lesson on architecture styles we compared the monolith, the modular monolith and microservices. In real projects, you will meet more styles. Some parts of our online shop do not fit any of those three well:

  • A nightly job imports 2 million prices from suppliers.
  • Checkout must calculate tax differently in each country, and we add countries every year.
  • A flash sale sends 200 times the normal traffic for ten minutes.

Each of these has a style that fits it better. A good architect knows the main styles, knows what each one is good and bad at, and chooses with evidence.

Two big families

One deploy unitsimple to run, scales as oneLayeredUI, logic, data on top of each otherModular monolithone module per business areaPipelinedata flows through small stepsMicrokernela small core plus plug-insMany deploy unitsscale and release parts alone, but the network costsService-baseda few big servicesEvent-drivenreact to eventsSpace-baseddata in memory, huge peaksOrchestration (SOA)a central bus runs flowsMicroservicesmany small, independent
Styles with one deploy unit are simpler to run. Styles with many deploy units can release and scale parts alone, but pay for the network.
  1. One deploy unit (monolithic). One app, one release. Simple to build, test, debug and run. But it scales and releases as one piece.
  2. Many deploy units (distributed). Several apps that talk over the network. Parts can scale and release alone. But every call can be slow or fail, and data is harder to keep consistent.

One more axis: how is the code split?

Split by technical layerWeb / UI layerBusiness layerData layer"Add gift wrap" touches all 3 layers(often 3 teams)Split by business areaCatalogOrderPayment"Add gift wrap" stays inside Order(layers live inside each part)
Same feature, two ways of splitting. When the split follows the business, a business change stays in one place.
  • Technical partitioning. The top-level split is by technical role: UI, business logic, data access. Easy to understand for developers. But a business change (“add gift wrap”) usually touches every layer.
  • Domain partitioning. The top-level split is by business area: Catalog, Order, Payment. A business change usually stays in one part. Inside each part, you can still have layers.

Most modern styles prefer domain partitioning at the top. Keep this axis in mind for every style below.

The styles, one by one

Layered

Code is in horizontal layers: presentation, business, persistence, database. A request goes down through the layers and back up.

  • Good at: simplicity, low cost, a familiar structure for new developers. A fine start for small apps.
  • Bad at: scale (it scales as one piece), deployability (one change, full release), and business changes that cross all layers.
  • Watch for the “sinkhole”. If most requests only pass through layers without doing any work, the layers cost more than they give.

Modular monolith

One deploy unit, split by business area into modules with clear contracts. We studied it in the architecture styles lesson. It is often the best default for a new product and a small or medium team.

Pipeline (pipes and filters)

Data flows through a line of small steps. Each step (filter) does one job and passes its output to the next through a pipe.

Pipeline: the nightly price importRead fileproducerCheck rowstesterConvert pricestransformerSaveconsumerEach step does one job and does not know the others.Microkernel: checkout with tax plug-insCheckout coresame for every countryTax: GermanyTax: FranceTax: IranNew country?Add a plug-in; the core does not change.
Top: a pipeline of small steps. Bottom: a small core that stays the same while plug-ins add country rules.
  • Step types: a producer starts the flow, a tester checks and maybe drops data, a transformer changes it, a consumer ends it.
  • Good at: one-way data processing: imports, exports, reports, compilers, shell commands, ETL jobs. Steps are easy to test and reuse.
  • Bad at: interactive work with many back-and-forth steps; it is usually one deploy unit, so it scales as one.
  • In our shop: the nightly price import.

Microkernel (plug-in)

A small, stable core plus plug-ins that add or change behavior. The core knows how to find plug-ins (a registry) and talks to them through a fixed contract.

  • Good at: products that many customers adapt: IDEs, browsers, tax or insurance rules that differ by country or customer.
  • Bad at: very high scale, and plug-ins that need to talk to each other a lot.
  • In our shop: checkout with one tax plug-in per country. A new country is a new plug-in; the core does not change.

Service-based

A middle step between a monolith and microservices: a few big services (often 4 to 12), each covering a large business area, usually with one user interface and often one shared database.

Service-basedOne web app (UI)CatalogOrderPaymentShippingOften one database4 to 12 big services, simple to runSpace-basedUnit 1data in memoryUnit 2data in memoryUnit Ndata in memoryCopies are kept in syncDatabase, written laterfor huge, sudden peaks
Left: a few big services, often with one database. Right: many processing units keep their data in memory and save to the database later.
  • Good at: independent releases of big areas, without the full cost of microservices. Transactions inside one service are still easy.
  • Bad at: fine-grained scaling; a shared database still couples the services through its tables.
  • When: a monolith that needs some independence, by a company not ready for dozens of services.

Event-driven

Parts react to events (“order placed”) instead of calling each other directly. There are two common shapes:

  1. Broker (choreography). Each part listens and reacts; nobody controls the whole flow. Very decoupled and fast, but the whole flow is hard to see and errors are hard to handle.
  2. Mediator (orchestration). One mediator knows the steps and sends work to each part. Easier to follow and to handle errors, but the mediator is coupled to every step.
  • Good at: responsiveness, scale, and adding new reactions without changing the sender.
  • Bad at: testing, debugging, and keeping data consistent at every moment.

Space-based

Built for huge and sudden peaks. Many processing units each keep the data they need in memory. The copies are kept in sync between units, and data is written to the database later, in the background. The database is no longer the bottleneck.

  • Good at: extreme elastic scale: ticket sales, flash sales, online auctions.
  • Bad at: simplicity and cost. Data in memory must be synced, and the database is a little behind. Testing real peak load is expensive.
  • In our shop: maybe only the flash-sale part, not the whole shop.

Orchestration-driven (classic SOA)

A style from the 2000s: services are split by technical role (business services, enterprise services, infrastructure), and a central enterprise service bus orchestrates flows and translates messages. The goal was maximum reuse.

  • Lesson learned: reuse across the whole company created huge coupling. Every change needed the central team and touched many services. It is rare in new systems, but you may meet it in old ones.

Microservices

Many small services, each owning one business area and its own data, released alone. We studied it in the microservices lesson. Great team independence and fine-grained scale; the highest cost in operations, data consistency and debugging.

A rough comparison

These are typical tendencies, not laws. A well-built system can do better or worse than its style.

Style Simplicity and cost Scale and elasticity Independent releases Fault tolerance
Layered High Low Low Low
Modular monolith High Low Low to medium Low
Pipeline High Low Low Low
Microkernel High Low Medium (plug-ins) Low
Service-based Medium Medium Medium Medium
Event-driven Low High High High
Space-based Low Very high Medium High
Orchestration (SOA) Low Medium Low Medium
Microservices Low High Very high High

Notice the pattern: what you gain in scale and independence, you pay for in simplicity and cost.

How to choose

1. Scenariospeak, failure,release speed2. Limitsteam, budget,laws, platform3. Compare2 or 3 realcandidates4. Prototypetest the riskiestguess first5. DecideADR with areview dateStart from the outcomes you need, not from a favorite style.
A short process that starts from outcomes and ends with a written, reviewable decision.
  1. Write the scenarios. The real situations with numbers: the lunch peak, a flash sale, a server failure, how often each team must release, a law about where data lives. (See the lesson on architecture characteristics.)
  2. List the limits. Team size and skills, budget, the platform you already run, deadlines.
  3. Compare two or three real candidates. For each scenario, write how the style meets it, and what it costs. If a style needs a mechanism you cannot run (for example, a data grid nobody knows), that is a cost too.
  4. Prototype the riskiest guess. Build a small spike for the part you are least sure about, and measure. Do not guess about the most expensive risk.
  5. Decide and write an ADR, with the alternatives, the trade-offs and a review date. Prefer choices you can undo: clear contracts between parts, and a pilot on one slice before the whole system.

Different parts can use different styles. Our shop can be a modular monolith overall, with a pipeline for the nightly import, a microkernel for tax rules, and a separate, elastic deploy unit for the flash sale.

When to move to another style

Watch for signals, not for fashion:

  • Teams wait for each other’s releases more and more.
  • One part needs a very different scale or availability than the rest.
  • Changes keep crossing the same borders (the borders may be wrong).
  • The quality goals of the business change, for example a new market or a big partner.

Common mistakes

Mistake Result The right way
Choosing the style you want on your CV High cost, no real need. Start from scenarios and limits.
Distributing too early All the network costs, before any benefit. A modular monolith until there is a real reason.
One style for every part Pay for the hardest part everywhere. Different styles for parts with different needs.
Ignoring the data A nice service diagram that cannot be consistent. Decide data ownership with the style.
A decision with no review date An old choice nobody dares to question. ADR with alternatives and a review date.

Summary in six lines

  1. Styles come in two families: one deploy unit, or many deploy units.
  2. Split the top level by business area when you can; layers can live inside each part.
  3. Pipeline fits one-way data flows; microkernel fits products with many custom rules.
  4. Service-based is a middle step; space-based is for huge sudden peaks; classic SOA taught us that company-wide reuse couples everything.
  5. More scale and independence usually means less simplicity and more cost.
  6. Choose from scenarios and limits, compare 2 or 3 candidates, prototype the riskiest part, and write an ADR with a review date.

Done reading this lesson?Mark it as finished so it shows in your lessons list and report card.