There's a conversation that repeats itself in many teams. Someone in a review says "an adapter would work well here," another person understands "ports and adapters," and for ten minutes each one defends something different, thinking they're talking about the same thing. It's not a problem of intelligence. It's a vocabulary problem: we use the word "pattern" for things that live at very different scales.
This post is here to sort out that vocabulary. It's meant for someone just starting out, and also for the PO, QA, or operations person who hears these words in every meeting without anyone ever calmly explaining them.
First, what is a pattern?
A pattern is a named solution to a problem that repeats in a certain context. It's not code to copy and paste: it's a way of thinking through a solution, with its advantages and its costs.
The idea comes from building architecture (Christopher Alexander) and arrived in software with full force in 1994, when Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides published Design Patterns: Elements of Reusable Object-Oriented Software, the famous "Gang of Four" or GoF book, with 23 patterns that are still taught today.
Over the years, patterns of a different scale appeared: no longer about how a few classes are organized, but about how an entire system is organized. That's where the difference that matters lies.
Two scales: the city and the building
The metaphor that works best for me is that of a city. Architectural patterns are the zoning plan: where the avenues go, which neighborhoods connect, where the water runs. Design patterns are the solutions inside each building: how the rooms are laid out, where the stairs go.
Moving a staircase is annoying, but it can be done over a weekend. Moving an avenue is a different story.
Design patterns (GoF and similar). They solve problems inside the code of a component. Some examples:
- Strategy: having several interchangeable ways of doing the same thing. For example, calculating a transfer fee depending on whether it's to another bank, the same bank, or international, without filling the code with
ifstatements. - Observer: notifying several interested parties when something changes, without the object that changes knowing who they are.
- Factory: centralizing object creation. For example, creating the correct processor based on the card type.
- Adapter: wrapping an interface that doesn't match the one you need, like an old library that returns amounts in a different format.
Architectural patterns. They solve how a system is divided into pieces, how those pieces communicate, and where the data lives. Some examples:
- Layers: presentation, business, and data, each one talking only to the one below it.
- Hexagonal or ports and adapters: the business at the center and the technology (databases, queues, APIs) at the edges.
- Modular monolith and microservices: a single deployment well divided internally, or many services deployed separately.
- Event-driven: components communicate by publishing facts ("the loan was approved") instead of calling each other directly.
- CQRS and event sourcing: separating the write model from the read model, and storing the event history instead of just the current state.
- Saga, API gateway, and strangler fig: coordinating transactions between services, setting up a single entry point, and replacing an old system little by little.
Martin Fowler, in his architecture guide, picks up an idea from Ralph Johnson (yes, one of the four from the GoF) that I love: architecture isn't so much "the high-level stuff" as the shared understanding that expert developers have about the system's design, and the decisions one would have wished to get right from the start. In other words: the decisions that are expensive to reverse.
The table to keep handy
| Dimension | Design pattern | Architectural pattern |
|---|---|---|
| Scope | A few classes or objects | The entire system or several systems |
| Question it answers | How do I organize this code? | How do I divide the system and how do its parts communicate? |
| Cost of changing it | Low: a refactor of hours or days | High: months, data migrations, coordination between teams |
| Who notices it | Whoever reads and maintains the code | The whole team, operations, security, and sometimes the client |
| Affects | Readability, extensibility, testing | Scalability, availability, security, costs, team organization |
| Examples | Strategy, Observer, Factory, Adapter | Layers, hexagonal, microservices, CQRS, saga |
| Where it's documented | In the code and in the PR review | In diagrams and decision records (ADR) |
The same name at two levels
What's most confusing, and at the same time most beautiful, is that many ideas repeat at both scales.
Adapter and ports and adapters. The GoF adapter wraps a class so it matches another interface. Alistair Cockburn's hexagonal architecture takes that same intuition and applies it to the whole system: the business core defines "ports" (what it needs, for example "check balance") and each technology connects through an "adapter." Cockburn proposed this so an application could be used equally by people, by other programs, or by automated tests, and tested without depending on the real database. In practice, each hexagonal adapter is often implemented using a GoF adapter. Same idea, two zoom levels.
Observer and event-driven. The observer notifies other objects within the same process. Event-driven architecture does the same thing between systems, with a message broker in the middle. The difference is huge in practice: between processes, the network appears, along with duplicate messages, ordering, and eventual consistency. Fowler shows that "event-driven" groups together several different patterns, and it's worth knowing which one you're using.
Let's see it in a payments example:
The API gateway, the hexagonal structure, and the broker are architectural decisions: changing them affects several teams. The commission strategy and the adapter over the core's API are design decisions: they can be redone in a sprint without anyone outside the team even noticing.
Architectural patterns also come at a cost
A junior developer tends to see patterns as trophies: the more, the better. It's the opposite. Every architectural pattern brings a bill that has to be paid every month.
- Microservices provide independent deployments, but bring network overhead, distributed observability, and scattered data. That's why Fowler suggests starting with a monolith first and splitting once the boundaries are clear.
- If a transfer touches several services, there's no longer a single
COMMIT. The saga solves this with a sequence of local transactions and compensating actions (if the credit fails, the debit is reversed). It works, but each compensation has to be designed and tested. - CQRS can be very useful, for example to separate the transaction log from statement queries. But Fowler himself warns that for most systems it adds risky complexity.
- Event sourcing naturally fits accounting, which has always been a record of facts, but it requires thinking about how to version events and reconstruct state.
- The strangler fig allows an old core to be replaced feature by feature, instead of betting everything on a single big-bang replacement overnight.
Why the whole team should know them
Here's the central point of this post. Knowing these patterns isn't a matter of job title; it's a matter of being able to have the conversation.
Developers. A shared vocabulary shortens code and design reviews. Saying "this breaks the dependency rule of the hexagonal architecture" saves a whole paragraph.
QA. If the system uses events and eventual consistency, the balance might take a few seconds to update, and that's not a bug. If there are sagas, the most important test cases are the compensations: what happens if the credit fails after the debit? Hexagonal architecture, moreover, makes it easier to test the business logic without the real database.
Product owners. Understanding the trade-offs helps with estimating and prioritizing. A feature that crosses three services doesn't cost the same as one that lives within a single one. And knowing what a strangler fig is allows planning a modernization in value-delivering increments, not as a "big bang."
Operations and SRE. Each pattern changes how an incident is debugged. In a monolith, the stack trace tells the story; in microservices you need distributed traces and correlation identifiers. Knowing where the queues and retries are greatly shortens the search for the root cause.
Security. An API gateway centralizes authentication and traffic limits; an event broker is a place where sensitive data travels and needs to be encrypted and controlled. Each pattern shifts the attack surface.
And for everyone: patterns help prevent technical debt. Most expensive debt isn't born from a poorly written for loop, but from an architectural decision made without understanding its costs, or from not knowing that a named alternative existed.
How to start learning them
A practical route:
- Start with the most common design patterns. Strategy, Observer, Factory, Adapter, Decorator, and Template Method cover a lot of ground. The GoF book is the original source, although it's dense; a good alternative is to read it one pattern at a time, with an example in your own language.
- Look for the patterns in the code you already have. Your framework is full of them. Naming them in real code fixes them in your mind far more than any book example.
- Move on to architectural styles. The Azure Architecture Center's style catalog compares layers, microservices, event-driven, and others, with their benefits and challenges. Its cloud design patterns catalog is useful for the next stage.
- Dig deeper into distributed systems. microservices.io, by Chris Richardson, organizes saga, API gateway, and friends into a connected pattern language.
- Draw the system you work on. A simple diagram: what pieces there are, how they talk to each other, where the data lives. Then ask which patterns were used and why.
- Read and write decisions. Architecture decision records (ADRs) show the context and trade-offs of each choice. Reading your team's, or proposing the first one, is the best school.
In 20+ years of experience I've seen many trends come and go, but good patterns remain relevant because they're not trends: they're names for problems that don't go away. Learning that language doesn't turn you into an architect overnight, but it does seat you at the table where the decisions that are most expensive to change get made.
Recommended reading
If this post left you wanting to keep going, here's the route I'd take: from the gentlest to the most demanding.
Books
-
Head First Design Patterns, 2nd edition (Eric Freeman and Elisabeth Robson, O'Reilly). The entry door. If strategy, observer, or adapter still get mixed up for you, here they're explained calmly and with examples, before moving on to the dense book.
-
Design Patterns: Elements of Reusable Object-Oriented Software (Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, Addison-Wesley). The classic from the Gang of Four. I'd read it one pattern at a time, with your project's code next to it: it's the source, and it doesn't pretend to be easy.
-
Fundamentals of Software Architecture, 2nd edition (Mark Richards and Neal Ford, O'Reilly). The bridge between writing code and deciding architecture. Useful for naming styles, characteristics, and the costs of a decision without turning the conversation into a fad.
-
Patterns of Enterprise Application Architecture (Martin Fowler). The catalog of what already lives in almost every business system: how you split layers, where you put the logic, and how you talk to a database.
-
Pattern-Oriented Software Architecture, Volume 1 (Frank Buschmann and colleagues, Wiley). The POSA. Here patterns stop being loose cards and get organized into a system, from the shape of the system down to the language of the code.
-
Domain-Driven Design: Tackling Complexity in the Heart of Software (Eric Evans, Addison-Wesley). For when the business is harder than the framework. It leaves you a language for splitting up the domain and making that model drive the design.
-
Enterprise Integration Patterns (Gregor Hohpe and Bobby Woolf, Addison-Wesley). The vocabulary of messaging. I open it when two systems need to talk to each other and a direct call is no longer enough.
-
Microservices Patterns (Chris Richardson, Manning). For anyone deciding whether to split the system, or who has already split it and is paying the cost. Decomposition, sagas, and queries are all there, difficulties included.
-
Software Architecture: The Hard Parts (Neal Ford, Mark Richards, Pramod Sadalage, and Zhamak Dehghani, O'Reilly). Useful when there's no single practice that gets you out of the problem: service granularity, data, and distributed transactions. It helps you see both sides before choosing.
-
Designing Data-Intensive Applications (Martin Kleppmann, O'Reilly). The most demanding one on the list. When the question is no longer what the pattern is called, but what happens to the data if it's replicated, delayed, or lost.
Websites
-
Design Patterns on Refactoring.Guru. My shortcut in Spanish: a drawing and a short example whenever I want to refresh a pattern before a review.
-
Martin Fowler's architecture guide. For agreeing on what architecture even means: the decisions that hurt to change later, not the box diagram.
-
microservices.io's pattern language. Chris Richardson organizes saga, API gateway, and the rest as a connected language. Useful so you don't argue about each pattern as if it lived in isolation.
-
Azure cloud design patterns catalog. Each pattern comes with what you gain and what it costs you. It's useful to me even when the system isn't on Azure: the problem is usually the same.
-
AWS Prescriptive Guidance patterns. AWS's living catalog for seeing a pattern already translated into concrete services. I use it when the team has already chosen that cloud and needs an implementation, not just the name.
-
Google Cloud Architecture Center. Reference architectures and design criteria for thinking through the system before committing to a product.
-
Enterprise Integration Patterns, the site. The version to keep open during a meeting: you pick the messaging pattern by name and the conversation continues from there.
-
patterns.dev. Design and rendering patterns for whoever builds the interface. The same rigor we've been talking about on the server, now on the browser side.



