Search Tech Journey

Find topics, journeys and posts

back to blog
recommendation systemsintermediate 6m read

Recommendation Systems From Scratch

Design a recommender from first signals, build a concrete worked example, then dissect TikTok's Monolith — retrieval vs ranking, cold start, and the tradeoffs every real system makes.

Recommendation Systems From Scratch

Recommendation systems taught the way you'd actually build one: design from first signals, then a concrete worked build, then a teardown of a real large-scale engine. Three posts, deliberately short, in strict build order.

Who this is for

You can write Python and you understand basic ML (features, training, evaluation), but you've never designed a system whose job is "pick 20 things out of ten million, in 100 milliseconds". That constraint — not the model — is what shapes every real recommender, and it's what this series is organised around.


The path

Part 1 · Design (~6 min, intermediate)

Designing a Recommendation System From Scratch

The architecture before the algorithms. Why every serious recommender splits into retrieval (cheap, recall-oriented, millions → hundreds) and ranking (expensive, precision-oriented, hundreds → tens), and the tradeoffs you're forced to make: freshness against relevance, exploration against exploitation, personalisation against cold start.

Start here. Parts 2 and 3 both assume the retrieval/ranking split.

Part 2 · Build (~6 min, intermediate)

Building a Recommendation System From Initial Signals

The concrete worked example. Given a handful of early adopters of a product, how do you find the next set of users most likely to convert? This is the cold-start problem in its most honest form — you have almost no data, and the model has to be useful anyway.

Prerequisite: part 1.

Part 3 · Teardown (~8 min, intermediate)

Diving Deep Into TikTok's Recommendation Engine

What a production system looks like at the far end of the scale curve. A read of ByteDance's Monolith paper and repo — collisionless embedding tables, online training, and why real-time feedback loops are treated as an architectural requirement rather than a nice-to-have.

Prerequisite: parts 1–2. This is where the design decisions from part 1 show up under extreme load.


How to read this series

Start at part 1 and move forward. Every post has prev/next navigation at the bottom, so you can walk the whole track without coming back here.

The whole series is about 20 minutes of reading. It's a short track by design — enough to reason about recommender architecture in a design discussion, not enough to build a production one alone.

What this series does not cover

  • Collaborative filtering and matrix factorisation from first principles — the classical foundations sit in the 6-month plan, module M11.
  • Embedding and vector search internals — see RAG basics in the Applied LLMs series for the retrieval machinery.
  • Ranking-metric methodology (NDCG, MAP, offline/online gaps) — mentioned, not treated properly.

Open the full series →