Skip to content

What Software Architecture Is, Why It Exists, What an Architect Does ​

"Architecture is about the important stuff. Whatever that is." — Ralph Johnson, as quoted by Martin Fowler, Software Architecture Guide

Summary: Software architecture is the set of structures, quality goals and decisions that are expensive to reverse; it exists so a system can change safely, so people can talk about it, and so the "-ilities" are chosen on purpose instead of by accident. Focus: Four definitions (Bass/Clements/Kazman, ISO/IEC/IEEE 42010, Fowler/Johnson, Richards/Ford), why architecture exists, architecture versus infrastructure versus design, architecture characteristics and the trade-off laws, the architect's role and archetypes, architecture in agile teams, documenting and evaluating it, evolutionary architecture, failure modes, and a minimal "architecture as code" setup in Go and Laravel. Learning goal: Given a system and a decision, say whether it is architectural, which characteristic it serves and which it hurts, who should make it, where it is recorded, and which automated check keeps it true; and know which of the 21 chapters of this path teaches the next step.

This is the entry page of the Architecture path. It teaches vocabulary and habits, not a single style. The border with the Design path is drawn in Software Architecture vs Software Design; we do not repeat it here (levels of design, SWEBOK stages, the cost-of-change curve, technical debt). The border with System Design (load, scaling, building blocks) is in the System Design path. The rest of this path follows the reading map.

Page map ​

If you are looking forGo to
The whole page in a few tablesEverything in one minute
Why architecture exists at allWhy it exists
Bass, ISO 42010, Fowler, Richards and Ford side by sideDefinitions
Where the word comes fromWhere it comes from
"-ilities", quality attributes, characteristicsArchitecture characteristics
Architecture vs infrastructure vs designThree words, three scopes
"Everything is a trade-off"The laws
What an architect does all dayThe architect's role
Enterprise, solution, application, technical leadArchetypes
Ivory tower vs hands-onIvory tower vs hands-on
Architecture in agile teamsAgile, runway, last responsible moment
Views, C4, ADRsDocumenting
ATAM, fitness functionsEvaluating
Evolutionary architectureEvolutionary architecture
Resume-driven design, big-bang rewrite, cargo cultFailure modes
All 21 chapters of this pathReading map
Code: module layout, dependency rules, fitness testGo, Laravel
Monolith to distributedIn architecture
ExerciseLab
Wrong beliefs, cheat sheet, questions, termsMisconceptions, Cheat sheet, Self-check, Glossary

Everything in one minute ​

The vocabulary. Every row is unpacked below.

TermIn plain wordsTiny exampleWhat goes wrong without it
ArchitectureThe structures and decisions that are hard to change, and the reasons for them"One deployable, two modules, one PostgreSQL"Nobody can say why the system looks like this
StructureElements and the relations between themorders calls billingYou cannot reason about change impact
Architecture characteristic (quality attribute, "-ility")A property the system must have besides featuresAvailability 99.9%, p95 under 200 msFeatures ship, but the system is slow, fragile or unsafe
Architecture decisionA choice that shapes structure or characteristics"Billing owns its own schema"Choices are re-argued every quarter
Design principleA guideline that steers many small choices"Modules talk through contracts only"Each team invents its own rule
ArchitectThe person (or people) who worry about the important stuffA senior engineer who also writes codeEither no one owns the big picture or one person owns every choice
Fitness functionAn automated check that a characteristic or rule still holdsA test that fails when orders imports billingArchitecture erodes silently
ADROne short record per significant decisionADR-0003: dependency ruleThe reasons vanish when people leave
Evolutionary architectureArchitecture that supports guided, incremental changeSmall releases protected by fitness functionsBig-bang rewrites

Four definitions in one table.

SourceDefinition (short)What it emphasises
Bass, Clements, KazmanStructures: elements, relations among them, propertiesWhat you can reason about and analyse
ISO/IEC/IEEE 42010Fundamental concepts or properties of a system in its environment, embodied in elements, relationships and principles of design and evolutionThe environment and the principles
Fowler / JohnsonThe shared understanding of the expert developers; the important stuffPeople and importance
Richards / FordStyle, characteristics, logical components, decisions (and design principles)What to specify and why

Architect expectations (Richards and Ford, eight items): make decisions; analyse continually; keep current; ensure compliance; diverse exposure; business domain; interpersonal skills; navigate politics. See the wheel.

Why it exists ​

Every non-trivial system has a structure and a set of qualities, chosen or not. Architecture exists because four needs appear as soon as more than one person, or more than one release, is involved.

NeedWhat architecture givesWithout it
Managing changeBoundaries that limit the blast radius of a changeA "small change" touches forty files
CommunicationA shared vocabulary and a few picturesEach person holds a different mental model
Quality attributesDeliberate choices for latency, availability, security, costThe qualities you did not choose are random
Cost of reversalCare spent where mistakes are expensiveExpensive decisions slip through as trivia
Coordination of teamsOwnership lines that match teamsMerge conflicts and blocked releases

The everyday analogy we reuse: a city plan. Streets, water mains and zoning are architecture: moving them later means digging up the city. Where a shop puts its shelves is design. Which shop opens on which corner is business. A good plan does not choose the shops; it lets any shop open without rebuilding the sewers. A bad plan, or none, still produces a city, but it is the one nobody chose. (Fowler warns that the building architect metaphor is flawed, see the role; the city-plan picture stays close to "structure that others build inside".)

SoftwarearchitectureStructures (Bass, Clements, Kazman)elements + relations among them+ their externally visible propertieswhat you can reason aboutISO/IEC/IEEE 42010fundamental concepts or propertiesof a system in its environment,embodied in elements, relationships,and principles of design and evolutionShared understanding (Fowler, Johnson)the expert developers' view of the design"the important stuff, whatever that is"things that are hard to changeFour dimensions (Richards, Ford)structure (style) + characteristics+ decisions + design principleswhat, how well, why, and the rules

Three common misunderstandings, up front ​

  1. "Architecture is the diagram." A diagram is one view. The architecture is the structures and decisions, drawn or not.
  2. "Architecture means microservices." Microservices are one style. A modular monolith has an architecture too; see Modular Monolith.
  3. "The architect decides, the team builds." Fowler's guide model is the opposite: the architect's value rises when the team can decide well.

Where it comes from ​

The word, 1960s to 1990s. Architecture became a discipline for software structures in the mid-1990s (SWEBOK v4 says so). Our Design chapter has the full timeline (NATO 1968, Parnas 1972, SWEBOK v4's separate architecture knowledge area); read it there.

Bass, Clements, Kazman. Software Architecture in Practice (the second edition, 2003, is quoted by the SEI's definitions page). The 2003 wording:

"The software architecture of a program or computing system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them." — Bass, Clements, Kazman, Software Architecture in Practice, 2nd ed., 2003, as published on the SEI definitions page (copy at cs.hmc.edu)

The later Views and Beyond wording is "the set of structures needed to reason about the system, which comprise software elements, relations among them, and properties of both" (secondary: seen in lecture slides quoting the book, not read in the book itself).

ISO/IEC/IEEE 42010. The standard defines architecture as "fundamental concepts or properties of a system in its environment embodied in its elements, relationships, and in the principles of its design and evolution" (iso-architecture.org, which hosts the standard's definition page and its phrase-by-phrase commentary). Its main contribution is the architecture description vocabulary: stakeholders, concerns, viewpoints, views (see 4+1 views).

Fowler, 2003, with Ralph Johnson. In Who Needs an Architect? (IEEE Software) Fowler defines architecture as the shared understanding the expert developers have of the system design, and notes that people really want to get right early "things that people perceive as hard to change". The same guide page records Johnson's objection that nothing is objectively "fundamental" and his conclusion that architecture is "the important stuff".

Richards and Ford. Fundamentals of Software Architecture (O'Reilly; the notes we read are from the early-release second edition, February 2025) gives the practitioner view. The second edition, per a reader's chapter notes (secondary), says the definition "has four dimensions": an architecture style, the characteristics it must support, the logical components, and the architecture decisions that justify it all. Earlier editions phrase it as structure, characteristics, decisions and design principles (we did not read the book text; see references).

Agile and evolution, 2001 onwards. Architecture left the big-document era: ADRs (Nygard, 2011), the architectural runway (SAFe), and the evolutionary architecture book (Ford, Parsons, Kua) describe architecture as something that changes continuously under automated checks.

The concepts, one by one ​

Definitions: structures, environment, shared understanding Must-know ​

In plain words: four people describe the same elephant: Bass looks at the parts and links, ISO at the system in its surroundings, Fowler at what the experts know, Richards and Ford at what you must write down.

Common misunderstanding: "One of these is the right definition and the others are wrong." They answer different questions; use the one that fits your task (analysis, description, conversation, specification).

Definition (our working one): Software architecture is the set of structures of a system (elements, their relationships and visible properties), the characteristics it must have, and the decisions and principles that justify them, as understood by the people who build it.

Question you are askingUse this definitionWhy
"Can we predict the effect of this change?"Bass et al.: structures and propertiesStructures are analysable
"What must a document or a review cover?"ISO 42010: concepts, environment, principles, stakeholdersA shared description standard
"Why does the new hire not get it?"Fowler: shared understandingArchitecture lives in heads first
"What do I deliver as architect?"Richards and Ford: style, characteristics, components, decisionsA checklist of outputs
"Is this decision architectural?"Johnson: is it important, is it hard to change?A cost test
text
     Step  Who                   What happens (a definition applied to one decision)
1    1     Team                  Proposal: "billing gets its own database schema"
2    2     Fowler/Johnson test   Important? Yes: many teams depend on the data. Hard to change later? Yes.
3    3     Bass test             Structure: new element "billing schema"; relation: orders no longer joins into it
4    4     Richards/Ford test    Characteristic served: deployability, evolvability; decision recorded as ADR-0003
5    5     ISO 42010 test        Stakeholders: finance team (concern: audit), operations (concern: backups)

Real scenario: a payment team argues for a week about "architecture" before noticing one person means the deployment diagram and another means the dependency rule. Naming which definition is in play ends the argument.

What provides it: a one-page "architecture overview" in the repository, an ADR folder, a C4 context diagram, and onboarding that makes a new person redraw the system from memory.

Fix / how to use it: keep a one-sentence definition in your team's docs and list your architecturally significant decisions (the five most expensive to reverse). See Architecture Decisions.

Architecture characteristics ("-ilities") Must-know ​

In plain words: features say what the system does; characteristics say how well: how fast, how available, how safe, how easy to change.

Common misunderstanding: "We need all of them, maximised." Each one costs structure and money, and many conflict. Richards and Ford (reader notes): a characteristic is architectural when it "influences some structural aspect of the design" and needs special structural support; security can be handled by coding hygiene in a monolith but needs a hardened service in a distributed system.

Definition: a non-functional property that the architecture must support, drives structural choices and is measured against a goal. Synonyms: quality attribute (SEI, ISO/IEC 25010 vocabulary), non-functional requirement, "-ility". Detailed requirement work is in Quality Attributes and From Requirements to Architecture.

CharacteristicPlain meaningHow you measure itStructural lever (example)
AvailabilityUp when neededUptime %, error budget (SLOs)Redundancy, failover, no single point of failure
ScalabilityHandles growth in loadRequests/s at fixed p95Stateless services, sharding
ElasticityHandles bursts, then shrinksTime to add capacityAutoscaling, queues
PerformanceFast enoughp50/p95/p99 latencyCaches, fewer network hops
Reliability / fault toleranceCorrect despite faultsFailure rate, MTBFRetries with idempotency, bulkheads
SecurityResists misuseFindings, time-to-patchTrust boundaries, least privilege
DeployabilityShip safely and oftenLead time, change failure rateIndependent deployable units
TestabilityCheap to verifyCoverage of risky paths, test timeDependency inversion, seams
Modifiability / evolvabilityCheap to changeFiles touched per changeModules, contracts, fitness functions
ObservabilityExplains itself in productionTime to diagnoseLogs, metrics, traces
CostAffordable to runCost per requestRight-sized components
LearnabilityNew people become productiveDays to first merged changeFewer, clearer parts
text
     Step  Event                                     Characteristic in tension
1    1     Product asks for sub-100 ms search        Performance -> add a cache and a read replica
2    2     Cache is stale for 30 s                    Consistency suffers (accepted in ADR-0011)
3    3     Replica adds an operational component      Cost and operability suffer
4    4     Black Friday doubles traffic               Elasticity tested; autoscaling rule added

Real scenario: a ticket-booking system picks consistency over availability for seat allocation (no double sale) but availability over consistency for the "seats left" counter on the browse page.

What provides it (per technology): PostgreSQL gives strong consistency and SERIALIZABLE; Redis gives low latency with weaker durability by default; Kafka gives high write throughput and replay; Kubernetes gives elasticity; none gives all of them.

Fix / how to use it: pick the top three characteristics per system, write each as a measurable scenario ("p95 under 200 ms at 500 req/s"), and make each a fitness function where possible (see fitness functions). Trying to optimise all twelve produces the "generic architecture" that serves none.

Three words, three scopes: architecture, infrastructure, design Important ​

In plain words: architecture decides the shape, infrastructure is the ground it stands on, design fills the rooms.

Common misunderstanding: "Choosing AWS or Kubernetes is the architecture." Those are infrastructure choices that constrain architecture; the architecture is what you build on them and how it is split.

AspectArchitectureInfrastructureDesign
QuestionHow is the system split and what must it guarantee?Where and on what does it run?How does this part work inside?
ExamplesModular monolith, data ownership, sync vs asyncKubernetes, VMs, PostgreSQL cluster, Kafka cluster, CDN, VPCClasses, interfaces, algorithms, retries inside one module
OwnerArchitect and tech leadsPlatform / SRE / cloud teamThe team that owns the module
Reversal costHighMedium to high (migrations, vendor lock-in)Low to medium
ArtifactADRs, C4 context/container, characteristicsTerraform, Helm charts, runbooksCode, tests, sequence diagrams
ChapterThis pathSystem Design pathDesign path

The overlap is real: "use Kafka" is an infrastructure choice and an architectural one (it creates asynchronous boundaries). Treat a decision as architectural when it changes structure or a characteristic, whoever pays the bill.

The laws: everything is a trade-off Must-know ​

In plain words: you never get a free improvement. Every gain in one characteristic is paid for somewhere else, and "it depends" is the honest starting answer.

Common misunderstanding: "A best practice exists for each problem." Fowler quotes Kent Beck: "any decent answer to an interesting question begins, 'it depends...'", then shifts the focus to what it depends on.

Definition (Richards and Ford, via a reader's notes on the early-release second edition, secondary):

LawStatementConsequence
First law"Everything in software architecture is a trade-off."If you found no trade-off, you have not found it yet
Corollary 1If you think you found something that isn't a trade-off, you just haven't identified it yetLook for the hidden cost
Corollary 2You can't do trade-off analysis once and be doneRe-check as context changes
Second law"Why is more important than how."Record the reasons (ADRs)
Third lawMost decisions aren't binary but sit on a spectrum between extremesPrefer "how much" over "which"
text
     Step  Decision                         Gains                         Pays with
1    1     Split billing into a service     Independent deploys, scaling  Network latency, partial failure, distributed data
2    2     Cache product pages               Latency, lower DB load        Stale reads, invalidation bugs
3    3     Share a library across services   No code duplication           Coupled releases (shared library vs shared service)
4    4     Async events between modules      Decoupling in time            Harder debugging, eventual consistency

Real scenario: Fowler's Microservice Premium: microservices buy independent deployment and a way to handle complexity, and cost "automated deployment, monitoring, dealing with failure, eventual consistency". Whether it pays depends on system complexity; for a simple system the premium is not worth it.

What provides it: the habit of a two-column table (gains, pays with) in every ADR, and the trade-off chapter.

Fix / how to use it: before approving a design, require the author to name one thing they give up. If the answer is "nothing", send it back.

The architect's role Must-know ​

In plain words: an architect is the person who worries about the important stuff and keeps the team able to change it.

Common misunderstanding: "The architect makes all the important decisions." That is what Fowler calls Architectus Reloadus. He prefers Architectus Oryzus, who collaborates, mentors, and tackles problems "before they become a serious problem", and he offers a rule of thumb: "an architect's value is inversely proportional to the number of decisions he or she makes". A colleague's alternative name for the role: guide, as in mountaineering.

ArchitectMake decisionsContinually analyseKeep currentEnsure complianceDiverse exposureBusiness domainInterpersonal skillsNavigate politics

Definition (Richards and Ford, eight expectations; reader's notes quoting the book):

#ExpectationIn practiceTypical failure
1Make architecture decisionsDefine decisions and design principles that guide technology choicesDeciding everything, or nothing
2Continually analyse the architectureReview fit with the current environment, recommend improvementsArchitecture frozen at day one
3Keep current with trendsRead, try, build a personal radarResume-driven picks from hype
4Ensure compliance with decisionsVerify code follows decisions (automate it, see fitness functions)Architect as police; the reader's note doubts that governance should sit with the architect
5Diverse exposure and experienceBreadth over depth across technologiesOne favourite tool for every job
6Business domain knowledgeSpeak the domain, link design to goalsTechnically perfect, commercially wrong
7Interpersonal skillsTeamwork, facilitation, leadershipRight answer, nobody follows
8Understand and navigate politicsNegotiate budgets, scope and ownershipGood design blocked by organisation
text
     Step  Day of an architect (Architectus Oryzus)       Expectation served
1    1     Morning: pair on shared locking code           5, 7 (breadth, collaboration)
2    2     Late morning: read a vendor's postmortem        3 (keep current)
3    3     Afternoon: requirements session, explain cost   6, 7 (domain, communication)
4    4     Review fitness-function failures in CI          2, 4 (analyse, compliance)
5    5     Write ADR for the queue choice                  1 (decisions) and law 2 (why)

Real scenario: a delivery team stalls on "which message broker". The architect does not pick; she runs a two-hour session with the team, writes the trade-offs into an ADR, and the team decides.

What provides it: a written decision log, an architecture forum with rotating members, a small set of principles, and CI checks instead of review gates.

Fix / how to use it: measure the role by how often teams make good architectural decisions without you.

Archetypes: enterprise, solution, application, technical lead Important ​

In plain words: "architect" is a job title with different scopes; ask what the person is responsible for.

Common misunderstanding: "All architects do the same thing at different seniority." Scope differs more than seniority.

The four names below are the common industry classification; we did not find them defined in the primary sources we read, so treat the exact boundaries as convention, not standard.

ArchetypeScopeTypical decisionsTypical artifactCoding?
Enterprise architectWhole organisation, many systemsStandards, platforms, capability map, build vs buyLandscape maps, roadmaps, policiesRarely
Solution architectOne solution spanning several systems or teamsHow systems integrate, which services, data flowsSolution design, integration diagrams, ADRsSometimes (prototypes)
Application architectOne application or productStyle, modules, data model, quality goalsContainer/component diagrams, ADRs, fitness functionsOften
Technical leadOne team's codebaseDesign inside modules, code standards, reviewsCode, tests, design notesDaily
text
     Step  Question                                         Whose job (usually)
1    1     "Which identity provider for all products?"      Enterprise architect
2    2     "How does checkout talk to payment and tax?"     Solution architect
3    3     "Modular monolith or services for the shop?"     Application architect (with the team)
4    4     "How do we structure the pricing package?"       Technical lead

Real scenario: a retailer's enterprise architect picks Kafka as the event backbone; the solution architect defines the order-event contracts; the application architect decides the shop publishes events through an outbox; the tech lead writes the relay.

What provides it: a clear RACI of who decides what, plus ADR scope fields ("applies to: shop", "applies to: all").

Fix / how to use it: push decisions to the lowest level that has the information; escalate only what crosses a boundary.

Ivory tower vs hands-on Important ​

In plain words: an ivory-tower architect draws from a distance; a hands-on architect stays close to code and learns from it.

Common misunderstanding: "Hands-on means the architect writes the critical code." That makes the architect a bottleneck. Hands-on means staying in contact: pairing, reviewing, prototyping, reading production data.

AspectIvory towerHands-on
FeedbackSlides and documentsCode, incidents, metrics
DecisionsHanded down earlyMade with the team, near the last responsible moment
DocumentsLarge, rot quicklySmall, in the repository, tied to tests
Team reactionIgnore or work aroundAsk for help
Fowler's nameArchitectus ReloadusArchitectus Oryzus (the guide)
RiskDesign nobody followsArchitect drowns in code, becomes a bottleneck

Real scenario: an ivory-tower design mandates a service mesh for ten developers; the team ignores it. A hands-on architect would first measure whether the problem exists.

Fix / how to use it: a rule of thumb: spend a fixed share of time (a day a week) on real code or incident review; rotate architects through teams.

Architecture in agile: emergent vs intentional, runway, last responsible moment Must-know ​

In plain words: agile does not remove architecture; it changes when you decide. Decide the expensive things carefully and early enough, the cheap things late, and keep the system able to change.

Common misunderstanding: "Agile teams do not need architecture; it emerges from the code." The scaled framework SAFe says the opposite: organisations "overcome these problems by balancing emergent design with intentional architecture, which requires some centralized planning and cross-team coordination."

IdeaMeaningSource
Emergent designStructure grows with the code, protected by tests and refactoringFowler, Is Design Dead?; XP
Intentional architectureDeliberate decisions made ahead for large or risky partsSAFe (Agile Architecture)
Last responsible momentThe moment at which failing to decide "eliminates an important alternative"Poppendieck, Lean Software Development (quoted at Coding Horror)
Architectural runway (the SAFe term; we call it the architecture runway)"Existing code, components, and technical infrastructure needed to implement near-term features with minimal redesign and delay"SAFe definition
YAGNIDo not build for speculative needsFowler bliki
Walking skeletonA thin end-to-end slice that exercises every layerCockburn (term), see Design chapter

Poppendieck's wording: "Concurrent development makes it possible to delay commitment until the last responsible moment, that is, the moment at which failing to make a decision eliminates an important alternative. If commitments are delayed beyond the last responsible moment, then decisions are made by default, which is generally not a good approach to making decisions."

text
     Step  Week   Decision                              Why now (or not)
1    1     1      Language, repo layout, CI              Cheap now, painful later; runway
2    2     1      "Modular monolith, one PostgreSQL"     Hard to reverse: decide with ADR-0001
3    3     2      Payment provider API                   Delay: use an interface; switch at the last responsible moment
4    4     6      Message broker                         No async need yet: postpone (YAGNI); add outbox when needed
5    5     12     Split billing into a service?          Only when a team boundary or scaling need proves it

Real scenario: a startup picks a modular monolith, hides the payment provider behind an interface, and defers the broker for three months. When the second provider arrives, only the adapter changes.

What provides it: enabler stories for runway work, ADRs with "revisit when" triggers, trunk-based development, feature flags (Laravel Pennant, Unleash).

Fix / how to use it: keep a backlog of architecture decisions waiting with a trigger ("decide when traffic exceeds X" or "when a second team owns this").

Documenting architecture: views, C4, ADRs Important ​

In plain words: write down the parts that people need and that rot slowly: the picture of the big pieces and the reasons for the big choices.

Common misunderstanding: "More documentation is better." Nygard: big documents are never kept up to date; small modular ones "have at least a chance". Document for a reader and a purpose.

ToolWhat it capturesDetail chapter
Views (Kruchten 4+1)One system seen from logical, process, development, physical and scenario viewpoints4+1 views
C4 model (Simon Brown)Hierarchical abstractions: software systems, containers, components, code; diagrams: system context, containers, components, codec4model.com
ADR (Nygard, 2011)One decision: context, decision, consequences, statusArchitecture Decisions
Quality scenariosCharacteristics as testable statementsRequirements to architecture
Fitness functionsExecutable documentation of a rulebelow
README + diagrams in repoEntry point for a new readerConvention

A minimal ADR (we use this shape through the path):

text
     ADR-0003: Modules talk through contracts only
1    Status:        Accepted (2026-11-25)
2    Context:       Orders and billing change at different speeds; two teams will own them
3    Decision:      orders depends on its own Biller interface; billing hides internals; a test enforces both
4    Consequences:  + independent changes, - one more interface to maintain; revisit if billing becomes a service

Real scenario: a new engineer proposes merging the two modules "to remove the interface". git log docs/adr shows ADR-0003 and its trigger; the conversation takes five minutes instead of five meetings.

What provides it: docs/adr/NNNN-title.md in the repository, a C4 context diagram in the README, PR templates that ask "is this architecturally significant?".

Fix / how to use it: one context diagram, one container diagram, and an ADR per significant decision are enough to start.

Evaluating architecture: ATAM and fitness functions Important ​

In plain words: you can test an architecture on paper before building it (ATAM), and test the built one continuously (fitness functions).

Common misunderstanding: "Architecture review is a gate at the end." ATAM is done early (it evaluates a design against quality goals), and fitness functions are done constantly.

Definition:

  • ATAM (Architecture Tradeoff Analysis Method, SEI) "a method for evaluating software architectures relative to quality attribute goals"; it "gets its name because it not only reveals how well an architecture satisfies particular quality goals but it also provides insight into how those quality goals interact with each other—how they trade off against each other". A typical evaluation takes three to four days with an evaluation team, architects and stakeholders, in nine steps. Outputs include risks, non-risks, sensitivity points and trade-off points.
  • Fitness function (Thoughtworks): fitness functions "describe how close an architecture is to achieving an architectural aim"; with fitness-function-driven development "we can also write tests that measure a system's alignment to architectural goals".
MethodWhenCostFindsExample
ATAMDesign stage, before big commitmentsDays of several peopleRisks, trade-off points"Single queue is a latency sensitivity point"
Quality-attribute scenariosAny timeHoursMeasurable goals"p95 under 200 ms at 500 req/s"
Fitness function, structuralEvery commitFree (CI)Rule violationsImport test, go-arch-lint, deptrac, Pest arch()
Fitness function, operationalPipeline/productionModerateQuality driftLatency budget in a load test, error-budget burn alert
Review/inspectionAt milestonesHoursMisreadingsPeer review of ADRs
text
     Step  Pipeline stage         Fitness function                       Fails the build when
1    1     Commit                 go-arch-lint / deptrac                 orders imports billing
2    2     Unit tests             archtest: imports test                  A package other than main wires both modules
3    3     Integration            SQL: no cross-schema foreign keys       billing.* references orders.*
4    4     Load test (nightly)    p95 budget                              p95 above 200 ms
5    5     Production             SLO burn-rate alert                     Error budget burns too fast

Real scenario: in a design review a team learns that its "one shared cache for all services" is a sensitivity point for availability; they add a per-service fallback before writing code.

What provides it: SEI's ATAM materials; for fitness functions, any CI runner plus the tools shown in Go and Laravel.

Fix / how to use it: pick two or three rules you are afraid of losing (dependency direction, data ownership, latency) and automate those first.

Evolutionary architecture Important ​

In plain words: build the system so it can keep changing safely, and use automated checks to steer it.

Common misunderstanding: "Evolutionary means no plan." The definition (Ford, Parsons, Kua, via Thoughtworks): "An evolutionary architecture supports guided, incremental change as a first principle across multiple dimensions." Note guided: fitness functions provide the guidance.

DimensionExample of incremental changeGuard (fitness function)
StructureExtract a module into a serviceDependency rule tests
DataSplit a schemaNo cross-schema foreign keys
PerformanceAdd a cacheLatency budget test
SecurityRotate a libraryDependency scanner in CI
OperationsMove hostingSmoke and SLO checks

Real scenario: a team moves billing from a module to a service over four releases: contract first, adapter second, data copy third, cutover fourth; each step is guarded by tests (see Service boundaries).

Fix / how to use it: make every large change a sequence of small reversible ones, each with a guard.

Common failure modes Must-know ​

In plain words: most architecture failures are social and economic, not technical: choosing for the CV, rewriting everything, copying someone else's setup.

Common misunderstanding: "These failures are about picking bad technology." The technology is usually fine; the reason for choosing it was wrong.

FailureWhat it looks likeEvidence or sourceCounter-move
Resume-driven designTechnology chosen because the engineer wants it on a CVCommunity term (not a primary source)Require an ADR with trade-offs and a "do nothing" option
Big-bang rewriteStop and rebuild the whole systemSpolsky: Netscape made "the single worst strategic mistake that any software company can make"Strangler approach, incremental migration
Cargo cult microservicesCopying Netflix-style structure without its prerequisitesFowler: teams "too eager to embrace microservices"; his Monolith First: "Almost all the cases where I've heard of a system that was built as a microservice system from scratch, it has ended up in serious trouble."Monolith vs microservices vs modular
Ivory towerDecisions made far from codeFowler: Architectus ReloadusHands-on
Architecture astronautsAbstractions for imagined needsYAGNILast responsible moment
Accidental architectureNo one decided anythingStructure emerges from hacksName and record the top decisions
Distributed monolithServices that must deploy togetherSee Service boundariesAlign boundaries to change and teams
text
     Step  Month  Event in a cargo-cult story (illustrative, inference)    Result
1    1     0      "We need microservices" (no pain stated)                No measurable goal
2    2     2      12 services, 4 developers                               Deploys need coordination
3    3     5      Shared database kept "for now"                          Distributed monolith
4    4     9      Incidents rise, features slow                           Merge services back, lose a year

Fix / how to use it: for every big proposal ask: what problem do we have today, how will we measure that it is solved, what do we give up, and what is the smallest reversible first step?

Reading map of this path ​

AR 01 Foundations01 What architecture is02 4+1 views03 Decisions and ADRs04 Requirements to architecture05 Capacity estimation06 SLA, SLO, SLIAR 02 Styles07 Styles vs patterns08 Layered monolith09 Modular monolith10 Microkernel / plugin11 Client-server12 Pipe-and-filter13 SOA14 Microservices15 Big dataAR 03 Microservices in practice16 Monolith vs micro vs modular17 Service boundaries18 Service communication19 Gateway, BFF, mesh20 Service discovery21 Data ownership

All 21 chapters, in reading order. Chapters not yet written appear as planned in the path overview.

#ChapterOne line
01This pageWhat architecture is, why it exists, what an architect does
024+1 View ModelFive views of one system and the scenarios that tie them
03Architecture DecisionsTrade-offs, ADRs, second-order effects, no perfect architecture
04Requirements to ArchitectureFrom stakeholder needs to quality scenarios and decisions
05Capacity EstimationBack-of-the-envelope traffic, storage, bandwidth
06SLA, SLO, SLI, Error BudgetsTurning reliability into numbers and budgets
07Styles vs PatternsWhich words mean what, and where each applies
08Layered MonolithHorizontal layers and their dependency rule
09Modular MonolithOne deployable, enforced module boundaries
10Microkernel / PluginA small core plus extensions
11Client-ServerThe variants from thin client to peer-to-peer
12Pipe-and-FilterStages connected by streams
13SOAServices, buses and what went wrong
14MicroservicesIndependent services and their costs
15Big Data Architectures3Vs, batch vs stream, Lambda and Kappa
16Monolith vs Microservices vs ModularA decision framework
17Service BoundariesTeams, Conway's law, the distributed monolith
18Service CommunicationSync vs async, contracts, retries, idempotency
19Gateway, BFF, MeshEdge and cross-cutting infrastructure
20Service DiscoveryFinding instances: DNS, registries, health checks
21Data OwnershipDatabase per service and brownfield options

Neighbouring paths: Design (responsibilities inside a module), System Design (load and building blocks), Database and Messaging (the data and communication choices architecture depends on).

Mechanics ​

Deciding whether a decision is architectural Must-know ​

Ask four questions in order; two "yes" answers make it architectural and worth an ADR.

QuestionYes means
Does it change structure (modules, services, data ownership)?Structural
Does it change a top-three characteristic?Characteristic-affecting
Is it expensive or slow to reverse (many callers, data, contracts)?High reversal cost
Do several teams depend on it?Cross-team

Writing the dependency rule so a machine can check it Important ​

A rule must be (1) stated in one sentence, (2) mapped to code locations, (3) enforced in CI. Example: "orders must not import billing; the composition root may." The Go and Laravel sections do exactly that.

Where each rule is enforced ​

Layer of enforcementGoPHP / Laravel
Compiler / languageinternal/ packages; import cycles are compile errorsNamespaces and final classes only (no enforcement across namespaces)
Static analysisgo-arch-lint (.go-arch-lint.yml, "mayDependOn")Deptrac (deptrac.yaml, layers and ruleset)
Unit-test stylego/parser imports testPest arch() expectations
DataSQL query over pg_constraintSame query in a migration test
OperationalBenchmark or load-test thresholdPest + k6/Artillery threshold

Error messages and signals you will see ​

WhereSignalMeaning
Go compileruse of internal package ... not allowedYou crossed a module's hidden boundary
Go compilerimport cycle not allowedTwo packages depend on each other
archtest (this page)../internal/orders imports ...billing: violates ADR-0003The dependency rule was broken
go-arch-lintA reported "component X shouldn't depend on Y" violation (exact wording depends on version, not verified)Config says no
DeptracA violation list with the two layers and the file (exact wording not verified)Ruleset says no
Laravel containerTarget [App\Modules\Billing\Api\Billing] is not instantiableProvider not registered in bootstrap/providers.php

Go: architecture as code ​

The module is docs/snippets/architecture/what-is-software-architecture/go; gofmt, go vet and go test ./... pass. Layout:

text
     Path                                   Role
1    cmd/api/main.go                         Composition root: the only file that sees both modules
2    internal/orders/orders.go               Module "orders": declares the Biller interface it needs
3    internal/billing/billing.go             Module "billing": public surface
4    internal/billing/internal/ledger/       Hidden detail (Go internal rule)
5    archtest/arch_test.go                   Fitness functions
6    .go-arch-lint.yml                       Dependency rules for go-arch-lint

Example ​

The two modules and the composition root:

go
// Package orders is one module. It declares the small interface it needs
// from billing (consumer-side), so it never imports the billing package.
package orders

import (
	"context"
	"fmt"
)

// Biller is what orders needs from whoever charges money.
type Biller interface {
	Charge(ctx context.Context, customerID string, cents int64) error
}

// Order is the result of a successful placement.
type Order struct {
	ID         int64
	CustomerID string
	Cents      int64
}

// Service places orders.
type Service struct {
	biller Biller
	nextID int64
}

// New builds the orders service around a Biller.
func New(b Biller) *Service {
	return &Service{biller: b}
}

// Place charges the customer and returns the order.
func (s *Service) Place(ctx context.Context, customerID string, cents int64) (Order, error) {
	if err := s.biller.Charge(ctx, customerID, cents); err != nil {
		return Order{}, fmt.Errorf("place order: %w", err)
	}
	s.nextID++
	return Order{ID: s.nextID, CustomerID: customerID, Cents: cents}, nil
}
go
// Package billing is one module. Its public surface is this file only;
// everything else lives below internal/.
package billing

import (
	"context"
	"errors"

	"academy/what-is-software-architecture/internal/billing/internal/ledger"
)

// ErrInvalidAmount is returned for zero or negative charges.
var ErrInvalidAmount = errors.New("billing: amount must be positive")

// Service charges customers.
type Service struct {
	ledger *ledger.Ledger
}

// New builds a billing service with an empty ledger.
func New() *Service {
	return &Service{ledger: &ledger.Ledger{}}
}

// Charge records a charge of cents for the customer.
func (s *Service) Charge(ctx context.Context, customerID string, cents int64) error {
	if err := ctx.Err(); err != nil {
		return err
	}
	if cents <= 0 {
		return ErrInvalidAmount
	}
	s.ledger.Append(ledger.Entry{CustomerID: customerID, Cents: cents})
	return nil
}

// Charges reports how many charges were recorded (useful in tests).
func (s *Service) Charges() int {
	return s.ledger.Len()
}
go
// Package ledger is a hidden detail of the billing module (Go "internal" rule).
package ledger

import "sync"

// Ledger is an append-only in-memory list of charges in integer cents.
type Ledger struct {
	mu      sync.Mutex
	entries []Entry
}

// Entry is one charge.
type Entry struct {
	CustomerID string
	Cents      int64
}

// Append records a charge.
func (l *Ledger) Append(e Entry) {
	l.mu.Lock()
	defer l.mu.Unlock()
	l.entries = append(l.entries, e)
}

// Len returns the number of recorded charges.
func (l *Ledger) Len() int {
	l.mu.Lock()
	defer l.mu.Unlock()
	return len(l.entries)
}
go
// Command api is the composition root: the only place that knows both modules.
package main

import (
	"context"
	"fmt"
	"os"

	"academy/what-is-software-architecture/internal/billing"
	"academy/what-is-software-architecture/internal/orders"
)

func main() {
	bill := billing.New()
	svc := orders.New(bill) // billing satisfies orders.Biller implicitly

	o, err := svc.Place(context.Background(), "c-42", 1999)
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	fmt.Printf("order %d for %s: %d cents, %d charge(s) in ledger\n", o.ID, o.CustomerID, o.Cents, bill.Charges())
}

The dependency rules as a linter config (go-arch-lint, schema version 3; reviewed against its README and syntax table, not executed here because the tool is not installed on the authoring machine):

yml
# go-arch-lint config (schema version 3). Run from the module root:
#   go install github.com/fe3dback/go-arch-lint@latest && go-arch-lint check
version: 3
workdir: internal
components:
  orders:  { in: orders }
  billing: { in: billing }
deps:
  orders:
    mayDependOn: []        # orders must not import billing; it uses its own Biller interface
  billing:
    mayDependOn: []        # billing knows nothing about orders

The fitness functions as tests: two structural (dependency rule, composition root) and one operational (latency budget):

go
// Package archtest holds fitness functions: automated checks that an
// architecture decision still holds. They run with plain `go test ./...`.
package archtest

import (
	"context"
	"go/parser"
	"go/token"
	"io/fs"
	"path/filepath"
	"sort"
	"strings"
	"testing"
	"time"

	"academy/what-is-software-architecture/internal/billing"
	"academy/what-is-software-architecture/internal/orders"
)

const mod = "academy/what-is-software-architecture/"

// imports returns, per module directory under ../internal, the set of
// project import paths used by its non-test files.
func imports(t *testing.T, dir string) map[string]bool {
	t.Helper()
	set := map[string]bool{}
	err := filepath.WalkDir(dir, func(p string, d fs.DirEntry, err error) error {
		if err != nil || d.IsDir() || !strings.HasSuffix(p, ".go") || strings.HasSuffix(p, "_test.go") {
			return err
		}
		f, err := parser.ParseFile(token.NewFileSet(), p, nil, parser.ImportsOnly)
		if err != nil {
			return err
		}
		for _, im := range f.Imports {
			path := strings.Trim(im.Path.Value, `"`)
			if strings.HasPrefix(path, mod) {
				set[path] = true
			}
		}
		return nil
	})
	if err != nil {
		t.Fatal(err)
	}
	return set
}

// ADR-0003 (dependency rule): orders and billing must not import each other.
func TestModulesDoNotImportEachOther(t *testing.T) {
	rules := map[string]string{
		"../internal/orders":  mod + "internal/billing",
		"../internal/billing": mod + "internal/orders",
	}
	for dir, forbidden := range rules {
		for imp := range imports(t, dir) {
			if strings.HasPrefix(imp, forbidden) {
				t.Errorf("%s imports %s: violates ADR-0003", dir, imp)
			}
		}
	}
}

// ADR-0003: the composition root is the only place allowed to see every module.
func TestOnlyMainWiresModules(t *testing.T) {
	var users []string
	_ = filepath.WalkDir("..", func(p string, d fs.DirEntry, err error) error {
		if err != nil || d.IsDir() || !strings.HasSuffix(p, ".go") || strings.HasSuffix(p, "_test.go") {
			return err
		}
		f, perr := parser.ParseFile(token.NewFileSet(), p, nil, parser.ImportsOnly)
		if perr != nil {
			return perr
		}
		n := 0
		for _, im := range f.Imports {
			path := strings.Trim(im.Path.Value, `"`)
			if path == mod+"internal/orders" || path == mod+"internal/billing" {
				n++
			}
		}
		if n == 2 {
			users = append(users, filepath.ToSlash(p))
		}
		return nil
	})
	sort.Strings(users)
	if len(users) != 1 || users[0] != "../cmd/api/main.go" {
		t.Errorf("only cmd/api/main.go may import both modules, got %v", users)
	}
}

// ADR-0004 (quality attribute, performance): placing an order in-process must
// stay far below the 50 ms budget we gave this step. The budget is generous so
// the test is stable; a real one would read p95 from load-test output.
func TestPlaceOrderLatencyBudget(t *testing.T) {
	svc := orders.New(billing.New())
	const n = 1000
	durations := make([]time.Duration, 0, n)
	for i := 0; i < n; i++ {
		start := time.Now()
		if _, err := svc.Place(context.Background(), "c-1", 100); err != nil {
			t.Fatal(err)
		}
		durations = append(durations, time.Since(start))
	}
	sort.Slice(durations, func(i, j int) bool { return durations[i] < durations[j] })
	p95 := durations[n*95/100]
	if p95 > 50*time.Millisecond {
		t.Errorf("p95 = %v, budget is 50ms (ADR-0004)", p95)
	}
}

The Go angle ​

Go featureArchitectural use
Package as unit of importDependencies are explicit; the import graph is the structure
internal/The compiler enforces hidden parts (Go 1.4); see go.dev/doc/modules/layout
Implicit interfacesThe consumer owns the interface (orders.Biller); no import of the provider
cmd/<name>One composition root per binary
go/parser with ImportsOnlyCheap, dependency-free architecture tests
go list -deps, go vetExtra checks, run in CI
go-arch-lintDeclarative rules over components, run in CI

Laravel: architecture as code ​

The files are under docs/snippets/architecture/what-is-software-architecture/php (Laravel 13, PHP 8.4). PHP is not installed on the authoring machine; the code and configs were reviewed, not run.

Example ​

The public contract, the hidden internals, the service, the provider and the use case:

php
<?php

declare(strict_types=1);

namespace App\Modules\Billing\Api;

/**
 * Public contract of the Billing module. Other modules may depend on this
 * interface and nothing else inside App\Modules\Billing.
 */
interface Billing
{
    /** @throws \InvalidArgumentException when $cents is not positive */
    public function charge(string $customerId, int $cents): void;
}
php
<?php

declare(strict_types=1);

namespace App\Modules\Billing\Internal;

use Illuminate\Support\Facades\DB;

/** Hidden detail: the module's own table. */
final class Ledger
{
    public function append(string $customerId, int $cents): void
    {
        DB::table('billing_ledger')->insert([
            'customer_id' => $customerId,
            'cents' => $cents,
            'created_at' => now(),
        ]);
    }
}
php
<?php

declare(strict_types=1);

namespace App\Modules\Billing;

use App\Modules\Billing\Api\Billing;
use App\Modules\Billing\Internal\Ledger;
use InvalidArgumentException;

final class BillingService implements Billing
{
    public function __construct(private readonly Ledger $ledger)
    {
    }

    public function charge(string $customerId, int $cents): void
    {
        if ($cents <= 0) {
            throw new InvalidArgumentException('Amount must be positive.');
        }

        $this->ledger->append($customerId, $cents);
    }
}
php
<?php

declare(strict_types=1);

namespace App\Modules\Billing;

use App\Modules\Billing\Api\Billing;
use Illuminate\Support\ServiceProvider;

/** The module's only wiring. Register it in bootstrap/providers.php. */
final class BillingServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->app->bind(Billing::class, BillingService::class);
    }
}
php
<?php

declare(strict_types=1);

namespace App\Modules\Orders;

use App\Modules\Billing\Api\Billing;
use Illuminate\Support\Facades\DB;

/** One use case, one class (an Action). Depends on Billing's contract only. */
final class PlaceOrder
{
    public function __construct(private readonly Billing $billing)
    {
    }

    public function handle(string $customerId, int $cents): int
    {
        return DB::transaction(function () use ($customerId, $cents): int {
            $this->billing->charge($customerId, $cents);

            return DB::table('orders')->insertGetId([
                'customer_id' => $customerId,
                'cents' => $cents,
                'created_at' => now(),
            ]);
        });
    }
}

The dependency rules, twice: as a Deptrac config and as Pest architecture tests (fitness functions):

yaml
# Deptrac config (reviewed against the Deptrac docs, not executed here).
# Run: composer require --dev qossmic/deptrac-shim && vendor/bin/deptrac analyse
deptrac:
  paths:
    - ./app
  layers:
    - name: OrdersModule
      collectors:
        - type: directory
          value: app/Modules/Orders/.*
    - name: BillingApi
      collectors:
        - type: directory
          value: app/Modules/Billing/Api/.*
    - name: BillingInternal
      collectors:
        - type: directory
          value: app/Modules/Billing/(?!Api/).*
  ruleset:
    OrdersModule:
      - BillingApi          # Orders may use Billing's public contract only
    BillingInternal:
      - BillingApi          # Billing's own code may implement its contract
    BillingApi: []
php
<?php

declare(strict_types=1);

// Pest architecture tests (fitness functions), run by `./vendor/bin/pest`.

arch('orders talks to billing through its contract only')
    ->expect('App\Modules\Orders')
    ->not->toUse('App\Modules\Billing\Internal');

arch('billing does not know orders')
    ->expect('App\Modules\Billing')
    ->not->toUse('App\Modules\Orders');

arch('billing internals stay inside billing')
    ->expect('App\Modules\Billing\Internal')
    ->toOnlyBeUsedIn('App\Modules\Billing');

arch('modules use strict types')
    ->expect('App\Modules')
    ->toUseStrictTypes();

The Laravel angle ​

Laravel / PHP featureArchitectural use
Service provider, bootstrap/providers.phpOne provider per module is its wiring (Laravel 13 provider docs)
bind(Interface::class, Concrete::class)Callers depend on the contract; the container supplies the implementation
Action classesOne use case per class, easy to guard
DB::transactionA modular monolith keeps atomicity across modules for free
Pest arch()not->toUse, toOnlyBeUsedIn, toUseStrictTypes (pestphp.com/docs/arch-testing)
DeptracLayers by directory or classLike collector, rules in ruleset
Events and queuesAsynchronous module boundaries (Event-Driven Architecture)

Go and PHP differ in one detail: in Go the consumer owns the interface and never imports the provider, so the rule is "no import at all"; in PHP the provider publishes the Api namespace and the rule is "import Api only".

The data rule from the same decision, as a CI query (PostgreSQL); it must return zero rows:

sql
-- Fitness function for data ownership: no foreign key between module schemas.
SELECT con.conname, src.relname AS from_table, dst.relname AS to_table
FROM pg_constraint con
JOIN pg_class src ON src.oid = con.conrelid
JOIN pg_class dst ON dst.oid = con.confrelid
WHERE con.contype = 'f' AND src.relnamespace <> dst.relnamespace;

The longer, schema-named version lives in docs/snippets/architecture/what-is-software-architecture/php/fitness-cross-schema-fk.sql.

Solving the classic problems ​

Architecture that exists only in people's heads ​

SolutionHowAdvantageCost / limitation
C4 context and container diagrams in the repoMaintained by the teamShared pictureDiagrams drift without review
ADRs per significant decisionNygard formatReasons surviveNeeds discipline
Architecture testsgo-arch-lint, deptrac, Pest arch()Rules cannot silently rotOnly covers what you encode
Onboarding exerciseNew hire redraws the systemFinds gapsTime

Boundary erosion ​

Symptom: "we are a modular monolith" but every module imports every other. Fix: write the dependency rule, run it in CI, allow exceptions only through an ADR. See Modular Monolith.

The architect becomes a bottleneck ​

SolutionHowCost
Advice processAnyone decides after consulting affected people and the architectNeeds trust and ADRs
Principles, not approvalsA short list of principles teams apply themselvesPrinciples must be concrete
Automated complianceFitness functions replace review gatesSetup effort
MentoringRaise the team's level (Fowler: leverage comes from improving the team)Slow payoff

Decisions made too early or too late ​

Use the last responsible moment: list alternatives, list the date after which each is lost, decide at the latest date that still leaves time to learn. Record the trigger in the ADR.

Rewrite fever ​

Replace the rewrite with a sequence of small replacements behind a stable interface; measure after each. See Service Boundaries and Microservices Data Ownership for brownfield options.

Choosing: how much architecture, how early ​

SituationRecommended amountTechniquesReason
Prototype, throw-awayAlmost noneWalking skeleton, one ADR on "this is disposable"Learning beats structure
Startup product, one teamLightModular monolith, 3 characteristics, ADRs for data and authKeep change cheap
Growing product, several teamsModerateModule boundaries by team, fitness functions, contractsCoordination cost dominates
Regulated or safety-criticalHeavy up frontATAM, views (4+1), traceabilityThe cost of failure is high
Platform used by many teamsStrong governance, light enforcementPrinciples, paved roads, automated checksConsistency at scale
Legacy systemEvolutionaryStrangler, characterisation tests, fitness functionsRewrites fail (see failure modes)

In architecture: from a single process to a distributed system ​

Monolith: one process, one database ​

Everyday example: a small shop's web app in one Laravel project. The architecture decisions are few: one database, folders by feature, one queue. Write them as three ADRs and one context diagram. The dependency rule is simple (controllers do not query tables directly) and the characteristic that matters is modifiability. See Layered Monolith.

Production example: a Go API with cmd/api, internal/orders, internal/billing (this page's module) and the archtest in CI. A change in billing cannot break orders at compile time because the rule forbids the import.

Modular monolith and multiple databases ​

Modules own their code and their schema (PostgreSQL schemas orders, billing). The rule set grows: contract-only calls, no cross-schema foreign keys (the SQL fitness function above), a transaction boundary at the composition root. The architect's job shifts from drawing boxes to defining and automating the rules. See Modular Monolith.

DecisionChoiceGuard
BoundaryModule per business capabilityDeptrac / go-arch-lint
DataSchema per moduleNo cross-schema foreign keys query
CommunicationIn-process contract; events for side effectsPest arch() / import test
DeployOne artifactSingle pipeline

Microservices: boundaries with a network ​

When a module becomes a service, every in-process call becomes a network call with latency, partial failure and versioning. Architecture now has three more jobs: contract evolution, resilience policy (timeouts, retries, idempotency) and data ownership (Service Communication, Data Ownership). Fowler's Microservice Premium is the honest summary: you pay for deployment automation, monitoring, failure handling and eventual consistency. A multi-service example:

text
     Step  Caller          Call                                     Failure mode to design for
1    1     shop-web        POST /orders (orders service)            Timeout: retry only with Idempotency-Key
2    2     orders          charge(customer, cents) (billing)        Billing down: queue the charge or fail the order
3    3     billing         publishes ChargeSucceeded (via outbox)   Duplicate event: consumers must be idempotent
4    4     orders          consumes event, marks order paid         Event arrives late: UI shows "processing"

Distributed data: replicas, caches and multi-region ​

Characteristics now compete across regions: consistency versus latency versus availability. Examples: a read replica gives read scale but replica lag breaks read-your-writes (Replication); a cache gives latency but stale reads; multi-region gives availability but cross-region coordination (Distributed SQL). Architecture's job is to decide per data set which trade-off applies, write it as an ADR, and test it (fitness functions on staleness, lag alerts).

Scaling path: 1x, 10x, 100x ​

LoadTypical architectureMain architectural riskWhat to automate
1xModular monolith, one PostgreSQLAccidental couplingDependency rules
10xSame, plus read replicas, cache, queueStale reads, hot spotsLatency and lag budgets
100xSome services, partitioned data, async eventsDistributed monolith, ownership confusionContract tests, SLO burn alerts

Sizing the numbers is in Capacity Estimation; the system-level building blocks are in the System Design path.

Lab: add architecture as code to a project ​

Setup: use the Go module from this page (docs/snippets/architecture/what-is-software-architecture/go).

  1. Run the tests. cd into the module and run go test ./.... Expected: ok academy/what-is-software-architecture/archtest.
  2. Break the rule. In internal/orders/orders.go add the import "academy/what-is-software-architecture/internal/billing" and use billing.New() somewhere. Run go test ./archtest. Expected: a failure that names ../internal/orders and ADR-0003.
  3. Break the composition-root rule. Add a second main-like file that imports both modules (for example under internal/orders/wire). Expected: TestOnlyMainWiresModules reports two users.
  4. Hit the language boundary. From cmd/api/main.go import .../internal/billing/internal/ledger. Expected: the compiler error use of internal package ... not allowed.
  5. Add a characteristic. Add a benchmark or test that asserts p95 latency under 5 ms for Place (tighten the budget in TestPlaceOrderLatencyBudget). Note the trade-off: a tight budget may fail on a loaded CI runner; write it into a new ADR-0004 as consequences.
  6. Laravel (optional). Copy the PHP files into a Laravel 13 project, register BillingServiceProvider in bootstrap/providers.php, install Pest and Deptrac, run ./vendor/bin/pest and vendor/bin/deptrac. Expected: all pass; adding use App\Modules\Billing\Internal\Ledger; to PlaceOrder.php fails both.
  7. Write one ADR for the rule you just enforced, with context, decision, consequences and a revisit trigger.

Common misconceptions ​

BeliefReality
Architecture is the diagramA diagram is a view; the structures and decisions are the architecture
Architecture equals microservicesA modular monolith, layered monolith or pipeline are architectures too
The architect makes all important decisionsFowler: value is inversely proportional to the number of decisions made; mentor and guide
Architects should not codeHands-on contact keeps decisions grounded; do not become the bottleneck either
Agile means no up-front architectureSAFe: balance emergent design with intentional architecture
More documentation means better architectureSmall ADRs and diagrams that are kept current beat large documents
There is a best architectureFirst law: everything is a trade-off
Pick the technology firstCharacteristics and constraints first; technology is infrastructure
A rewrite will fix itSpolsky: a rewrite is the single worst strategic mistake; evolve instead
Compliance is a review meetingAutomate it with fitness functions
Quality attributes are optional extrasThey decide the structure; features alone do not
The cloud provider is the architectureIt is infrastructure that constrains the architecture

Cheat sheet ​

TopicRemember
Bass et al.Structures: elements, relations, properties
ISO/IEC/IEEE 42010Fundamental concepts or properties of a system in its environment, embodied in elements, relationships, principles of design and evolution
Fowler / JohnsonShared understanding of experts; the important stuff
Richards / FordStyle, characteristics, logical components, decisions (and principles)
Why architectureChange, communication, quality attributes, cost of reversal
Three scopesArchitecture shape, infrastructure ground, design rooms
First lawEverything is a trade-off; second: why over how; third: spectrum
Architect expectationsDecide, analyse, keep current, comply, diversify, domain, people, politics
ArchetypesEnterprise, solution, application, technical lead
Fowler's two architectsReloadus decides all; Oryzus mentors and guides
AgileEmergent plus intentional; runway; last responsible moment
DocsContext + container diagrams (C4), views (4+1), ADRs
EvaluationATAM (days, early), fitness functions (every commit)
EvolutionaryGuided, incremental change as a first principle
Failure modesResume-driven, big-bang rewrite, cargo cult, ivory tower
Toolsgo-arch-lint, internal/, go/parser tests; Deptrac, Pest arch()

Self-check: questions & answers ​

Show:
  • Must-know asked in almost every interview
  • Important frequent; expected at senior level
  • Good to know extra depth that sets you apart

1 — State the Bass, Clements and Kazman definition and one thing it leaves out compared with ISO 42010. Good to know ​

Answer

Answer: Structures of the system: software elements, their externally visible properties and the relationships among them. It does not mention the system's environment or the principles of design and evolution, which ISO 42010 includes. See Definitions.

2 — What did Ralph Johnson object to in "architecture is the fundamental organisation"? Good to know ​

Answer

Answer: There is no objective way to say what is fundamental or high-level; he preferred the shared understanding of the experts, and concluded "Architecture is about the important stuff. Whatever that is." See History.

3 — Give the four needs that make architecture exist. Must-know ​

Answer

Answer: Managing change, communication, quality attributes, and cost of reversal (plus coordination of teams). See Why.

4 — Is choosing Kubernetes an architectural decision? Must-know ​

Answer

Answer: It is mainly infrastructure; it becomes architectural to the extent it changes structure or a characteristic (deployability, elasticity). See Scopes.

5 — State the first law and one corollary. Important ​

Answer

Answer: Everything in software architecture is a trade-off; if you think you found something that is not, you have not found the trade-off yet (or: you cannot do the analysis only once). See Laws.

6 — Name Fowler's two kinds of architect and the rule of thumb about value. Important ​

Answer

Answer: Architectus Reloadus (makes all decisions) and Architectus Oryzus (collaborates, mentors). Value is inversely proportional to the number of decisions the architect makes. See Role.

7 — Why is Richards and Ford's "ensure compliance" best automated? Important ​

Answer

Answer: Manual governance makes architects police and teams avoid them; fitness functions check rules on every commit. See Evaluating.

8 — Define the last responsible moment and the architectural runway. Important ​

Answer

Answer: LRM: the moment at which failing to decide eliminates an important alternative. Runway: existing code, components and infrastructure needed to implement near-term features with minimal redesign and delay. See Agile.

9 — What does ATAM produce and when do you run it? Good to know ​

Answer

Answer: Findings about quality-attribute fit and trade-offs: risks, non-risks, sensitivity points, trade-off points; run it on a design before large commitments (three to four days with stakeholders). See Evaluating.

10 — In the Go module, why does orders declare Biller itself? Must-know ​

Answer

Answer: The consumer owns the interface, so orders never imports billing; only the composition root wires them. This is the rule the tests enforce. See Go.

11 — Name two ways the Laravel example enforces the module boundary. Important ​

Answer

Answer: Deptrac layers with a ruleset and Pest arch() expectations (not->toUse, toOnlyBeUsedIn). See Laravel.

12 — Why is a big-bang rewrite an architectural failure mode? Must-know ​

Answer

Answer: It throws away working knowledge and delivers nothing until the end; Spolsky calls it the single worst strategic mistake. Evolve in small guarded steps instead. See Failure modes.

Glossary ​

TermMeaning
Software architectureStructures, characteristics, decisions and principles of a system, as understood by its builders
StructureElements and the relations between them
ElementA part of the system: module, service, database, component
Architecture characteristicA non-functional property the architecture must support (also quality attribute, "-ility")
Quality attributeSEI/ISO term for a measurable system quality
Architecture decisionA choice that shapes structure or characteristics
Design principleA guideline that steers many decisions
ISO/IEC/IEEE 42010Standard for architecture description: stakeholders, concerns, viewpoints, views
StakeholderAnyone with a concern about the system
ArchitectThe person who worries about the important stuff and keeps it healthy
Enterprise architectArchitect for the whole organisation's landscape
Solution architectArchitect for one solution spanning several systems
Application architectArchitect for one application or product
Technical leadTeam-level design owner who also codes
Ivory-tower architectOne who decides at a distance from the code
Architectus OryzusFowler's hands-on, collaborating architect (the guide)
Trade-offA gain paid for with a loss elsewhere
ATAMSEI's Architecture Tradeoff Analysis Method
Fitness functionAutomated check that an architectural goal or rule still holds
Evolutionary architectureArchitecture supporting guided, incremental change
ADRArchitecture decision record
C4 modelContext, container, component, code diagrams (Simon Brown)
4+1 viewsKruchten's five-view description model
Last responsible momentThe latest time a decision can be made without losing an important alternative
Architectural runwayExisting code and infrastructure that lets near-term features ship with minimal redesign
Emergent designStructure that grows with code under tests
Intentional architectureDeliberate, planned structural decisions
Resume-driven designChoosing technology for the CV
Cargo cultCopying visible form without the conditions that made it work
Distributed monolithServices that must change and deploy together
Composition rootThe one place where modules are wired together
go-arch-lintGo linter that checks dependency rules from a YAML file
DeptracPHP static analyser that enforces layer dependency rules
Pest arch()Pest's architecture-testing API

References ​

Built by Morteza Negahi