Read this story as text
Recommendations: the story, written out
People who bought milk also bought bread, for 50,000 items and a million people. Nami, a cloud architect, builds the AWS setup behind recommendations: Kinesis, DynamoDB, OpenSearch vector search, SageMaker, Step Functions and ElastiCache.
- The app suggests honey. You never searched for honey. How did it know?
- Fifty thousand items, a million people, and a model that must guess in milliseconds.
- Three goals for suggestions: Learn from what people do, soon after they do it. Suggest only what can reach you now. Be useful on day one, even for someone new.
- Stay for the brand new user. That one surprises people. Scroll.
- What a tap tells us. Nobody rates groceries. So we learn from taps: oats viewed, milk added, bananas bought twice. Small clues that add up. Where do taps go?
- Take in every action. Straight into a Kinesis stream, through API Gateway. Millions of tiny messages are easy if you do not think on arrival.
- Remember the recent past. A function keeps a short summary per person: the last twenty items in thirty days. Short means fast to read. Now, someone asks for ideas.
- Someone asks for ideas. Three moves: find, rank, filter. Find wide and cheap, rank carefully, so only a few. How do we find similar items among fifty thousand?
- Find similar things. Items become lists of numbers, so things bought together sit close. OpenSearch finds neighbours in milliseconds: fifty thousand becomes two hundred.
- Rank the short list. A model scores the two hundred: how likely are you to buy each, right now? The best twenty survive. Done? Not yet.
- Only what can reach you. A perfect pick that is out of stock is a bad pick. We check your store, and drop what you bought an hour ago. Now, the surprise.
- Day one for a new person. A new user has no history! So we show what is popular in their area, ready-made in memory. Day one still feels personal.
- Learn while you sleep. Every night a workflow trains a new model, tests it against the old one, and only swaps if it wins. But better, how?
- Is it really better? Five percent of users see the new model first, and we compare orders. If anything drops, we roll back on our own.
- Watch it age. Recommendations fail quietly: shelves fill, just worse. So I watch model age, click rate and fallback use. Quiet failure, loud number.
- The whole picture. That is one set of ideas, tap to shelf. Trace it yourself, or open the full diagram.
More stories on Real-world systems