← Back to blog

October 14, 2026 · 20 min read

System Design Basics: How to Approach Your First Architecture Decision

From Mid-Level to Senior · Part 13 of 18

  • #system-design
  • #Architecture
  • #senior-engineer
  • #engineering-practices

At some point a ticket lands on your desk that doesn't say how to do the work. It says what the business wants, and then it's on you. There's no existing pattern in the codebase to copy and no senior engineer reviewing a design doc before you start, because you're the senior engineer now.

The usual reaction is to look for the right answer. You search for how other companies solved it, find a conference talk with Kafka in it, and start to wonder if you need Kafka.

System design doesn't really have right answers, though. It has answers that fit a specific problem, team and budget, and answers that don't. What you can learn is a way of getting from the request to a decision you can defend. That's what this post is about. It's less a catalogue of patterns and more a routine you can run every time, plus one worked example from start to finish.

Module B so far has been about running software: pipelines in Part 8, signals in Part 9, incidents in Part 10, the platform in Part 11 and releases in Part 12. All of those lessons feed into design. A design that ignores how the thing will be deployed, observed and debugged is only half done.

What changes when the decision is yours

When someone else makes the architecture call, your job is to build it well. When you make it, the job grows in three directions.

You have to find out what the problem actually is, because the ticket rarely says. "Notify the warehouse when an order is paid" leaves out every detail that matters: how fast, how often, what happens when the warehouse is down, and whether a duplicate is a problem.

You have to choose what to give up. Every option is good at some things and bad at others. A design that's fast, cheap, simple, always available and perfectly consistent doesn't exist, so the real decision is which of those you're willing to lose.

And you have to explain the choice to people who weren't in your head while you made it. That includes your team today and whoever maintains the system in two years, who might be you after you've forgotten everything.

The routine below covers all three.

A loop of five steps drawn left to right, each in its own box with one sample question under it. Step 1, Clarify: what exactly must happen, how often, and what if it doesn't? Step 2, Name the qualities: which three matter most here, in order? Step 3, Sketch options: two or three real ones, including the boring one. Step 4, Check how each fails: what happens when a dependency is down or slow? Step 5, Decide and record: pick one, write down why and what would change your mind. A dashed arrow runs back from step 4 to step 1, labelled: found a new constraint, go back. A note under the loop says the whole thing can take an afternoon for a small decision and a couple of weeks for a large one.

Step 1: clarify the problem before you solve it

Most bad designs I've seen weren't badly reasoned. They were careful answers to a question nobody had asked. Before drawing anything, get answers to three groups of questions.

What has to happen. These are the functional requirements, and the ticket usually has some of them. Push for the edges. What counts as "paid"? Does a cancelled order need a second message? Who else will want this information next year?

How well it has to happen. These are the non-functional requirements, and they're the ones that decide the architecture. Ask for numbers, even rough ones:

  • How many per second, per day, at the peak?
  • How fast does it need to happen? Before the user's response, within a minute, by tomorrow morning?
  • What if it doesn't happen at all? An annoyed customer, a lost sale, a regulator?
  • What if it happens twice?
  • How much data, and for how long?

What you have to work with. These are the constraints, and juniors tend to treat them as noise. The team's size and what it already knows, the infrastructure you already run, the deadline, the budget, compliance rules, and systems owned by other teams that you can't change. A design that needs a technology nobody on the team has run in production carries a cost that won't show up in any diagram.

When nobody knows a number, estimate one and write it down as an assumption. "We assume under 50 events per second" is something people can argue with. A missing number turns into "it needs to scale", and that sentence has justified more needless infrastructure than any other.

Do the arithmetic

A few minutes of back-of-the-envelope maths settles more design arguments than any whiteboard session. You don't need precision. You need the order of magnitude.

Suppose the business says "around 3,000 orders a day". Spread over a day that's about 2 a minute. Assume the peak is ten times the average, which is generous for most businesses: 20 a minute, or one every three seconds. Any database you're likely to be running can handle that without noticing, so throughput is not the hard part of this problem. Knowing that early saves you from designing for a load you'll never see.

The same habit works for storage. A million rows a month at 1 KB each is a gigabyte a month. That's twelve gigabytes after a year, which is small. Storage stops being a design question until somebody's numbers are a thousand times bigger.

Step 2: name the qualities that matter, in order

Once you know the problem, decide what "good" means for this particular piece of the system. The list of possible qualities is long, but a handful come up in nearly every backend decision:

  • Latency: how long the user or the caller waits.
  • Throughput: how much work per second it has to handle.
  • Availability: what fraction of the time it works, and what else fails when it doesn't.
  • Consistency and correctness: whether every reader sees the same truth, and whether anything can be lost or done twice.
  • Cost: in money, and also in engineering time to build and keep running.
  • Operability: who gets paged, how they see what's going on, and how they fix it. Part 9 and Part 10 were mostly about this.
  • Simplicity: how much a new team member has to learn before they can change it safely.

Pick the top three for the problem in front of you and put them in order. That ordering is the actual decision. Everything after it is mostly arithmetic.

The ordering matters because the qualities pull against each other. You can make a write durable on three machines before answering, and you'll pay in latency. You can survive a dependency being down by queueing the work for later, and the trade is that "done" now means "will be done soon". You can run a second region for availability and pay for it every month. None of these trades is wrong. Each is only wrong for a problem where the thing you gave up was the thing that mattered.

Step 3: sketch two or three real options

With only one option, you're not deciding anything. You're justifying a choice you already made. With seven, you'll never finish. Two or three is the useful range, and they should really be different, not the same idea with different product names.

Two habits help here.

Always include the boring option. That's the one that uses what you already run: the existing database, the existing service, a scheduled job. It's usually less impressive and more often right than people expect. If you reject it, you should be able to say why in one sentence.

Sketch each option until you can see the moving parts. A box per process, an arrow per network call, a cylinder per place data lives. Once it's on paper, you can count the new things you'd have to deploy, monitor and upgrade, and you can see every arrow that can fail.

Step 4: check how each option fails

This is where seniority shows. Every option works on the whiteboard. You need to know what happens on a bad day.

Go through each arrow in the sketch and ask:

  • What if the thing on the other end is down? Does the caller fail, wait, retry, or carry on and catch up later?
  • What if it's slow? A dependency that answers in 30 seconds is often worse than one that's down, because it holds threads and connections while it thinks.
  • What if the process crashes halfway through? Between writing to the database and sending the message, for example. Is anything lost? Is anything done twice?
  • What if this part gets ten times the traffic? Which piece runs out first: the connection pool, the database, or the third-party rate limit?

Then check the option against the qualities you ranked in step 2. This is also the step where you often find a constraint you missed in step 1, and you go back. That's normal and it's the reason for the dashed arrow in the diagram.

A worked example: telling the warehouse

Let's run the routine on something concrete. The order-service from the last few parts is a Spring Boot API with PostgreSQL and a queue, running as four instances. A new ticket arrives:

When an order is paid, notify the warehouse system so it can ship.

Clarify

Asking around turns up the following:

  • The warehouse system belongs to another team and has an HTTP API. You can't change it.
  • It's unavailable for about 30 minutes every night for maintenance, and its responses take up to a second when it's busy.
  • Every paid order has to reach it. A missed one is an order that never ships, a refund and a support ticket.
  • A delay of a few minutes is fine. Nobody packs a box in the first minute.
  • The warehouse API accepts the order id as an idempotency key, so sending the same order twice creates one shipment.
  • Volume is the 3,000 orders a day from earlier, so well under one per second at the peak.
  • The team is five engineers who already run PostgreSQL and the queue.

Name the qualities

In order: correctness (nothing lost), then checkout availability (paying for an order must not depend on the warehouse being up), then simplicity and operability (five people, no appetite for new infrastructure). Latency matters only in the sense that checkout shouldn't get slower. Throughput doesn't matter at this volume.

Sketch the options

Three small architecture sketches stacked vertically, each with the same left side: a customer request reaching order-service. Option A, call it directly: inside the checkout transaction, order-service makes an HTTP call to the warehouse API and waits. A red marker on that arrow says: warehouse down or slow means checkout fails or hangs. Option B, publish after commit: order-service commits the order to PostgreSQL, then publishes an OrderPaid message to the queue, and a consumer calls the warehouse. A red marker between the commit and the publish says: crash here and the order is saved but the message is never sent. Option C, transactional outbox: order-service writes the order and an outbox row in the same database transaction. A scheduled relay reads unsent outbox rows, calls the warehouse with the order id as idempotency key, and marks them sent. A green note says: if the relay or the warehouse is down, rows wait and are retried; duplicates are absorbed by the idempotency key.

Option A: call the warehouse inside checkout. The simplest code you could write. The payment handler makes an HTTP call and returns when the warehouse answers. It fails the ranking straight away, though. For 30 minutes every night checkout either fails or creates paid orders that never reach the warehouse, and on a busy afternoon every checkout waits up to a second for someone else's system. Retries inside the request make the waiting worse without fixing the night.

Option B: commit, then publish to the queue. Save the order, then send an OrderPaid message. A consumer calls the warehouse and retries until it works. This fixes availability: the queue absorbs the night's maintenance window, and checkout no longer waits. What it doesn't fix is the gap between the two writes. The database commit and the queue publish are separate operations. If the instance dies between them, or the queue rejects the publish, the order is paid and nobody will ever send the message. It's rare. At a few thousand orders a day, rare still adds up to a few lost shipments a year, and the requirement said every order.

Option C: a transactional outbox. In the same database transaction that marks the order as paid, insert a row into an outbox table. Both are committed together, or neither is. A separate job reads unsent rows, calls the warehouse, and marks them sent. If the warehouse is down, the rows wait and the job tries again later. If the job crashes after calling the warehouse but before marking the row, the row is sent again, and the idempotency key turns that into a no-op.

In code, the write side is one extra line inside a transaction you already have:

@Transactional
public Order markPaid(UUID orderId, PaymentConfirmation payment) {
    Order order = orders.findById(orderId).orElseThrow();
    order.markPaid(payment);
    outbox.save(OutboxEvent.orderPaid(order));   // same transaction
    return order;
}

The relay is a scheduled job. With four instances running it, each one needs to pick up different rows, which PostgreSQL handles with SKIP LOCKED:

@Query(value = """
    SELECT * FROM outbox
    WHERE sent_at IS NULL
    ORDER BY id
    LIMIT :limit
    FOR UPDATE SKIP LOCKED
    """, nativeQuery = true)
List<OutboxEvent> lockNextBatch(@Param("limit") int limit);
@Scheduled(fixedDelay = 5_000)
@Transactional
public void relay() {
    for (OutboxEvent event : outbox.lockNextBatch(20)) {
        try {
            warehouse.createShipment(event.orderId(), event.payload());
            event.markSent();
        } catch (WarehouseUnavailableException e) {
            event.recordFailedAttempt();   // retried on the next run
        }
    }
}

That's simplified. A real version needs a timeout on the HTTP client, a limit on attempts with an alert when a row gets stuck, and a metric for the age of the oldest unsent row. That last one is the number you'd put on a dashboard and alert on, using the signals from Part 9. It also holds a database transaction open while it makes HTTP calls, which is fine for a batch of 20 at this volume and is the first thing you'd change if the volume grew.

Check how each one fails

A scorecard table. Rows are the qualities ranked for this problem, in order: correctness (nothing lost), checkout availability, simplicity and operability, checkout latency. Columns are the three options. Option A, direct call: correctness poor, an order can be paid and never sent during the nightly window; availability poor, checkout depends on the warehouse; simplicity good, no new parts; latency poor, checkout waits up to a second. Option B, publish after commit: correctness fair, a crash between commit and publish loses the message; availability good; simplicity fair, a new consumer and a queue to watch; latency good. Option C, outbox: correctness good, the order and the outbox row commit together and retries are idempotent; availability good; simplicity fair, one table and one scheduled job, no new infrastructure; latency good. Option C is highlighted as the choice, with a note: wins on the top two qualities and costs one table plus one job.

Put side by side against the ranking, the decision mostly makes itself. Option A loses on the two things that matter most. Option B fixes availability but leaves a small hole in correctness, which was the top priority. Option C covers both, and its cost is one table and one scheduled job inside a service the team already runs.

Two things about this example are worth pointing out.

The answer came from the requirements, not from the pattern. Change one answer in the clarify step and the decision changes with it. Suppose the ticket had been "send the customer a confirmation email" and losing one in a hundred thousand was acceptable. Then option B, or even an @Async call after commit, is a perfectly good design, and the outbox is extra work for a guarantee nobody asked for. People who memorise "always use an outbox" will over-build half the time.

The chosen option is the smallest version of itself. There's a much grander version of option C: stream the outbox table into Kafka with a change-data-capture tool and let any number of services consume it. That's a fine design at a much bigger scale and with a team that runs those tools. At under one event per second, with five engineers, a scheduled job and a SELECT cover the requirement. The arithmetic from step 1 is what makes it safe to say so.

Step 5: decide, and write down why

Pick one. Then write a few lines that someone could read in a year without you there:

Decision: notify the warehouse through an outbox table in order-service,
relayed by a scheduled job. No new infrastructure.

Context: every paid order must reach the warehouse. The warehouse is
down ~30 min nightly and slow under load. Checkout must not depend on
it. Volume is under 1 event/second. A few minutes of delay is fine.

Rejected:
- Direct call in checkout: couples checkout to warehouse uptime.
- Publish after commit: loses the event if we crash between the two.

Revisit if: volume passes ~50 events/second, or a second consumer
needs these events (then the relay publishes to the queue instead).

The "revisit if" line is easy to skip and it's the most useful one. It turns the decision from "this is how we do it" into "this is right under these conditions". When the conditions change, whoever is there knows the decision is open again, and knows nobody missed the alternatives the first time.

This short note is an informal version of an Architecture Decision Record. Part 17 of this series covers the format properly, along with where to keep these records and how they stop the same argument from being had every six months.

Match the effort to the cost of being wrong

Not every decision deserves this full treatment. The useful question is how expensive it would be to undo.

Some decisions are cheap to reverse. Which HTTP client library to use, how a class is structured, whether a value is cached for one minute or five. These are what Amazon calls two-way doors. Decide quickly, ship, and change it when you learn more. A long design review for a two-way door is waste.

Others are expensive to reverse. A public API contract that clients will build against, the database you store your core data in, how data is split between services, an event format that other teams will consume. These are one-way doors, or at least very heavy ones, and Part 6 and Part 7 spent a lot of time on why. They deserve the full loop, a written record and a second pair of eyes.

A useful trick when you're stuck is to make the expensive decision cheaper. In the example above, the relay talks to the warehouse directly. If another consumer shows up later, the relay can publish to the queue instead, and nothing upstream changes. Keeping that option open costs nothing now.

Traps to watch for

A few patterns show up again and again in first designs, mine included.

  • Designing for the scale you hope for. Building for a thousand times today's load costs real time now, for traffic that may never arrive, and it's harder to change once it's there. Design for roughly ten times what you have, and write down what you'd change beyond that.
  • Résumé-driven design. Picking a technology because you want it on your CV, or because it was in a good talk. If you can't explain the choice in terms of the qualities you ranked, it isn't the reason.
  • Ignoring who runs it. Every new component needs upgrades, alerts, dashboards, runbooks and someone who understands it at 3 a.m. A design that adds three of them to a team of five has a cost the diagram doesn't show.
  • Only the happy path. If the design review never asked what happens when a dependency is down, it skipped the most important step.
  • Treating "consistent" as one thing. Ask what has to be consistent, with what, and how soon. The order and its outbox row need to be atomic. The warehouse can find out a few seconds later. Separating those two needs is most of the design.
  • Deciding alone and announcing it. Show the options to someone before you choose, especially someone who will operate it. You don't need permission, but they'll see failure modes you missed.

What to try this week

  • Take the next ticket with any design in it and write the clarify questions down before you start. Count how many the ticket answered.
  • Do the arithmetic for one of your services. Requests per second at the peak, rows added per month, size after a year. Compare it with what the infrastructure was sized for.
  • Find a decision in your codebase nobody can explain. Try to reconstruct the options that existed at the time and the qualities that probably drove it. That's the record nobody wrote.
  • Look for a dual write. Anywhere your code saves to the database and then sends a message, an email or an HTTP call as a separate step. What happens if the process dies between the two?
  • For your next decision, write the five-line note. Decision, context, rejected options, revisit if. Put it in the repo next to the code.

The short version

  • System design is about finding the option that fits this problem, team and budget. There's no single right answer to memorise.
  • Clarify first: what has to happen, how well, and with what. Ask for numbers, and write down estimates as assumptions when nobody has them.
  • Do the back-of-the-envelope maths. Orders of magnitude settle most scale arguments.
  • Rank the three qualities that matter most. The ranking is the real decision.
  • Sketch two or three genuinely different options, and always include the boring one.
  • Check how each option fails: down, slow, crashed halfway, ten times the traffic.
  • Pick the smallest version of the option that meets the requirement.
  • Write down why, what you rejected, and what would make you revisit it.
  • Spend effort in proportion to how hard the decision is to undo.

The worked example ended with everything inside one service, and that was on purpose. Plenty of teams would have reached for a new microservice to "own notifications". When that's the right call, and when a well-structured monolith is the better one, is the subject of Part 14: microservices vs. monolith, and making the call that fits your team rather than the trendy one.

This is Part 13 of 18 in the series. The Senior Engineer Roadmap maps the whole series, with a short self-assessment and four reading orders.