1. Courses
  2. System Design
  3. How the Web Works
  4. Stop 1

25 minBeginner

What system design really is

Welcome to Kolom. This is the first lesson of the System Design track, and you need no experience of system design to start it. System design is planning how the parts of a software system fit together so it keeps working at the numbers you expect: the users, the busy hours, the failures. This lesson gives you the words and the thinking loop that every later lesson uses.

By the end you can

  • Split any feature request into functional and non-functional requirements
  • Name the nine qualities that every design trades against each other
  • Use one repeatable thinking loop to run a design discussion
  • Draw the starting three-box system and say what each box does
  • Write a one-page requirements sheet with real numbers in it

The everyday picture

Imagine you open a tea stall next to a bus stop. You buy a kettle, a gas burner, twenty cups and a bench. If more people come than you expected, they wait a few minutes or walk to the next stall. You never write a plan, and that is fine.

Now imagine you are opening a large supermarket in a busy neighbourhood. Before opening day, someone has to answer a long list of questions. How many customers come on a normal evening, and how many on the night before a big festival? How many checkout counters does that need? How much storeroom space for the stock that arrives from the warehouse? When the power cuts out, how long until the generator takes over? If the internet goes down, can the tills still sell?

None of these questions are about what the supermarket sells. They are about how well it works under real conditions: crowds, failures, money and time. Answering them on paper costs a few meetings. Answering them on festival night, with a queue out of the door, costs a lot more. Software works the same way. A to-do app for yourself is the tea stall. An app that hundreds of stores open every morning is the supermarket. System design is the planning you do before opening day.

Two kinds of requirements

Every request a team receives has two parts. The first part says what the system must do. This is a (FR). The second part says how well it must do it. This is a (NFR).

Take one feature: store staff scan a barcode and see how many units are in stock. The FR is "staff can see the stock of one product at their store". The NFRs are things like "the answer appears in under 300 ms for 95 out of 100 scans", "it works during the 7 pm rush on the night before a festival", and "the number is never more than 2 minutes behind the last sale".

Business teams usually describe FRs and leave the NFRs unsaid. Nobody writes "must be available 99.9% of the time", but everyone is angry when the app is down during the evening rush. A big part of the job, whether you are the engineer or the product manager in the room, is to bring the NFRs into the open and put a number on each one, because the numbers decide the design. A stock lookup used by 5 stores and one used by 500 stores at the same moment need very different systems, even though the FR is the same sentence.

Good NFR questions are short and always ask for a number:

  • How many users or devices, and what does the busiest hour look like?
  • How fast must it feel, and for what share of requests?
  • What happens to the business if it is down for 10 minutes? For a whole day?
  • How fresh must the data be: seconds, minutes, or yesterday?
  • How much data, and how long do we keep it?

Quick check

The business asks for a "real-time sales dashboard". What is the most useful first question?

The qualities you trade off

NFRs fall into a small set of qualities. Learn these nine words well, because engineers use them in every design review. Most of them get a full lesson later in the System Design track.

QualityPlain meaningMangrove example
ScalabilityKeeps working as load growsWorks the same with 50 stores or 600
AvailabilityAnswers when you call itThe POS can reach the server at 9 pm on festival eve
ReliabilityGives correct results, again and againThe stock number shown is the real stock number
LatencyHow long one request takesThe price appears 0.2 s after the scan
ConsistencyEveryone sees the same dataTwo tills agree there are 3 units left
DurabilitySaved data is never lostA sale saved at 8:01 pm survives a server crash at 8:02 pm
MaintainabilityEasy for your team to change and fixA new developer can add a report in a day
CostMoney for servers, tools and people's timeThe monthly cloud bill and the hours spent on support
SecurityOnly the right people see and change thingsA partner shop sees its own orders, never another shop's

Notice that availability and reliability are different. A server can be up and answering (available) while it shows stock numbers from last week (unreliable). Users feel both, and both need their own number.

These qualities pull against each other. Each improvement in one usually costs something in another. This is called a . Three examples you will meet again and again:

  • Speed vs freshness. Keep a copy of stock numbers in memory and refresh it every minute. Lookups get much faster and the database works less. In exchange, the number can be up to a minute old (Caching).
  • Safety vs speed. Wait until two separate servers have saved each sale before telling the cashier "done". A crash can no longer lose the sale, but every sale now waits for the slower of the two (Replication and read replicas).
  • Availability vs cost and effort. Run a full second copy of the system in another data centre. A fire in one building no longer stops the stores, but you pay for two systems and your team has more to run.

This is why there is no "best" design. There is only the best design for a given set of numbers. When someone asks "what is the best database?", the honest answer starts with "for how many writes per second, how much data, and what happens if it is down?"

Quick check

The Store app answers every scan in 100 ms, but it shows prices from last week. Which quality is failing?

Think first: the business asks for "real-time stock in the Partner app". What do you ask before anyone draws a box?

Turn "real-time" into numbers. How old can the stock number be before it causes a wrong order: 5 seconds, 2 minutes, 1 hour? How many partner shops look at stock at the same time during the busiest hour? Is it enough to show "In stock" or "Low stock" instead of an exact count? What happens if the shop orders 10 cartons and only 8 are left when the order is processed?

The answers change the design a lot. "Up to 10 minutes old, shown as In stock or Low" can be a simple copy refreshed every few minutes. "Exact at the moment of ordering" means the order step itself must check and reserve stock in one safe operation (Transactions and Ordering without overselling stock).

The thinking loop

Experienced engineers follow roughly the same steps for every design, from a small feature to a whole platform. The lessons in this track use the same loop, and the case studies near the end, starting with a URL shortener, apply it from start to finish.

1 Requirements what, how well 2 Rough numbers users, QPS, GB 3 API and data endpoints, tables 4 Big picture boxes and arrows 5 Deep dive the hardest part 6 Bottlenecks what fails first 7 Trade-offs what we give up 8. Iterate when numbers change
The thinking loop. Each step produces something concrete (a list, a number, a table, a picture). When a deep dive or a trade-off changes the numbers, you go around again.

What happens at each step

  1. Requirements. FRs as user actions, NFRs as numbers, and a list of what is out of scope.
  2. Rough numbers. Users, requests per second, data per day and per year. You only need to know if the answer is 5 requests per second or 5,000 (Speed numbers and estimation).
  3. API and data. The main endpoints and tables, so everyone agrees on what the system stores and returns (APIs done right, Modeling data in tables).
  4. Big picture. Boxes and arrows, with every arrow labelled by what travels along it.
  5. Deep dive. Design the hardest part in detail. For stock, that is usually "two people buy the last unit at once".
  6. Bottlenecks and failures. Ask what breaks first when load doubles, and what users see when each box fails. A is the part that limits everything else. A is a part with no backup.
  7. Trade-offs. Say what the design gives up and why that is acceptable for these numbers. Write it down.
  8. Iterate. New information changes earlier answers, so you go around again.

Running a design review turns this loop into a timed agenda for a real meeting.

Quick check

In which step do you find out whether the system must handle 5 or 5,000 requests per second?

The starting box

Almost every system you will design starts as three boxes. A (the app or browser) sends a request over the network. An receives it, checks who is asking, applies the business rules and asks the database for data. The stores everything permanently and finds rows quickly.

If you have built an app, you have built this. Mangrove Market's version is a React Native app, a NestJS API in TypeScript and a PostgreSQL database, and most code in this track uses that same stack. Hold on to this picture. Every later lesson either explains one of these arrows in more depth, or adds a new box to solve a specific problem that appears when the numbers grow.

Client shows screens and sends requests request GET /stock response JSON API server checks who you are, applies the rules SQL query rows Database keeps data safe, finds rows fast Later lessons add Load balancer spreads load Cache faster reads Queue work for later Read replica copy for reads File storage photos, files
The starting box. Requests flow down from the client to the database and answers flow back up. The dashed boxes on the right are the pieces later lessons add when the numbers demand them: load balancers, caching, queues, replicas and file storage each get a lesson of their own.

Two facts about this picture matter for everything that follows. First, the API server can be made : it remembers nothing between requests, so you can run three or ten identical copies of it (Scaling up vs scaling out). Second, the database holds the state. You cannot copy it as easily, because every copy must agree on the data. That is why so many hard problems end up at the database, and why the next courses in this track, starting with Modeling data in tables, are about databases.

Quick check

Why is it easier to run ten copies of the API server than ten copies of the database?

Build it

We will write a one-page requirements sheet, then fill it in for a "Store stock lookup API" for Mangrove's Store app.

  1. Save the template

    Keep this file in your team's docs and copy it for every new feature. Each section forces one kind of decision. The comments tell the writer what a good answer looks like.

    Markdown
    # Requirements: <feature name>
    Owner: <PM name>   Date: <yyyy-mm-dd>   Status: draft
    
    ## 1. Problem
    <!-- Who has the problem, and what does it cost them today? -->
    
    ## 2. Functional requirements (what it does)
    <!-- One user action per line: "<role> can <action>" -->
    - FR1:
    - FR2:
    
    ## 3. Non-functional requirements (how well)
    <!-- Every line needs a number, a unit and where it is measured -->
    | Quality      | Target | Measured where / how |
    |--------------|--------|----------------------|
    | Latency      |        |                      |
    | Availability |        |                      |
    | Freshness    |        |                      |
    | Load (peak)  |        |                      |
    | Data size    |        |                      |
    | Security     |        |                      |
    
    ## 4. Rough numbers
    <!-- Show the arithmetic so others can check it -->
    
    ## 5. Constraints
    <!-- Team, deadline, existing systems, devices, network -->
    
    ## 6. Out of scope (this version)
    
    ## 7. Open questions
    
  2. Write the problem and the FRs

    Write FRs as actions a named role can take. If you cannot name the role, you do not understand the requirement yet. The numbers below are for Mangrove Market's roughly 320 stores.

    Markdown
    # Requirements: Store stock lookup API
    Owner: Product (Store app)   Date: 2026-10-06   Status: draft
    
    ## 1. Problem
    Floor staff walk to the storeroom to check if a product is in stock.
    This takes 3-5 minutes per customer question during the evening rush.
    
    ## 2. Functional requirements
    - FR1: Store staff can scan a barcode and see the stock of that
           product at their own store.
    - FR2: Store staff can see stock of the same product at the 5
           nearest stores, to send a customer there.
    - FR3: Area managers can look up any product at any store in
           their area.
    
  3. Put a number on every NFR

    Each target says what is measured, the limit, and where you measure it. "Fast" is not a requirement. "p95 under 300 ms, measured at the API" is. The term is explained fully in Measuring speed and reliability, and in Speed numbers and estimation.

    Markdown
    ## 3. Non-functional requirements
    | Quality      | Target                       | Measured where / how          |
    |--------------|------------------------------|-------------------------------|
    | Latency      | p95 < 300 ms, p99 < 800 ms   | API server, per request       |
    | Availability | 99.9% per month, 8am-11pm    | Health check every 30 s       |
    | Freshness    | a sale shows within 2 min    | Test sale, then lookup        |
    | Load (peak)  | 40/s at festival peak 7-10pm | Request log, busiest hour     |
    | Response     | < 5 KB per lookup            | Slow store internet           |
    | Data size    | ~6.4M stock rows today       | count(*) on stock             |
    | Security     | staff see own store + FR2    | Role check on every request   |
    
    ## 4. Rough numbers
    - 320 stores x ~2,000 lookups/day = 640,000 lookups/day
    - 640,000 / 86,400 s = ~7.4 lookups/s on average
    - Festival evening peak ~5x average = ~37, so plan for 40 lookups/s
    - 320 stores x ~20,000 products each = ~6.4M stock rows
    
  4. Write constraints, out of scope and open questions

    The out-of-scope list protects the deadline. The open questions list is where you write things you do not know yet, instead of guessing.

    Markdown
    ## 5. Constraints
    - Must use the existing Postgres database and NestJS backend.
    - Two backend developers, first version in 4 weeks.
    - Handheld scanners run the existing Store app (React Native, Android).
    - Store internet is often slow; some stores drop to mobile data.
    
    ## 6. Out of scope (this version)
    - Changing stock (adjustments, transfers): separate project.
    - Working with no internet at all (see offline-first, later).
    - Stock forecasts and reorder suggestions.
    
    ## 7. Open questions
    - Is 2 minutes of freshness enough for FR2, or do customers
      arrive at the other store and find nothing?
    - Who decides which stores an area manager can see?
    
  5. Check your numbers against real data

    Guesses are fine to start, but check the ones you can. Run this on a reporting copy of the database, never on the busy primary during opening hours. It assumes a stock table with one row per store and product, as built in Modeling data in tables. In Mangrove's database a site is a store or a DC, and an article is a product.

    SQL
    -- How many stores, products and stock rows do we really have?
    SELECT count(DISTINCT site_id)    AS stores,
           count(DISTINCT article_id) AS articles,
           count(*)                   AS stock_rows
    FROM stock;
    
    Output
     stores | articles | stock_rows
    --------+----------+------------
        320 |    24318 |    6391204
    

    The output above is an example from Mangrove's imagined data. If your real number is 10 times your guess, update the sheet before anyone designs anything. That is step 8 of the loop, already at work. You can try the rough-numbers step in your browser: the Practice section below turns it into an auto-checked JavaScript exercise.

Bring it to your team

Use these at the start of any design discussion, before the first box is drawn.

  • "Which user action is this design for, and who is the user?"
  • "How many users or devices at the busiest hour? A rough number is fine."
  • "How fast must it be, for what percentage of requests, measured where?"
  • "What does a store do if this is down for 10 minutes on the busiest evening of the year?"
  • "How old can the data be before it causes a wrong decision?"
  • "What are we deciding not to build in this version?"

Red flags

  • Requirements full of adjectives and no numbers: "fast", "scalable", "real-time".
  • The first slide is a technology choice, before any requirement or number.
  • Nobody can say what users see when the database or an outside service is down.
  • There is no out-of-scope list, so every new idea joins version 1.

Practice

Put numbers on a vague request

Imran's team receives this request: "The Rider app should show riders new orders in real time." Using the template from Build it, write two FRs, four NFRs (each with a number, a unit and where it is measured), one out-of-scope item and one open question. Facts you can use:

  • About 600 riders, and about 60,000 app orders a day, with 4 times that at festival peaks.
  • Most orders arrive between 6 pm and 10 pm.
  • Riders often pass through areas with patchy mobile data.
  • If no rider accepts an order within 2 minutes, the 30-minute delivery promise is at risk.
  • Each FR names a role and one action ("A rider can…").
  • Every NFR has a number, a unit and a place where it is measured.
  • At least one NFR is sized for the festival peak, not only a normal day.
  • At least one NFR says what happens on weak mobile data.
  • Your open question is one the facts above cannot answer.
Show a model answer

FR1: A rider can see new orders offered to them, with the store and the drop-off area. FR2: A rider can accept or decline an offered order.

Freshness: an offer reaches an online rider's phone within 10 s for 95% of offers, measured from order creation to the phone's receipt. Peak load: 240,000 orders a day at festival peak; if half arrive in the 4 evening hours, that is about 30,000 an hour, roughly 8 to 10 new offers a second, measured in the request log. Availability: offers and accepts work 99.9% of the time between 7 am and 11 pm, measured by a health check every 30 s. Weak network: an accept tap is retried safely for up to 60 s without creating a double accept, tested on a throttled 3G connection.

Out of scope: turn-by-turn navigation. Open question: if a rider ignores an offer for 30 seconds, who gets it next, and who decides?

Do the rough numbers in code

Write roughNumbers(stores, lookupsPerStorePerDay, peakFactor). It returns an object with perDay (all lookups in a day), avgPerSecond (spread over the 86,400 seconds of a day) and peakPerSecond (the average times the peak factor). Do not round.

JavaScript exerciseRuns in your browser with tests
function roughNumbers(stores, lookupsPerStorePerDay, peakFactor) {
  const perDay = 0;        // stores × lookups per store per day
  const avgPerSecond = 0;  // spread evenly over one day
  const peakPerSecond = 0; // the busiest hour
  return { perDay, avgPerSecond, peakPerSecond };
}
Ctrl + Enter runs
Show a solution
JavaScript
function roughNumbers(stores, lookupsPerStorePerDay, peakFactor) {
  const perDay = stores * lookupsPerStorePerDay;
  const avgPerSecond = perDay / 86400;
  const peakPerSecond = avgPerSecond * peakFactor;
  return { perDay, avgPerSecond, peakPerSecond };
}
Pass the exercise to finish this task.

Check yourself

Which of these is a non-functional requirement?

In the first five minutes of a review, an engineer says "We should use microservices and Kafka for this." Where should the discussion be at that point?

The business confirms that partner shops can see stock numbers that are up to 10 minutes old. What does this mainly allow the team to do?

Flashcards

Open my review

Key takeaways

  • Functional requirements say what the system does. Non-functional requirements say how well, and they must have numbers.
  • Scalability, availability, reliability, latency, consistency, durability, maintainability, cost and security pull against each other. Every design is a set of trade-offs.
  • There is no best design, only the best design for a given set of numbers.
  • Use the loop: requirements, rough numbers, API and data, big picture, deep dive, bottlenecks, trade-offs, iterate.
  • Every system starts as client, API server and database. Later lessons add boxes only when the numbers ask for them.

Sources

Episode transcriptPlanning before opening day · about 13 minutes · tap any line to play from there
  1. NadiaHello, and welcome to the Kolom podcast. I'm Nadia. I'm a senior engineer at Mangrove Market, and I'll be with you for the whole series.
  2. ImranAnd I'm Imran. I'm a product manager at Mangrove, for the Store app and the Partner app, so I'll be asking the questions you'd probably ask yourself.
  3. NadiaMangrove Market is made up, by the way. A grocery chain with about three hundred and twenty stores in six cities, a customer app, and a lot of software behind it. Every lesson uses it, so the examples build on each other.
  4. ImranAnd how does this episode fit with the course?
  5. NadiaEvery lesson has one episode like this, ten to fifteen minutes long, made for the bus or the car. You listen first to get the idea and the stories.
  6. ImranThen you open the lesson at your desk for the diagrams, the checkpoints, the practice tasks and the Build-it section.
  7. NadiaExactly. Let's start. Imran, Mangrove is opening a new store next month. What has to be decided before opening day?
  8. ImranThe product range, the prices, the shelf layout. The usual things.
  9. NadiaNow picture the night before a big festival. Nine in the evening, a queue out of the door. What would you want answered on paper, weeks before?
  10. ImranHow many checkout counters we need. How long the generator takes when the power cuts out. Whether the tills can still sell if the internet goes down.
  11. NadiaRight. None of those are about what the store sells. They're about how well it works under real conditions: crowds, failures, money and time.
  12. NadiaThe lesson's everyday picture compares that store with a tea stall next to a bus stop. A kettle, a gas burner, twenty cups and a bench.
  13. ImranAnd if more people come than expected, they wait a few minutes or walk to the next stall. Nobody writes a plan for a tea stall.
  14. NadiaWhich is fine. A to-do app for yourself is the tea stall. An app that hundreds of stores open every morning is the supermarket.
  15. ImranSo system design is the planning you do before opening day.
  16. NadiaThat's it. Planning how the parts of a system fit together, so it keeps working at the numbers you expect: the users, the busy hours, the failures.
  17. ImranMy team gets feature requests all day. Where do I start?
  18. NadiaSplit every request in two. The first part says what the system must do. That's a functional requirement, or FR. The second part says how well, and it always has a number. That's a non-functional requirement, an NFR.
  19. ImranGive me one from a store.
  20. NadiaStore staff scan a barcode and see how many units are in stock. The FR is one sentence: staff can see the stock of one product at their own store.
  21. NadiaThe NFRs: the answer appears in under three hundred milliseconds for ninety-five out of a hundred scans. It works during the seven pm rush before a festival. And the number is never more than two minutes behind the last sale.
  22. ImranThe business never says any of that. They just say, show the stock.
  23. NadiaThat's normal. Nobody writes "must be available ninety-nine point nine percent of the time". But everyone is angry when the app is down during the evening rush.
  24. ImranSo my job is to bring the NFRs into the open and put a number on each one.
  25. NadiaYes, and it's the engineer's job too, because the numbers decide the design. A stock lookup used by five stores, and one used by five hundred stores at the same moment, need very different systems. Same FR sentence.
  26. ImranEngineers in my reviews throw around words like scalability and durability. Is there a fixed list?
  27. NadiaNine words. Scalability, availability, reliability, latency, consistency, durability, maintainability, cost and security. Most of them get a full lesson later.
  28. ImranSome of those sound the same to me. If the server is up, it's reliable, isn't it?
  29. NadiaThat's a very common mix-up, Imran. Availability means it answers when you call it. Reliability means the answer is correct, again and again.
  30. NadiaA server can be up and answering while it shows stock numbers from last week. Available, but not reliable. Users feel both, so each needs its own number.
  31. ImranCan't we just ask for all nine at the maximum?
  32. NadiaThey pull against each other. Getting more of one usually costs something in another. That's called a trade-off.
  33. NadiaTake speed against freshness. Keep a copy of stock numbers in memory and refresh it every minute. Lookups get much faster, but the number can be up to a minute old.
  34. NadiaSafety against speed. Wait until two separate servers have saved each sale before telling the cashier "done". A crash can't lose the sale, but every sale waits for the slower server.
  35. NadiaAnd availability against cost. A full second copy of the system in another data centre survives a fire in one building, but you pay for two systems and your team has more to run.
  36. ImranSo when someone asks me what the best database is...
  37. NadiaThe honest answer starts with questions. For how many writes per second, how much data, and what happens if it's down? There's only the best design for a given set of numbers.
  38. ImranConfession. Last month a developer opened a meeting with, "we should use microservices and Kafka". From then on, the meeting was about tools.
  39. NadiaThat's the common mistake the lesson warns about: starting with technology, before anyone knows the load.
  40. ImranWhat should I have done?
  41. NadiaBring it back to two questions. What must it do, and with which numbers? Kafka might be right later, once the numbers show a queue is needed. In minute five, nobody can judge it.
  42. ImranIs there a standard order for these discussions, so I can steer them?
  43. NadiaThere's a thinking loop. If you can see your screen, the first diagram shows seven numbered boxes snaking down the page, and a dashed arrow, step eight, going back to the start. If not, just count with me.
  44. NadiaRequirements. Rough numbers. API and data. Big picture. Deep dive. Bottlenecks. Trade-offs. And then, iterate.
  45. ImranWhat do I actually get out of each step?
  46. NadiaSomething concrete every time. Requirements give a list, including what's out of scope. Rough numbers tell you if it's five requests a second or five thousand. API and data gives the main endpoints and tables.
  47. NadiaThe big picture is boxes and arrows, with every arrow labelled by what travels along it.
  48. ImranAnd the deep dive is the hardest part. For stock, I'd guess two people buying the last unit at once.
  49. NadiaThat's the lesson's example. Then bottlenecks: what breaks first when load doubles? A bottleneck is the part that limits everything, like a single narrow door at a busy shop. A single point of failure is a part with no backup.
  50. ImranThen trade-offs, where we write down what we gave up. And iterate, because new information changes earlier answers.
  51. NadiaYou've got it. A later lesson, on running design reviews, turns this loop into a timed agenda for a real meeting.
  52. ImranWhen we finally draw boxes, where do we start?
  53. NadiaAlmost always with three. The second diagram stacks them. If you're not looking, picture a phone at the top, a server in the middle, and a database at the bottom.
  54. NadiaThe client sends a request. The API server checks who's asking, applies the business rules and asks the database. The database keeps the data safe and finds rows fast.
  55. ImranThat's roughly what our own apps look like. A React Native app, a NestJS API and Postgres.
  56. NadiaHold on to that picture. Every later lesson either explains one of those arrows, or adds a box when the numbers grow, like the cache or the queue in the dashed boxes on the right.
  57. NadiaTwo facts about those boxes. The API server can be stateless. It remembers nothing between requests, so you can run three or ten identical copies.
  58. NadiaThe database holds the state, and you can't copy it as easily, because every copy must agree on the data. That's why so many hard problems end up at the database, and why the next courses in the track are about databases.
  59. ImranLet me try a real one. My Partner app team wants to show partner shops the stock of each item before they order.
  60. NadiaAsk one NFR question: how old can the number be? Say the business answers, up to fifteen minutes, and we confirm stock when the warehouse processes the order.
  61. NadiaThen the API reads from a summary table refreshed every few minutes. Cheap, fast, and almost no load on the main database.
  62. ImranAnd if they say the number must be exact, and the order must lock the stock immediately?
  63. NadiaThen the order step needs an atomic stock reservation with an expiry, and the design gets much harder. Same screen, very different engineering cost.
  64. ImranSo asking that question early is a real contribution, from whoever asks it.
  65. NadiaIt is. And the Build-it section practises it. You save a one-page requirements template, then fill it in for a store stock lookup API.
  66. ImranWalk me through the example.
  67. NadiaFloor staff walk to the storeroom to check stock, three to five minutes per customer question. Each FR names a role and an action.
  68. NadiaEvery NFR gets a number and a place it's measured, like p ninety-five under three hundred milliseconds at the API. That means ninety-five out of a hundred requests are faster. The last lesson of this course explains it.
  69. ImranAnd the rough numbers?
  70. NadiaThree hundred and twenty stores times about two thousand lookups a day is six hundred and forty thousand a day. Divided by the seconds in a day, that's roughly seven lookups a second.
  71. ImranAnd a festival evening is about five times the average, so under forty a second. That sounds small.
  72. NadiaIt is, and good to know early. Last, you check your guesses with a count query, on a reporting copy, never on the busy main database during opening hours.
  73. NadiaIf the real number is ten times your guess, you update the sheet before anyone designs anything. That's step eight of the loop, already at work.
  74. ImranAnd the practice tasks?
  75. NadiaTwo. You put numbers on a vague request for the Rider app, and you write a tiny function for the rough numbers, checked by tests in your browser.
  76. ImranFor my next design review, what do I bring?
  77. NadiaPick two or three. Which user action is this for, and who's the user? How many devices at the busiest hour? What does a store do if this is down for ten minutes on the busiest evening of the year?
  78. ImranI'd add: what are we deciding not to build in this version?
  79. NadiaGood. And watch for red flags: requirements full of words like fast and real-time with no numbers, or a first slide that's a technology choice.
  80. NadiaNow one to think about. The business confirms partner shops can see stock numbers up to ten minutes old. What does that mainly let the team do? Take a second.
  81. ImranMy instinct says we can relax the availability target, since slightly old data is fine anyway.
  82. NadiaThat's the trap in the quiz. Freshness and availability are separate qualities. The shops still need the app to answer at nine pm.
  83. NadiaWhat it allows is serving the numbers from a copy refreshed every few minutes, cheaper and faster. And the order step still needs a real check, because the copy can be wrong by the time the order arrives.
  84. ImranLet me sum up. One: every request has a what and a how well, and the how well needs a number.
  85. ImranTwo: the nine qualities fight each other, so there's no best design, only the best one for our numbers. Three: start with client, API server and database, and add boxes only when the numbers ask for them.
  86. NadiaOne nuance on the second point. Write the trade-off down. Saying what you gave up, and why that's fine for these numbers, is part of the design.
  87. NadiaNext time, we follow a single tap on a screen all the way to the server and back, and count every trip it makes.
  88. ImranSee you then.
Finished reading?Mark it complete to fill in its stop on your course line.

Use it at work

Architecture review

Today's design on the board with the questions a review asks as notes, and criteria for the targets you must keep.

Open in the System Design Studio
Next stopWhat happens when you open an app or website
Was this lesson helpful?
Questions and discussion

Loading the discussion…