Trace your own stack
After today, you can trace one click through every layer of a product, draw it as a sequence diagram, and find the steps a user actually waits on.
Dip your toes 1 min
Tracing means picking one thing a user does and following it through the product, step by step. Tap the plus beside a song on Spotify, and it turns into a check mark at once. Behind that check, the app sends a message to Spotify’s servers, computers the company rents or runs. They confirm it’s you, save the song to your library, and answer back. If any step fails, the check flips back to a plus. Other work, like updating your recommendations, happens later, after you’ve moved on. Each step usually belongs to a different team. So when the check mark flips back for no clear reason, the trace shows which step broke and whose it is.
The full lesson 10 min
Why this exists
Two weeks in, you have a lot of separate pieces. The stack and its layers. Environments, deploys, and pull requests. The browser, requests and responses, APIs, frameworks, data fetching, and speed.
Each made sense on its own day. In a real product, they all happen at once, in less than a second, every time someone taps something.
Engineers hold that complexity in their heads one action at a time. When they debug a problem or plan a feature, they pick one thing a user does and follow it through the system, step by step. That habit is called tracing. It turns “how does the app work?” into a question small enough to answer: what happens when someone taps this?
Today you’ll trace one click through Spotify, using the past two weeks. Then you’ll do it for a product you work on. Once you can trace a click, architecture conversations stop being abstract. They become a story about steps, and you can ask about any step in the story.
Tracing also finds things a design file can’t show. Every step in a trace is a place where the product can wait, fail, or show something stale. Every step also has an owner, often a different team. A designer who can follow the trace knows which states need designing and whose roadmap a change has to join.
What it is
Tracing a click means picking one user action and following it layer by layer. At each step, you note four things. What runs, where it runs, what it asks for next, and what happens if it fails. The stack map from Day 1 is the frame. The click is the path through it.
Here’s a simplified version of what happens when you save a song on Spotify. You tap the plus button beside a song, and it turns into a check mark. The app shows the check right away, an optimistic update from Day 12. Behind the check mark, the real work starts.
- Frontend. The app sends a request to a Spotify endpoint whose job is saving a song for a user. The request carries the song’s ID and proof of who you are.
- Backend. A server checks that the request really comes from you, that the song exists, and that you’re allowed to save it.
- Data. The backend writes the song into your library in a database.
- Frontend again. The backend answers that the save worked, and the app keeps the check mark. If the answer is an error, the app turns the check back into a plus.
Notice how much of the past two weeks sits inside those four steps. There’s a request and a response, an endpoint, and JSON. There’s state that flips the check mark, and an optimistic update. Even the backend code that answers is whichever version was last deployed to production. A trace is where the vocabulary stops being a list and becomes one story.
The stack map shows where each step happens. It doesn’t show when, or who talks to whom. For that, engineers draw a sequence diagram.
A sequence diagram lists the parts of a system across the top, each with a line running down the page. Messages between the parts are arrows, drawn in time order from top to bottom. In this course, solid arrows happen now and dashed ones happen later. In engineers’ sequence diagrams, a dashed arrow usually means a reply. Sequence diagrams show up in design documents and pull requests, and they’re the most common way engineers explain a flow to each other.
Steps 1 to 4 form the critical path: the chain of steps that must happen one after another before the user sees the result. Each step waits for the one before it, so their times add up. The critical path sets how long the user waits. Speeding up anything off it, like step 5, changes nothing they can feel.
Some made-up but realistic numbers show how the path adds up. Say the request takes 150 milliseconds to reach the backend on a phone with a weak signal, and the checks take 20. The database write takes 30, and the answer takes 150 to travel back. The user waits about 350 milliseconds, and most of it is travel, the latency from Day 13.
Making the database twice as fast would save 15 milliseconds. Moving the server closer would save far more.
The optimistic check mark hides the critical path, but it doesn’t remove it. If step 3 fails, the user finds out only after the whole path has run, when the check flips back. A long critical path makes that reversal arrive late, sometimes after the person has scrolled away.
How it shows up in your work
Pick one click you designed in your own product, ideally something people do often, and trace it with an engineer. You don’t need access to the code. You need a laptop, the browser’s developer tools from Days 9 and 13, and half an hour.
Trace the product people use, in production, rather than a local copy, so you see the real requests. For a phone app, engineers have similar tools that show each request the app sends.
- Open the screen and the network panel, then do the click once.
- List every request the click sends, in order.
- For each one, write down the layer it reaches and what it does.
- Ask what happens if that step fails, and what the user sees.
- Mark the steps the user waits on. That’s your critical path.
The last two columns are yours, the failure column most of all. Engineers can usually fill in the first three from memory or from the network panel. What the user sees at each step, especially when a step fails, is often undecided until someone asks.
A first trace almost always turns up a step nobody designed, like a slow request with no loading state. Slowing the network down in the developer tools helps here. The order of requests becomes easy to see, and so does every moment where the screen shows nothing useful.
A trace pays off in design reviews too. A proposal like “show how many times you’ve played this song” sounds small. Traced, it’s a new question for the backend, maybe a costly one, as Day 12 showed. The useful follow-up is whether it has to sit on the critical path. If the confirmation can appear first and the play count a moment later, the save stays fast.
A trace also gives you a better argument than taste. Pointing at the step a design adds, and whether the user waits on it, moves the conversation forward.
Bugs and outages use the same trace. When saving fails, the trace tells you which step broke. That decides what the user should see.
A failed request from the phone suggests a connection message. A failed database write suggests trying again later. Without a trace, every failure gets the same generic error.
The one thing people get wrong
One tap, one request: you tap, the app asks the server, the server answers, done. It’s a tidy model, and it’s wrong. Even in the trace above, one tap became several messages between parts. In a large product, one click usually sets off far more, many of them after the user has moved on. Behind the backend, a single request can call several other services, each owned by its own team, and each of those can call more.
That spread is called fan-out: one request or event triggering many others, often sent to several services at once. Here’s a simplified version for Spotify. The save reaches the backend, and the backend tells several other parts of the system. The library database has to answer now. Recommendations, your other devices, and analytics can catch up later.
Fan-out is why some things in a product become true eventually, not at once. Save a song on your phone, and your laptop may show it a moment later, once the message reaches it. Nothing is broken.
That work was deliberately moved off the critical path, so the tap stays fast. Day 18 covers how that background work is organized. For now, notice that “later” is a choice someone made.
Fan-out on the critical path is a different story. If the backend had to wait for all four services before answering, the slowest one would set the pace for every save. Each extra service is also another thing that can fail. That’s why engineers push back on features that add a step everyone must wait for. A design that lets some information arrive late is often the faster and sturdier one.
When you trace your own product, mark the fan-out too. For each step on the path, ask what else it tells, and whether that happens now or later. The later ones explain a whole family of bugs, where something worked on one device but hasn’t shown up on another yet. Knowing they’re expected lets you design for them instead of filing them.
Ask an engineer this
“Can we trace one click in our product together, layer by layer, and mark which steps the user waits on?”
Ask for half an hour with one engineer and one click you care about, ideally on a screen you designed. By the end, you want a list of requests, the layer each one reaches, and a mark beside the ones on the critical path. Steps that surprise the engineer too, like a request nobody remembers adding, are worth a note. Then ask what the user sees when each step fails, and write the answers down. That list is often the most useful design document a screen ever gets.
Terms from today
- Sequence diagram
- A diagram that lists the parts of a system across the top and draws their messages to each other as arrows, in time order from top to bottom.
- Critical path
- The chain of steps that must happen one after another before the user sees the result, which sets how long they wait.
- Fan-out
- When one request or event triggers many others, often sent to several services at once.