Book Deep Read · Fundamentals of Software Architecture · Chapter 7

Scope of Architecture Characteristics: The Boundary Is Not the System, It Is the Architecture Quantum

Fundamentals of Software Architecture · Ch 7 · Mark Richards & Neal Ford · 2020

中文 →

What is this chapter about?

The previous chapters taught you to pick the few qualities a system must have: handle crowds, stay up, be easy to change. This chapter asks: do you set one list of qualities for the whole system, or a different list for each part? Think of an auction website. The part where viewers watch the live stream and place bids can see tens of thousands of people rush in at once; the part that settles payments with sellers handles a few hundred a day. Holding both to the same standard is either wasteful or not enough.

An analogy: departments in a hospital

In a hospital, the emergency room must be staffed around the clock and see patients within minutes. The check-up clinic can close on weekends. The pharmacy's top priority is never handing out the wrong pill. Nobody would require every department to run like the ER — far too expensive. But if the ER has to stand and wait for the lab's results during surgery, the lab must be just as on-call as the ER, because the ER is stuck until it answers. This chapter is about figuring out which parts of a system count as the same department and must meet the same standard.

Why the old way was hard

People used to assume a system was one big block: shipped together, sharing one database, so its qualities could only be set once. Once systems were split into many small services, that changed, but there was no ready-made ruler for where the lines go. Looking at which piece of code calls which is too fine. Counting how many programs get shipped is too coarse — two programs that share one database are still tied together.

The core idea: see who is tied to whom

The book offers a ruler called the "architecture quantum": the smallest whole chunk that can be shipped on its own and do its job on its own. To tell whether two pieces are the same quantum, ask three things. First, can they ship separately — counting the database each one can't live without, so sharing a database makes them one chunk. Second, are they doing the same job — say, everything about customer details. Third, does one have to wait on the spot for the other's answer? Like a phone call: if the other side doesn't pick up, you just hang there, so both sides need matching stamina. Switch to leaving a voicemail, and the other side can reply later without holding you up — the two come apart.

What it buys you / how to choose

With this ruler you can set qualities chunk by chunk: the bidding part is built to "never stall under a crowd," the payment part to "never lose a cent." If the whole system measures out as one chunk with one set of needs, building it as one block is simplest; only when the parts need very different things is splitting worth it. The honest cost: to let chunks follow different standards, you must replace "wait on the spot" with "leave a message," and the system gets harder to trace and harder to keep perfectly in sync at every moment.

One line to remember

Qualities aren't set for "the whole system" but for each chunk that ships on its own and waits on itself — draw the chunks right first, and the qualities follow.

Want the precise three-part definition of a quantum, why synchronous connascence welds two services together, and how the auction system splits into three quanta? → Switch to Deep