Read this story as text
Home feed: the story, written out
You open the app and a dozen answers appear in about a second. Nami, a cloud architect, builds the serverless AWS setup behind the home feed: CloudFront, API Gateway, Lambda, ElastiCache, DynamoDB and EventBridge.
- You tap the app icon. One second later, a page made for you appears. What just happened?
- It looks like one page. It is a dozen answers, stitched together before you blink.
- Three goals, in one second: The first screen shows up in about a second. It feels like it was made for you, and it knows what is in stock. One slow part never breaks the whole page.
- Watch for the step where we cache something for everyone, but never for you. Scroll.
- The first second. You tap, and nothing is there yet. This is the most dangerous second in the app. How do we win it?
- Cache what is the same. Half the page is identical for everyone nearby. CloudFront keeps it close, keyed by area, never by person. Most requests never reach us.
- One call for the whole screen. Twelve calls from a phone on weak data would crawl. So the phone makes one call, and a function behind API Gateway fans out for it.
- Ready-made rows. Shelves are not built when you ask. They were built minutes ago, per area, and wait in DynamoDB. A finished row beats a fresh one.
- A hot copy. The same rows are read thousands of times a minute, so a copy lives in memory, in ElastiCache. One millisecond. Lost cache? It just refills.
- Make it yours. On top, we ask recommendations what suits you. Two or three shelves. That is what makes the app feel like it knows you. But there is a catch.
- Do not tempt me with what is gone. Shelves of things you cannot buy feel awful. So inventory filters them by your store. One short list, one call.
- Order again, in parallel. Recommendations, stock, past orders: all at once, each with a hundred and fifty milliseconds. The page waits for the slowest, not the sum.
- When one part is slow. Something is always slow. So each part has a plan B: the last good shelf. A missing shelf is fine. A spinner is not.
- Same app, different feeds. Flags let a small group see a new layout, and we compare what they do. Same app, different feeds.
- Rebuild in the background. Every few minutes a scheduler rebuilds the ready-made rows, so by the time you open the app, the work is done.
- Watch how it feels. I watch the slowest slice, the ninety-fifth percentile, never the average. And I count fallbacks, because they fail quietly.
- The whole picture. That is one app open. Trace it yourself, or open the full diagram.
More stories on Real-world systems