Skip to content

Stating a trade-off

A design choice said in full: the option you took, the one you turned down, the requirement that decided it, and what you gave up. It shows you chose on purpose rather than by habit.

On this page

What it is

A stated trade-off is a design decision said with its cost attached. In a system design round you make a series of choices: where data lives, whether a call waits for its result, what a cache holds, how far to replicate. Each one gives something up. Mark Richards, co-author of Fundamentals of Software Architecture, describes the book's first law as: each structural choice in an architecture is a trade-off, with the corollary that a choice which seems to have no downside has one you haven't found yet. He adds that trade-off analysis needs to start from the characteristics that matter for this system, such as scalability or availability, and that the aim is the least bad architecture rather than a best one. The shape we teach carries all of that in a sentence: X over Y because Z, at the cost of W.

PartWhat it isWhat it tells the listener

X, the choice

The option you're drawing on the board right now.

You've committed, so the rest of the design can build on it.

over Y, the rejected option

An alternative a careful engineer might take in the same spot.

You saw the fork and didn't pick by habit.

because Z, the deciding requirement

A number or constraint from the requirements you agreed earlier.

The decision follows from this system's needs, not from a favorite tool.

at the cost of W, the cost

What gets worse, and how you'll bound it.

You know the bill and have a plan for it.

The same shape is how teams write decisions down. In the architecture decision record format Michael Nygard introduced, the Consequences section lists all the effects of a decision, negative ones included, so the record doesn't turn into advocacy that hides the trade-off. The shorter Y-Statement format is close to the sentence we teach: in a given context, facing a concern, the team decided for one option and against others, to achieve a benefit, accepting a downside. The interview version drops the paperwork and keeps what a listener needs: what, instead of what, why, and at what price.

Here is one from replicated storage. PACELC, which Daniel Abadi first described in a 2010 blog post and refined in a 2012 paper, says that during a network partition a replicated system trades availability against consistency, and the rest of the time it trades latency against consistency, because keeping replicas in step costs round trips. The default versions of the early Dynamo, Cassandra and Riak give up consistency for lower latency in normal operation, while strictly consistent systems such as VoltDB pay for consistency in availability and latency. In the room, that becomes: “Reads from any single replica over a read that waits on several, because the feed is read-heavy and we agreed on low read latency; at the cost of a reader sometimes seeing a post a little after it was written, which is acceptable for a feed. For the account balance I'd pay the latency for the stronger read path.” The requirement decided it, the cost is named, and so is the place where that cost would be unacceptable.

When to use it

At each fork while you build the design, in the moment you draw the box. A trade-off made silently isn't visible; saying it as you go puts the reasoning on the board along with the boxes. One or two sentences per fork is enough. The full sentence belongs on the choices that shape the system: where the data lives, whether a step waits or goes through a queue, how consistent reads must be, what is cached. The same decisions are the ones to revisit when you look for the bottleneck; see Naming the bottleneck first.

When Z has to be real. Richards warns about architects who decide on gut feel, on the scars of a past project, or on what's in fashion, and the same failure shows up in the room as a Z like “because it scales better”, which decides nothing. Pull Z from what you agreed in the first minutes: the read-to-write ratio, the latency target, the consistency requirement, the size of the team that will run it. If those numbers aren't agreed yet, that's the signal to go back and get them; see Functional and non-functional requirements and Back-of-the-envelope estimation.

When not to

Some choices don't need the full sentence. Our advice: save it for the decisions that shape the system.

  • There's no Y you'd seriously consider. If you can't name an alternative a careful engineer might take in this spot, state the choice in a clause and keep moving rather than inventing a straw alternative.
  • The decision is small and reversible in this design. When two options would both do and swapping later is cheap, “either works, I'll take X for now” keeps the time for the structural forks. Judge that per system rather than by category: a format that will be exposed in a public API is a different matter from one kept internal.
  • The interviewer has accepted it and moved on. Restating the trade-off as a closing summary repeats what they already heard.
  • You don't know the cost yet. “I'd want to measure that before committing” is a better W than an invented one, and naming what you'd measure keeps it concrete.
  • The interviewer has fixed the constraint. If they say “assume one region”, take it as given. Our advice: design within it rather than reopening a fork they've closed.

In a behavioral round the shape changes too. A past decision made with a team, with a result you can report, is a story with a setting and an outcome, not a one-sentence fork; see Explaining a decision.

Compared

Option for storing user sessionsWhat it givesWhat it costsWhen it's the right pick

In memory on the application node

The lowest latency, and nothing new to run.

Sessions are lost when the node fails or restarts.

When a user being logged out after a restart is acceptable, or sessions are short-lived and cheap to rebuild.

A separate replicated Redis cluster

Reads around half a millisecond, with expiry handled by the store itself.

A new cluster to run and be on call for, with failover behavior that needs its own runbooks.

When read latency is the binding constraint and there's a team to operate it, or the cluster already exists for other data.

A sessions table in the existing Postgres cluster

Durability and cross-region failover that are already solved for the rest of the data.

Reads around 3 ms instead of about 0.5, and extra load on the primary.

When the team is small, the latency target has room for a few milliseconds, and the primary has headroom.

In a picture

Fork: two optionsWhich requirementdecides?Pick XName the cost andits boundDraw the box,move onProbe: why notY?What Y gave,where it fails
The statement is made at the fork, in the moment. A later probe about Y gets the same sentence from the other side.

How to say it in an interview

The common mistake

Quiz

Which of these is a complete trade-off statement?
The interviewer asks: “Why not write to all replicas synchronously?” What's the strongest response?
You've picked an option and can't think of a downside. What do you do?
Which decision deserves the full statement rather than “either works, I'll take X for now”?

Questions that use this

Related

Sources

  1. Everything Is a Trade-Off: Mark Richards on Making Better Architecture Decisions (Software Architecture Gathering)
  2. Architecture Decision Records: Templates and Operational Patterns for Teams That Keep Them Alive (hidekazu-konishi.com)
  3. PACELC design principle (Wikipedia)
Sign in to report a mistake