← Glossary

Software architecture

Architecture patterns

Architecture patterns are reusable ways to structure a software system, such as layered, microservices or event-driven, each with known benefits and costs.

Grid of eight architecture pattern thumbnails: layered, client-server, microservices, event-driven, pipe and filter, microkernel, space-based and serverless, each drawn as a small diagram
Eight common architecture patterns. Each thumbnail shows the shape that gives the pattern its name.

Teams reach for architecture patterns because the big structural questions have been answered many times before. Knowing the catalog turns “how should we build this?” into “which trade-offs do we accept?”, which is a far easier conversation to have in a design review.

Why do architecture patterns matter?

  • Shared vocabulary. Saying “event-driven with a saga for order fulfillment” tells another engineer the shape of the system in one sentence.
  • Known trade-offs. Each pattern comes with a list of what it makes easy and what it makes hard, learned by other teams at their expense.
  • Faster reviews. Reviewers can check a design against the pattern’s known failure modes instead of reasoning from scratch.
  • Honest comparison. Putting two patterns side by side forces the team to name the quality attributes it cares about, which is the heart of system design.

What are the most common architecture patterns?

PatternWhat it solvesWhat it costs
LayeredKeeps presentation, business logic and data access from tanglingChanges often touch every layer, and layers can become pass-through
Client-serverMany users sharing one source of truthThe server is a single point of scale and failure
Three-tierScaling and securing logic separately from dataExtra network hops and more infrastructure to run
MonolithicOne deployable that is simple to build, test and debugEverything scales and ships together, and boundaries erode
MicroservicesTeams deploying and scaling independentlyDistributed failures, data consistency and far more operations work
Event-drivenLoose coupling and absorbing bursts of workHard to trace a request, and eventual consistency everywhere
Pipe and filterProcessing data through independent, reusable stepsPoor fit for interactive work, and overhead at every step
MicrokernelA stable core extended by plug-insThe core’s interfaces are hard to change once plug-ins exist
Space-basedVery high load without a database bottleneckComplex in-memory data grids and expensive to reason about
ServerlessPaying only for what runs, with no servers to manageCold starts, vendor lock-in and limits on long-running work
MVCSeparating a user interface from data and rulesOnly covers the application, not how it is deployed

The rows link to the patterns that have their own glossary page. The thumbnails at the top of this page show the shape of eight of them.

How do you choose an architecture pattern?

  1. Name the quality attributes that matter. Pick the top three from scalability, availability, deployability, testability, performance, security and cost. A pattern that is great at the wrong three is the wrong pattern.
  2. Look at the team. Microservices need a team per service and mature operations. A single small team ships faster with a monolith.
  3. Look at the rate of change. Parts of the system that change at different speeds, or are owned by different teams, are candidates for a boundary.
  4. Look at the data. If every feature needs the same transactional data, a pattern that splits that data across services will fight you.
  5. Draw two candidates. An architecture diagram of each makes the trade-offs concrete. A C4 container diagram is a good level for the comparison.
  6. Record the decision. Write an architecture decision record with the options considered and the reasons, so the choice can be revisited when the facts change.

How do patterns combine?

Patterns apply at different levels, and a complete system architecture stacks several of them. At the deployment level a system might be three-tier, with an API gateway in front. Inside the application tier it might be a set of microservices that communicate through events. Inside each service the code is layered, and the web-facing service uses MVC. A scheduled report runs as a serverless function.

The combinations that cause trouble are the ones that pull in opposite directions. Microservices that all share one database have the cost of distribution without the independence. An event-driven system in which every consumer calls back synchronously to the producer is a monolith with extra steps.

What are common architecture pattern mistakes?

  • Choosing by fashion. Microservices because a conference talk said so, not because the team needs independent deployment.
  • Ignoring the operational cost. Every pattern that adds boundaries adds monitoring, deployment and debugging work. Budget for it.
  • Applying one pattern everywhere. The checkout flow and the nightly report rarely need the same structure.
  • Drifting silently. A layered system where every layer calls every other has stopped being layered. Keep the architecture diagram current so drift is visible.
  • Skipping the record. Without a written decision, the next team rediscovers the trade-offs the hard way.

How do architecture patterns differ from design patterns?

Architecture patterns operate on the system: services, tiers, queues and the boundaries between teams. Design patterns operate on the code inside one component: how objects are created, composed and notified. The observer pattern inside a service and an event-driven architecture across services are the same idea at two scales, which is why the vocabulary is shared. In the C4 model, architecture patterns show up at the container level and design patterns at the component and code levels.

How do you document an architecture pattern?

  • Pattern catalogs and books. Published references such as Fowler’s and Richards’s catalogs describe each pattern with its context, forces and consequences, and are the place to check a pattern’s known problems.
  • Architecture decision records. The lightest way to document which pattern a system uses and why. One record per decision, kept with the code.
  • AI diagramming tools. Tools like Eraser turn a description of a system in any of these patterns into an architecture diagram you can keep editing, so the diagram of each candidate costs minutes rather than an afternoon.

For more on this kind of diagram, see architecture diagrams.

Frequently asked questions

  • What is the difference between an architecture pattern and a design pattern?

    An architecture pattern shapes a whole system or a large part of it: how it is split into services, tiers or components and how they communicate. A design pattern, such as factory or observer, shapes a handful of classes inside one component. Choosing an architecture pattern is usually a team decision recorded in an architecture decision record, while design patterns are chosen by whoever writes the code.

  • Can a system use more than one architecture pattern?

    Almost every real system does. A common combination is microservices that talk to each other through events, with a layered structure inside each service and a serverless function or two for scheduled jobs. The patterns apply at different levels, so they rarely conflict.

  • Which architecture pattern is best?

    None is best in general. Each pattern makes one set of things easy, such as independent deployment or simple debugging, and another set hard. The right choice depends on team size, how often different parts of the system change and which quality attributes matter most. For most new products, a modular monolith is the safest start.

  • What is the difference between an architecture pattern and an architecture style?

    The terms overlap and many authors use them interchangeably. When a distinction is drawn, a style is the broad family, such as event-driven, and a pattern is a specific arrangement within it, such as event sourcing or CQRS. This page uses pattern for both.

Turn a description of your system into an architecture diagram.