An architectural mechanism is a small part of an architecture that addresses a specific important concern, provides a common way of doing something, or is a good example of how the architecture behaves and is structured. It is described in terms of structure and behaviour, and is best delivered as working code.

Mechanisms are how an architecture explains itself. An architectural overview shows the shape of a system; the mechanisms show how it does the things that matter: how it persists data, how it authenticates, how it handles errors, how a plugin gets added, how two products in a family exchange a message. They are the smallest unit of architecture that a team can pick up and use, and the unit at which architecture can be delivered incrementally.

Mechanisms are patterns with the organisation left in. A pattern is generic and public: the circuit breaker, the strangler fig, queue-based load levelling. A mechanism is yours: it has your names, your constraints, your chosen libraries, your audit rules, and a working example in your repository. Most mechanisms are not universal enough to be industry patterns, and they do not need to be. They are common ways of solving the problems that are common here.

A mechanism is an answer to “how do we do X round here?” that a new team member, or an agent, can run.

Where mechanisms come from

There are three sources. The requirements: the primary differentiating functional requirements, especially Integration Scenarios, are often best explained by a mechanism, as are the significant non-functional ones (persistence, audit logging, authentication, localisation, resilience). The architectural profile: a dimension with a high bar is a dimension that needs a mechanism, and a dimension with a low bar probably does not. And the team: developers naturally look for a common way to approach a recurring problem, to avoid duplication and the quality risks that come with it. When somebody says “we keep doing this differently”, that is a mechanism asking to be written down.

Mechanisms exist to explain the architecture. Too many of them, or too much writing about each one, inhibits the communication they exist for. Working examples explain better than models. The balance to strike is just enough mechanisms to describe the architecture and not so many that the team is stuck designing instead of building; finding that point is where a talented architect shows. A rule of thumb: if the explanation of a mechanism is more complex than its implementation, the explanation is waste.

The card

A mechanism is best presented as a card. The book’s examples were made in a modelling tool, but photographs of a whiteboard are just as good, and a Markdown file in the repository next to the code is better than either, because it is versioned and reviewed with the code it describes.

An architectural mechanism card: name, where it applies, structure, one flow, and acceptance criteria on the backPersistenceAppropriate for stories like:1425 search for a product1417 add a product to a wishlist1431 admin manages global products1432 edit a profile...How the user interaction gets tothe database and back: query,load, edit, save and delete, withaudit, undo and concurrencyhandled one way.Constraint: every write is audit-logged with user and time.StructureControllerRepositoryEntityAudit logDatabaseOne significant flow: saveUIControllerRepositoryAuditsavewriterecordok, or a ProblemCode: git repo /mechanisms/persistence (working example)Other flows look the same. Specification by example.Used by 14 stories so far.Flip side: acceptance criteriaSave of 10k records < 2 sp95Concurrent edits: lastwriter told, not lostEvery write has an auditentryUndo restores the previousversionNo SQL outside therepositoryFitness function in thepipelineIf it has no criteria, it is decoration.
A mechanism card, redrawn from the book's persistence example. Front: the name, the stories it is appropriate for, a short description, the structure, one significant flow, and a link to the code. Back: the acceptance criteria.

The front of the card carries:

The book’s second example was a real “create new plugin” mechanism for a plug-and-play processing architecture: a name, a sentence of description, the stories it supported, a tiny class diagram, then configuration steps, snippets, a full example plugin and a link to the code. It was used about fifty times on that project and the team rated it the most useful thing the architecture gave them. Its value was not the cleverness of the plugin design but that anyone could follow it in an afternoon. The point of a mechanism is how to use it.

The flip side

Just as requirements are best described by the tests that quantify them, mechanisms have acceptance criteria, and we put them on the back of the card. Many are easy to frame as customer-facing tests: a search mechanism has performance, consistency and accuracy criteria. Others are purely technical (a common way of handling errors, say) and feel as if they only make sense to the development team. Even so, every mechanism should relate back to a requirement somewhere. If it does not, that is a sign of gold-plating.

Today the back of the card should be executable too. A mechanism’s acceptance criteria are fitness functions: a dependency rule that fails the build when something bypasses the repository layer, a load test that holds the persistence mechanism to its latency budget, a policy check that every write path emits an audit event. A mechanism whose criteria run in the pipeline is a mechanism that stays true; one whose criteria live on a card stays true until the next refactoring.

Mechanisms at system and solution level

Mechanisms take different forms at the three levels of architecture. The difference is in usage (how widely the mechanism is used: one system, a system-of-systems, or the organisation) and in conceptual level (what is visible at that level).

Mechanisms by level: what they are made of, and how patterns relateLevelMechanisms addressBalanceTypical examplesEnterprisestandards, platforms,toolingmostly standards-basedidentity, pipelines, logging,landing zonesSolutionintegration,distribution,cross-product NFRsabout three parts designto one part standardsmessage formats, compositetransactions, end-to-endtracingSystemhow this product doesthingsalmost all design-basedpersistence, plugin, errorhandling, searchnarrower use, more designPatterns (public, generic) are mechanisms (yours, specific) with the organisation taken out.A pattern you adopt becomes a mechanism once it has your names, your constraints, your code and your acceptance criteria.
Enterprise mechanisms are mostly standards-based; system mechanisms are almost all design-based; solution sits between. Patterns are the public, generic form of the same idea.

System mechanisms explain how one product does things. They are overwhelmingly design-based: persistence, the plugin model, error handling, search, caching, how the front end talks to the back end. They are tightly bound to the architectural overview and used only to refine it where the profile says refinement is needed.

Solution mechanisms explain how a system-of-systems works together. System internals are not visible at this level, so the structural views are higher: products, interfaces, deployment topology. Behaviour is best described as the Integration Scenarios the mechanism implements, with a simple flow of events or data for the non-functional ones. The subjects are integration, distribution and the cross-product non-functionals: message formats and schemas, composite transactions across products, end-to-end tracing and correlation, common authentication, the elasticity rules that let the family scale. The same card format works, with interface interaction and integration code examples in place of class sketches. Solution mechanisms are about three parts design to one part standards, as a rough generalisation.

Enterprise mechanisms are mostly standards-based: technologies, platforms, toolchains, environments and ways of working, less concerned with specific requirements. The enterprise’s common services (identity, pipelines, logging, landing zones) are its mechanisms, and in a modern organisation they live on the internal developer platform as working code and templates.

Any system mechanism is a candidate for promotion to solution or enterprise level, and proof of usefulness in one solution is the best argument for adopting something enterprise-wide. The reverse rule also applies: a system built in the context of a solution or enterprise architecture should use the existing mechanisms, or have a strong technical and cost-benefit justification for not doing so. Multiple mechanisms for the same problem in one architecture cause lasting supportability problems. Left entirely to system architecture, every piece of work duplicates the common mechanisms, which is waste.

Changing them

A healthy organisation accepts challenges to its established mechanisms as new ways of solving problems and new technologies emerge. But changing accepted solution or enterprise mechanisms with every technology fashion creates wasteful architectural churn for every product that depends on them. Changing a common mechanism is a cost-benefit decision, so for the enterprise, or for a long-running programme, route it through a portfolio request and record the outcome as a decision record. Not changing them is also a decision with a cost: mechanisms that are never updated become technical debt and the source of performance and security problems.

Keep mechanisms atomic and isolated. A team should be able to use one solution or enterprise mechanism without adopting all of them. Interdependent mechanisms cause fragility, impede progress and lose the organisation its agility. Avoid too many at enterprise or solution level for the same reason.

Mechanisms can often be implemented with an existing library, framework or managed service, and today they usually should be. But frameworks overlap at their conceptual edges and tend to add more than the problem needs, which produces bloat and confusion. Use an existing technology where it fits the need almost perfectly, not where the requirements have to be massaged to fit the technology. If two selected technologies need disambiguating, the architecture is unclear. Do not pick up a framework to implement a simple mechanism because it is new and interesting.

Practices that backfire at high complexity

Mechanisms, profiles and overviews are tools for simple and complicated work, and for the complicated parts of complex work. The Complexity page explains the Cynefin distinction and the conditions that make an architecture highly complex: extensive integration between independent parts, speculative work, little domain knowledge, very high bars on the profile, risks and estimates that are wildly uncertain, extreme scale, and emergent behaviour. In that territory, practices that worked before become dysfunctional, and we have seen more high-complexity work fail from using complicated-work practices than from the complexity itself.

PracticeWhy it backfires when complexity is high
Forward planningWe do not yet know how we will solve the problem, or whether we can. Plans change faster than they can be written. Probe and sense instead.
Detailing requirementsThe intent matters; the detail of how does not, because the technical solution will change and take the details with it. A sub-optimal solution may be the only affordable one, which changes the scope.
Analysis and designDecomposing into manageable chunks fails when the complexity is in the number of chunks and their interactions. Manage emergent properties and run spikes to prove or disprove ideas.
User-centric designUsers have not resolved the complexity and may not understand the problem. Giving them what they want is often the opposite of the solution. Design the interaction once the solution is stable.
EstimationNumbers will be orders of magnitude out. Fund experimentation in timeboxes and see how much complexity each one removes.
Elaborating mechanismsA mechanism is a settled common answer. When the answers are still changing weekly, writing them down as mechanisms produces churn, not reuse. Keep the few that enable change and let the rest emerge.
Connecting every modelSolution-level models that try to resolve integration complexity by documenting all of it are a snapshot of a moving target. They help nobody solve anything.

The last two rows are the ones this page adds to the book’s table, and they follow from it. When complexity is high, we architect for change, not for the solution requirements, because change is the only thing we know the architecture must support. That means a small set of mechanisms chosen precisely because they enable change: high cohesion and low coupling; an integration architecture of message passing, queueing, discovery and stable data formats; elastic, event-driven deployment; isolating the simpler, complicated parts so they can be built conventionally; and whatever reduces algorithmic complexity. Then create a pull towards business value through continuous integration and deployment, measure the outcomes that matter rather than intermediate stages, and judge every change by whether it moves the emergent behaviour towards good or away from it. Standard enterprise architecture may have to be set aside for such work, and the cost of that should not stop work whose business value is high enough.

Mechanisms are what you tell the agents to use

The AI SDLC gives mechanisms a second job. An agent generating code from an outcome-based prompt needs three things: the intent, the constraints and the context. Mechanisms are the context. They are the reusable, verified building blocks that the organisation has already decided are the way to do persistence, authentication, messaging or error handling here, and they are exactly what an agent should be told to use rather than left to reinvent.

This matters because of what agents do without that context. Given a story and a codebase, a capable agent will produce something that works and that does the common things in a plausible new way: a fourth database access style, a hand-rolled retry loop, a bespoke logging format. Each one is locally fine and globally a mess, and the mess arrives at the speed of generation. Mechanisms are the fix. A card that says “appropriate for stories like these, structure like this, one flow like this, working example here, acceptance criteria that run in the pipeline” is a near-perfect block of context for an agent, and it was designed for human readers who are new to the system, which is much the same audience.

In practice:

Patterns play the complementary role. They are the public, generic form of mechanisms: what a mechanism becomes when the organisation is taken out of it, and what most mechanisms start from. An agent knows the patterns already; it has read every book about them. What it does not know is which pattern you chose, how you adapted it, which library you standardised on and what constraints you added. That is the mechanism, and it is the part only you can supply.

Last updated