1. Courses
  2. Architecture
  3. Software and Solution Architecture
  4. Stop 2

40 minAdvanced

Quality attributes and constraints

Every stakeholder wants the new system to be "fast, reliable and easy to change", and none of those words can be designed or tested. This lesson shows how to run a workshop that turns them into a short list of measurable scenarios and named constraints, so the architecture is chosen for reasons everyone signed.

By the end you can

  • Separate business drivers, quality attributes and constraints, and test which is which
  • Write a quality attribute scenario in six parts, with a response measure someone can check
  • Turn vague words such as "fast", "reliable" and "scalable" into numbers with five questions
  • Run a half-day quality attribute workshop: brainstorm, merge, vote and refine
  • Build a utility tree and find the few scenarios that should drive the design

The everyday picture

A family books a caterer for a wedding and says: "We want the food to be good, and on time." Nobody can plan a kitchen from that sentence.

An experienced caterer asks questions. How many guests? About 400. How long after people sit down should the first plates arrive? Within 20 minutes. What if the power cuts out during the meal? It often does in that area in the rainy season. Each answer changes the plan. Serving 400 plates in 20 minutes needs two serving lines. A likely power cut needs a gas burner or a menu of dishes that are fine at room temperature.

Some facts are not up for discussion at all. The hall has no gas line, the date is fixed, and the food must follow the family's diet rules. The caterer does not trade those away; she designs around them. An architect does the same job with software: ask until "good and on time" becomes numbers, and write down the facts that cannot move.

Three inputs: drivers, quality attributes and constraints

In What system design really is you met functional and non-functional requirements and nine qualities that trade off against each other. At architect level you sort what stakeholders say into three buckets, because each bucket is handled differently.

  • Business drivers say why the work is worth paying for. At Mangrove: release every week instead of every month, never let a report stop goods receiving, and survive four times the normal orders at a festival rush.
  • say how well the system must behave, in numbers. They are where you make trade-offs.
  • are decisions somebody already made. The design must fit them.

The test that separates the last two is one question: could we trade this away if the benefit were big enough? "Goods receiving saves in under 2 seconds" could become 3 seconds if that saved a year of work, so it is a quality attribute with a target. "The Partner app is built by Lagoon Digital under its current contract" cannot be changed by anyone in the room, so it is a constraint. Constraints come in three kinds: technical (PostgreSQL and NestJS are the company standard; the 400 store tills are existing hardware), organisational (team size, an outside agency, who owns which budget) and business or legal (a deadline before festival season, how long finance must keep invoices).

Give every constraint an owner, the person who could lift it. A constraint without an owner is often an old habit. Ask once, politely, "who decided this, and does it still hold?" Then accept the answer and design around it.

To make sure nobody forgets a whole area, use a checklist. The ISO/IEC 25010:2023 product quality model names nine characteristics: functional suitability, performance efficiency, compatibility, interaction capability, reliability, security, maintainability, flexibility and safety. (The 2011 edition had eight; usability and portability were renamed and safety was added.) Walk the list at the end of a workshop and ask, for each one, "did anyone say anything about this?" Together, the drivers, the constraints and the few scenarios that shape the structure are the .

Quick check

Which of these is a constraint for the back-office move?

The quality attribute scenario, in six parts

"The system must be fast" cannot be tested. The Software Engineering Institute (SEI) at Carnegie Mellon, in its architecture methods and the book Software Architecture in Practice (Bass, Clements and Kazman), writes each quality requirement as a with six parts:

  1. Source: who or what causes the event (a store worker, a developer, an attacker, a failing disk).
  2. Stimulus: the event that arrives (saves a goods received note, changes a price rule, the link drops).
  3. Environment: the conditions at that moment (normal day, festival peak, during a deploy, one database replica down, month-end report running).
  4. Artifact: the part of the system that is hit (the receiving API and its database, the pricing module, the POS).
  5. Response: what the system does (saves and updates stock, deploys without touching other modules, keeps selling and syncs later).
  6. Response measure: the number that says pass or fail.
One scenario, six parts 1. Source store receiver 2. Stimulus saves a 40-line GRN 3. Environment month-end report running 4. Artifact receiving API, DB 5. Response saved, stock updated 6. Response measure p95 under 2 s, 0 fails
The scenario behind Mangrove's worst back-office incident. The environment box matters: the same save is easy on a quiet afternoon and hard while a month-end report holds locks on the shared database.

Scenarios are not only about speed. A maintainability scenario: a developer on the buying team (source) adds a new promotion type (stimulus) during normal work (environment) to the pricing module (artifact); the change is built, tested and released without editing other modules (response) in 3 developer-days or fewer, with one team's review (measure). An availability scenario: the store's internet link (source) drops for 2 hours (stimulus) on a Saturday evening (environment); the POS (artifact) keeps selling and syncs later (response); no sale is lost and the sync finishes within 15 minutes of reconnecting (measure). Offline-first apps and data sync shows how a design meets that one.

Write the environment with care. Most expensive design choices come from it: "at 4 times the normal load", "while one replica is down", "during a deploy". A scenario without an environment is usually tested on a quiet day and passes, and then fails on the day that matters.

Quick check

"When a customer searches, the app shows results with p95 under 400 ms, measured at the API." Which part is missing that would most change the design?

Turning adjectives into numbers

Stakeholders speak in adjectives. Your job in the room is to ask until each adjective becomes a measure. Five questions work for almost every word:

  1. Which action? "Fast" for what: search, checkout, saving a goods received note (GRN), a report?
  2. For what share, measured where? A percentile, never an average (Measuring speed and reliability: p99, SLOs and nines explains why), measured at the API or on the device.
  3. Under what conditions? Normal day, festival peak, during a deploy, with a part broken.
  4. What does a miss cost? Minutes of staff time, lost orders, a fine, a lost partner shop. This tells you how much the target is worth.
  5. What is today's number? Measure before you promise. A target far from today's number is a big project; one close to it may need no architecture change.
They sayYou askThe measure
"Fast"Which action, which percentile, which load?GRN save p95 under 2 s at 4 times the morning peak
"Always up"Which hours matter, and what counts as down?Partner ordering available 99.9% from 6:00 to 23:00, per month
"Real-time"How old may the data be before someone acts wrongly?A buyer's price change is visible in the app within 5 minutes
"Scalable"What grows, by how much, by when, at what cost?240,000 app orders a day with checkout p95 unchanged, cost less than twice today's
"Secure"Which asset, which attacker, what response?A partner shop user can never read another shop's invoices; every attempt alerts within 10 minutes
"Easy to change"Which change, by whom, how long?A new promotion type in 3 developer-days, in one module

A useful habit comes from Tom Gilb's Planguage, a notation for requirements: give each measure more than one level. The must level is the worst the business accepts; below it the release is a failure. The plan level is the target you design for. "GRN save p95: must 3 s, plan 2 s" tells the team where the hard line is and where they have room to trade.

Finally, a good measure is checkable by someone other than you. A person should be able to run a test or open a dashboard and say pass or fail. That is what lets you turn the scenario into an automated fitness function later in the course.

Quick check

Which response measure could a teammate check without asking you what you meant?

Running the workshop

The SEI's (QAW) has eight steps: presentation and introductions, the business or mission presentation, the architectural plan presentation, identification of architectural drivers, scenario brainstorming, scenario consolidation, scenario prioritisation and scenario refinement. The full version can take a day or more. Michael Keeling's book Design It! describes a lighter "mini-QAW" that fits a few hours. For most product teams, half a day is enough.

Who comes. Eight to twelve people who feel the system's pain or pay for it: the sponsor, product managers, someone from the stores, finance, the on-call engineer, a data analyst, security, and the outside agency if one builds part of the system. Leave out people who only want to watch; they make the room quieter.

A half-day agenda.

  1. 15 minutes: purpose and rules. Show one finished scenario so people see the shape.
  2. 20 minutes: the sponsor presents the business drivers.
  3. 15 minutes: an engineer shows today's architecture and its known pains.
  4. 20 minutes: list the drivers and constraints heard so far, each constraint with an owner.
  5. 60 minutes: brainstorm in a round robin. Each person offers one scenario or passes, until two rounds in a row produce nothing new. The facilitator checks that every scenario has a stimulus and a response.
  6. 20 minutes: consolidate. Merge scenarios that say the same thing, so votes are not split between duplicates.
  7. 15 minutes: prioritise with dot voting. A common rule of thumb is to give each person votes equal to about a third of the scenario count.
  8. 40 minutes: refine the top four to six into full six-part scenarios with numbers. You finish the rest after the meeting and send them out for sign-off.

Two facilitation moves matter most. First, start from incidents: "tell me about the last time this system hurt you" produces better scenarios than "what qualities do you want?". Second, park solutions. When someone says "we need microservices" or "we need GraphQL", write it on a parking list and ask "what problem would that solve?" The answer is the scenario. The solution comes later, in Choosing an architecture style.

You leave the room with three things: the prioritised scenarios, the constraints with owners, and a list of open questions and risks (for example "nobody knows today's p95 for partner orders").

The utility tree: which scenarios drive the design

The SEI's Architecture Tradeoff Analysis Method (ATAM) adds a tool for the last step, the . The root is "utility", the overall goodness of the system. The branches are quality attributes, the leaves are concrete scenarios. Each leaf gets two ratings, high, medium or low: how important it is to the business, and how difficult or risky it is to achieve.

Attribute Scenario I,D Utility Performance Modifiability Availability Security Scalability GRN save in 2 s during report price change in weekly release partner orders 99.9%, 6 to 23 h shop sees only its own invoices 10x orders in five years H,H H,H H,M H,L M,H H,H leaves are drivers
Each leaf is rated for business importance (I) and difficulty (D). The two high-high leaves shape the structure. The high-low leaf is a normal feature to build well. The medium-high leaf is a question for the sponsor: is a 10x future worth paying for now?

Read the ratings as a sorting rule. High importance, high difficulty leaves are the architectural drivers: usually three to six of them, and every big decision should trace back to one. High importance with low difficulty is ordinary good engineering; build it, but it will not decide the style. Low or medium importance with high difficulty deserves a hard question before anyone spends money on it.

The tree also shows where scenarios pull against each other. The POS must sell when the link is down, and the customer app must never sell stock that is not there (Case study: ordering without overselling stock). A design choice that helps one hurts the other; ATAM calls such a choice a trade-off point. Write the conflict down and let the business decide which scenario wins, and by how much.

Build it

We will produce the workshop's three outputs for Mangrove's back office, work out the numbers behind two measures, and turn the top scenario into a load test that passes or fails on its own.

  1. Write each scenario on one card

    Keep scenarios in a Markdown file next to the code, for example docs/architecture/quality-scenarios.md, so they are reviewed like code. One card per scenario, with an id other documents can point to:

    Markdown
    ## PERF-1 Goods receiving during the month-end report
    - Source: a receiver in any of the 320 stores
    - Stimulus: saves a GRN with up to 40 lines
    - Environment: morning peak (7:00 to 10:00) while the month-end stock report runs
    - Artifact: receiving API and the database it writes to
    - Response: GRN saved, stock updated, confirmation on the handheld scanner
    - Response measure: p95 under 2 s (must 3 s), p99 under 5 s, 0 failed saves
      caused by the report, measured at the API
    - Today: two freezes of about 40 minutes this year; p95 unknown (open question Q3)
    - Business importance / difficulty: H / H
    - Raised by: Ama (store manager); votes: 9
    - Owner of the measure: back-office on-call engineer
  2. Record constraints with owners, and the utility tree

    Markdown
    ## Constraints
    | Id  | Constraint                                             | Kind           | Owner |
    |-----|--------------------------------------------------------|----------------|-------|
    | C-1 | PostgreSQL and NestJS remain the platform              | Technical      | Ken   |
    | C-2 | Partner app built by Lagoon Digital, current contract  | Organisational | Imran |
    | C-3 | At most 6 engineers on the move this year              | Organisational | Ken   |
    | C-4 | The 400 tills are existing hardware                    | Technical      | Ken   |
    
    ## Utility tree (importance, difficulty)
    - Performance
      - PERF-1 GRN save under 2 s during the report (H, H)
    - Modifiability
      - MOD-1 Pricing change in a weekly release, no freeze (H, H)
    - Availability
      - AVL-1 Partner ordering 99.9% from 6:00 to 23:00 (H, M)
    - Security
      - SEC-1 A partner shop sees only its own invoices (H, L)
    - Scalability
      - SCL-1 10x orders in five years (M, H): ask the sponsor
  3. Work out what the numbers mean

    Turn each measure into counts people can picture. It shows whether the target is strict or loose, and gives the on-call engineer something to check.

    Output
    PERF-1, morning peak
      GRNs per day        320 stores x about 4 deliveries = about 1,280
      in the 3-hour peak  about 60% (an assumption to measure) = about 770 saves
      p95 under 2 s       at most about 38 of those 770 saves may take longer
      4x test load        770 / 180 min = about 4.3 saves a minute; test at 20 a minute
    
    AVL-1, partner ordering, 6:00 to 23:00 every day
      hours that count    17 h x 30 days = 510 h a month
      99.9% allows        510 h x 0.001 = 0.51 h = about 31 minutes down a month
      the last freeze     40 minutes, so one freeze alone breaks the target
  4. Make the top scenario a test that passes or fails

    The measure becomes a threshold in a load test. This sketch uses k6, an open-source load testing tool whose scripts are JavaScript. It runs the stimulus and the environment at the same time against a staging copy, and k6 exits with a non-zero code when a threshold fails, so CI can block a release. The API paths are illustrative.

    JavaScript
    // perf-1.js: scenario PERF-1 as a load test. Run: k6 run perf-1.js
    import http from 'k6/http';
    import { check } from 'k6';
    
    const API = __ENV.API_URL; // staging, never production
    const headers = { 'Content-Type': 'application/json' };
    const grn = JSON.stringify({
      siteId: 101, supplierId: 7,
      lines: Array.from({ length: 40 }, (_, i) => ({ articleId: 5000 + i, qty: 12 })),
    });
    
    export const options = {
      scenarios: {
        receiving: { // stimulus: 20 saves a minute, over 4x the peak
          executor: 'constant-arrival-rate', rate: 20, timeUnit: '1m',
          duration: '15m', preAllocatedVUs: 5, maxVUs: 20, exec: 'saveGrn',
        },
        report: {    // environment: the month-end report runs meanwhile
          executor: 'per-vu-iterations', vus: 1, iterations: 1,
          maxDuration: '15m', exec: 'runReport',
        },
      },
      thresholds: { // response measure, for the receiving scenario only
        'http_req_duration{scenario:receiving}': ['p(95)<2000', 'p(99)<5000'],
        'http_req_failed{scenario:receiving}': ['rate<=0'],
      },
    };
    
    export function saveGrn() {
      const res = http.post(`${API}/grns`, grn, { headers });
      check(res, { 'GRN saved': (r) => r.status === 201 });
    }
    
    export function runReport() {
      http.post(`${API}/reports/stock-month-end`, null, { timeout: '15m' });
    }

    k6 tags every request with the name of the scenario that sent it, which is why the thresholds can look at receiving requests only. On today's shared database this test should fail. That failure is the evidence for the architecture change, and the same test proves the change worked.

Bring it to your team

Bring these to the next planning meeting or design review that starts with "it must be fast and reliable".

  • "Which action do we mean by fast, at which percentile, and under which load?"
  • "What did the last incident cost, in minutes, orders or money? That tells us what the target is worth."
  • "Is this a constraint or a target? If it is a constraint, who owns it and could lift it?"
  • "What is today's number? Who will measure it before we promise a new one?"
  • "Which three to six scenarios are high importance and high difficulty, and does each big decision trace to one of them?"
  • "Where do two scenarios conflict, and who decides which one wins?"

Red flags

  • Requirements full of "fast", "scalable", "real-time" or "robust" with no numbers
  • Response times given as averages, or with no place of measurement
  • Scenarios with no environment, so they are only ever tested on a quiet day
  • A technology choice ("we need Kafka") written down as a requirement
  • Targets copied from another company instead of priced for this business
  • Constraints nobody can name an owner for

Practice

Lint a quality attribute scenario

Before the workshop's top scenarios go out for sign-off, a script checks each card. Write lintScenario(s). The scenario object has six string fields: source, stimulus, environment, artifact, response and measure. Return an array of problems, empty when the card is ready:

  • "missing <part>" for each part that is absent or only spaces, in the order above
  • if the measure is present: "measure has no number" when it contains no digit
  • then "vague word: <word>" for each of fast, quick, real-time, instant, seamless, user-friendly found in the measure, in that order, ignoring case
  • then "use a percentile, not an average" when the measure contains the word average

The starter only checks the measure, and misses blank parts.

JavaScript exerciseRuns in your browser with tests
function lintScenario(s) {
  // return a list of problems; an empty list means the card is ready
  const problems = [];
  if (!s.measure) problems.push('missing measure');
  if (!/[0-9]/.test(s.measure)) problems.push('measure has no number');
  return problems;
}
Ctrl + Enter runs
Show a solution
JavaScript
const PARTS = ['source', 'stimulus', 'environment', 'artifact', 'response', 'measure'];
const VAGUE = ['fast', 'quick', 'real-time', 'instant', 'seamless', 'user-friendly'];

function lintScenario(s) {
  const problems = [];
  for (const part of PARTS) {
    const value = s[part];
    if (typeof value !== 'string' || value.trim() === '') problems.push(`missing ${part}`);
  }
  const measure = typeof s.measure === 'string' ? s.measure.toLowerCase() : '';
  if (measure.trim() === '') return problems;          // already reported as missing
  if (!/[0-9]/.test(measure)) problems.push('measure has no number');
  for (const word of VAGUE) {
    if (measure.includes(word)) problems.push(`vague word: ${word}`);
  }
  if (measure.includes('average')) problems.push('use a percentile, not an average');
  return problems;
}

A script like this cannot judge whether a target is right, only whether it is checkable. It is still worth running: it catches the cards that would pass sign-off and then be impossible to test.

Pass the exercise to finish this task.

Turn three quotes into scenarios

At the workshop you wrote down three quotes. Ama, a store manager: "The Store app must never freeze when we receive deliveries." The finance lead: "Month-end numbers have to be right." A buyer: "We need to change prices whenever we want." Rewrite each as a six-part scenario with a must and a plan level, say which are constraints if any, and rate each for importance and difficulty.

  • Each scenario has all six parts, and each environment names a real condition (peak, report running, deploy)
  • Each response measure is a number someone else can check, with a percentile where time is measured
  • "Right" is turned into something checkable, such as totals matching the ledger to the cent by a set time
  • "Whenever we want" is split into how often a change ships and how fast it reaches customers
  • Each scenario has importance and difficulty ratings with a one-line reason
Show a model answer
Markdown
PERF-1 (Ama)
Source: receiver in a store. Stimulus: saves a GRN of up to 40 lines.
Environment: morning peak while the month-end report runs.
Artifact: receiving API and database. Response: saved, stock updated.
Measure: p95 must 3 s, plan 2 s; 0 failed saves. Rating: H, H
(two store-wide freezes this year; needs reporting off the shared database).

DATA-1 (finance)
Source: finance lead. Stimulus: runs the month-end stock valuation.
Environment: first working day of the month, after the 02:00 close.
Artifact: reporting data in the warehouse. Response: report ready.
Measure: totals match the ledger to the cent; ready by 09:00 (must 11:00).
Rating: H, M (correctness is vital; timing is moderate work).

MOD-1 (buyer), split in two
Source: buying team developer. Stimulus: new price rule.
Environment: normal week. Artifact: pricing module.
Response: released without a back-office freeze.
Measure: weekly release, plan 2 developer-days. Rating: H, H.
LAT-1: a published price change reaches the app and the Partner app
within 5 minutes (must 15). Rating: H, M.
None of the quotes is a constraint: each could be traded at a price.

Check yourself

The Partner app lead says "the Partner app must handle festival traffic". Which rewrite is a complete quality attribute scenario?

In the brainstorm, an engineer says "we need an event streaming platform". What should the facilitator do?

Four leaves of a utility tree are rated (importance, difficulty). Which one should most influence the choice of architecture style?

Flashcards

Open my review

Key takeaways

  • Sort what stakeholders say into business drivers, quality attributes (targets you can trade) and constraints (decisions with an owner that you design around).
  • Write each quality requirement as a six-part scenario; the environment and the response measure are the parts that change the design and make it testable.
  • Turn adjectives into numbers with five questions, price each target by what a miss costs, and give it a must and a plan level.
  • A half-day workshop (brainstorm, merge, vote, refine) and a utility tree find the three to six high-importance, high-difficulty scenarios that every big decision should trace back to.

Sources

Episode transcriptFrom good and on time to numbers · about 12 minutes · tap any line to play from there
  1. NadiaImran, if I asked you what the new back office has to be, what would you say?
  2. ImranFast, reliable, and easy to change. That's what everyone says in every meeting.
  3. NadiaAnd everyone means something different by it. You can't design from those words, and you can't test them. Today is about turning them into numbers that a whole room agrees on.
  4. ImranSo this is the lesson where the architect stops nodding and starts asking awkward questions.
  5. NadiaFriendly questions, but yes. Lots of them.
  6. NadiaThe lesson starts with a wedding. A family books a caterer and says, we want the food to be good, and on time.
  7. ImranWhich tells the caterer almost nothing.
  8. NadiaRight. So a good caterer asks. How many guests? About four hundred. How soon after people sit down should plates arrive? Within twenty minutes. What if the power cuts out? It often does there in the rainy season.
  9. ImranAnd every answer changes the kitchen. Four hundred plates in twenty minutes means two serving lines. Power cuts mean a gas burner or food that's fine at room temperature.
  10. NadiaExactly. And some things aren't up for discussion. The hall has no gas line. The date is fixed. The food follows the family's diet rules. She doesn't argue with those. She designs around them.
  11. ImranSo there are two kinds of answers. Targets you can negotiate, and facts you can't.
  12. NadiaThat's the first idea. When stakeholders talk, you sort what they say into three buckets. Business drivers are why the work is worth paying for. Quality attributes are how well the system must behave, in numbers. Constraints are decisions someone already made.
  13. ImranGive me Mangrove examples.
  14. NadiaA driver: release every week instead of every month. A quality attribute: goods receiving saves in under two seconds. A constraint: the Partner app is built by Lagoon Digital under its current contract.
  15. ImranHow do I tell a quality attribute from a constraint? They both sound like rules.
  16. NadiaOne question. Could we trade this away if the benefit were big enough? Two seconds could become three if that saved a year of work. So it's a target. Nobody in the room can rewrite Lagoon Digital's contract, so that's a constraint.
  17. ImranI'd have guessed that "PostgreSQL stays" is just a preference.
  18. NadiaIt might be. That's why every constraint gets an owner, the person who could lift it. Ask once, politely, who decided this and does it still hold. If Ken says yes, it stays, and you design around it.
  19. ImranNow, how do we write the targets so they're testable?
  20. NadiaWith a quality attribute scenario. It comes from the Software Engineering Institute at Carnegie Mellon, and it has six parts. Source, stimulus, environment, artifact, response, and response measure.
  21. NadiaIf you can see your screen, the first diagram stacks those six parts from top to bottom. If not, picture this. A store receiver, that's the source, saves a goods received note with forty lines, that's the stimulus.
  22. NadiaThe save hits the receiving API and its database, the artifact. And all of this happens inside a frame, the environment, which here is the month-end stock report running.
  23. ImranThen the response is that the note is saved and stock is updated.
  24. NadiaAnd at the bottom, the response measure. Ninety-five percent of saves under two seconds, and zero failed saves.
  25. ImranWhy is the environment its own part? It feels like a detail.
  26. NadiaIt's the part that costs money. The same save is easy on a quiet afternoon and hard while a big report holds locks on the shared database. Leave the environment out, and someone tests on a quiet day, it passes, and it fails on the day that matters.
  27. ImranAnd scenarios aren't only about speed, right?
  28. NadiaNo. A buying team developer adds a new promotion type, and it ships in three developer-days without touching other modules. That's maintainability. The store's internet drops for two hours on a Saturday evening, and the POS keeps selling with no sale lost. That's availability.
  29. ImranOkay. In the room, people still say "fast". How do I get from fast to a number?
  30. NadiaFive questions. Which action? For what share, measured where? Under what conditions? What does a miss cost? And what is today's number?
  31. ImranThe share one means percentiles, like the lesson on SLOs and nines.
  32. NadiaYes, a percentile, never an average. And measured at the API or on the device, because those give different numbers.
  33. ImranWhat about "real-time"? Our buyers love that word.
  34. NadiaAsk how old the data may be before someone acts wrongly. For prices it might be five minutes. And give each measure two levels. Must is the worst the business accepts. Plan is what you design for. That idea comes from Tom Gilb's Planguage.
  35. ImranSo the gap between must and plan is where the team can trade.
  36. NadiaExactly. Now, where do all these scenarios come from? A workshop. The Software Engineering Institute's version is called the Quality Attribute Workshop, and it has eight steps. For most teams, a lighter half-day version is enough.
  37. ImranWho's in the room?
  38. NadiaEight to twelve people who feel the pain or pay for it. The sponsor, product managers, someone from the stores, finance, the on-call engineer, a data analyst, security, and the outside agency if they build part of the system.
  39. ImranAnd then we brainstorm.
  40. NadiaIn a round robin. Each person offers one scenario or passes. Then you merge duplicates, so votes aren't split between two cards that say the same thing. Then dot voting. Then you refine the top four to six into full scenarios with numbers.
  41. ImranWhat if someone says, we need microservices?
  42. NadiaYou write it on a parking list and ask, what problem would that solve? The answer is the scenario. The solution comes in the next lesson.
  43. NadiaHere's how it went at Mangrove in the lesson's example. Ken asked for a half-day workshop before anyone drew a box. Eleven people came, including you, Tomás, Ama from her store, finance, engineers, and the Partner app lead from Lagoon Digital.
  44. ImranAnd it opened with the receiving freeze.
  45. NadiaYes. Twice this year the month-end report locked the shared database, and goods receiving froze in all three hundred and twenty stores for about forty minutes. Drivers waited at the back door.
  46. ImranThat's the scenario that won the vote, I'm guessing.
  47. NadiaWith nine votes. The round robin gave thirty-one raw scenarios, merging left seventeen, and each person had six votes. Second place was your price scenario: a buyer's price change reaches the customer app and the Partner app within five minutes.
  48. ImranAnd Tomás caught something about "real-time stock", didn't he?
  49. NadiaHe did. For the Store app it meant two minutes. For the data warehouse, yesterday was fine. One word became two scenarios with very different costs.
  50. NadiaThe last tool is the utility tree, from the SEI's architecture tradeoff analysis method, ATAM for short. The second diagram shows one. Utility at the root on the left, five quality attributes in the middle, one scenario for each on the right.
  51. NadiaEach scenario gets two ratings, high, medium or low. How important it is to the business, and how difficult it is to achieve.
  52. ImranAnd the high-high ones are the important ones.
  53. NadiaThey're the architectural drivers. At Mangrove that's the receiving save during the report, and a pricing change in a weekly release. Every big decision should trace back to one of those.
  54. ImranWhat about a shop seeing only its own invoices? That's high importance.
  55. NadiaHigh importance, low difficulty. Build it well, but it won't decide the architecture style. And ten times the orders in five years is medium importance and high difficulty. That's a question for the sponsor before anyone spends money on it.
  56. ImranLet me try one before you say it. If the POS must sell offline, and the app must never oversell stock, those two pull against each other.
  57. NadiaYes. ATAM calls a choice like that a trade-off point. Write the conflict down, and let the business decide which one wins, and by how much.
  58. ImranSo what does the Build it section actually produce?
  59. NadiaThree outputs and a test. First, one card per scenario in a Markdown file next to the code, with an id, all six parts, must and plan levels, today's number, and an owner.
  60. NadiaSecond, the constraints list with owners, and the utility tree. Third, worked numbers. About twelve hundred and eighty notes a day, about seven hundred and seventy in the morning peak. A p ninety-five of two seconds means at most about thirty-eight slow saves in that peak.
  61. ImranAnd partner ordering at ninety-nine point nine percent, from six in the morning to eleven at night?
  62. NadiaSeventeen hours a day for thirty days is five hundred and ten hours. Point one percent of that is about thirty-one minutes a month. So one forty-minute freeze breaks the target by itself.
  63. ImranThat makes the old freeze sound a lot more serious.
  64. NadiaThat's the point of the numbers. Then the test. The lesson turns the receiving scenario into a k6 load test. One part saves notes at over four times the peak rate, another runs the month-end report at the same time, and thresholds hold the measure.
  65. NadiaIf the thresholds fail, k6 exits with an error, so the pipeline can block a release. On today's shared database it should fail. That failure is your evidence, and the same test proves the fix later.
  66. ImranWhat do I bring to my next design review?
  67. NadiaAsk which action we mean by fast, at which percentile, under which load. Ask what the last incident cost. Ask whether something is a constraint or a target, and who owns it. And ask which three to six scenarios are high importance and high difficulty.
  68. ImranAnd the red flags?
  69. NadiaRequirements full of fast and scalable with no numbers. Averages. Scenarios with no environment. A technology written down as a requirement. And targets copied from another company.
  70. NadiaHere's one to think about. The finance lead says partner ordering must be ninety-nine point nine nine percent available, because big tech companies promise that. What do you ask? Take a second.
  71. ImranI'd ask what an hour of partner ordering being down actually costs us, and which hours matter.
  72. NadiaThat's it. Each extra nine costs a lot more to build and run, so the target has to be priced by what a miss costs this business.
  73. ImranLet me sum up. One, sort what people say into drivers, targets you can trade, and constraints with owners.
  74. ImranTwo, write each target as a six-part scenario, and don't skip the environment. Three, a half-day workshop and a utility tree find the few high-high scenarios that drive the design.
  75. NadiaOne nuance on the first one. A constraint you challenged and kept is still a constraint. Ask once, then stop arguing and design around it.
  76. ImranGood. And next time?
  77. NadiaNext time we take these scenarios and use them to choose between a modular monolith, microservices, events and serverless for Mangrove.
Finished reading?Mark it complete to fill in its stop on your course line.

Use it at work

Capacity plan

Expected peak traffic, a sized design and Find my limit, with headroom and cost per month as criteria.

Open in the System Design Studio
Next stopChoosing an architecture style
Was this lesson helpful?
Questions and discussion

Loading the discussion…