Home feed: what you see when the app opens, built serverless with Nami

Real-world systems
Home feed
Nami, cloud architect
Nami
Thank you

You built the home feed with me.

From a tap on the icon to a page that feels made for you. You learned:

  • Why the shared part of the page is cached by area, not by person.
  • How one call and a thin function build a whole screen.
  • How ready-made rows and a hot cache make the first second possible.
  • How personal and stock-aware shelves are added in parallel, with deadlines.
  • How fallbacks, flags and a background rebuild keep it fast and honest.
Next: recommendations

    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.

    1. You tap the app icon. One second later, a page made for you appears. What just happened?
    2. It looks like one page. It is a dozen answers, stitched together before you blink.
    3. 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.
    4. Watch for the step where we cache something for everyone, but never for you. Scroll.
    5. The first second. You tap, and nothing is there yet. This is the most dangerous second in the app. How do we win it?
    6. 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.
    7. 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.
    8. 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.
    9. 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.
    10. 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.
    11. 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.
    12. 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.
    13. 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.
    14. Same app, different feeds. Flags let a small group see a new layout, and we compare what they do. Same app, different feeds.
    15. 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.
    16. Watch how it feels. I watch the slowest slice, the ninety-fifth percentile, never the average. And I count fallbacks, because they fail quietly.
    17. The whole picture. That is one app open. Trace it yourself, or open the full diagram.

    More stories on Real-world systems