Free preview

Building Blocks We Will Use

Why this matters: four of these five blocks do exactly what they did in earlier chapters. One does not, and spotting which is the point of the lesson.

Based on our requirements and estimations, we will use the following core components.

Building blockRole here
Load balancersDistribute user requests across multiple servers and services
DatabasesStore metadata and graph-structured data
CDNsDeliver static content to end users, reducing latency and server load
Pub-sub systemManage real-time messaging and events
CacheStore frequently accessed data to improve performance

Additional components, such as an API gateway and ZooKeeper, are also critical.

Key takeaway

Five blocks — load balancers, databases, CDNs, pub-sub, cache — plus an API gateway and ZooKeeper. Four behave as before. The cache does not: it stores output that was computed, not fetched, so a miss costs GPU-seconds rather than milliseconds and every caching rule shifts — lower hit rates pay off, and approximate matching becomes worthwhile. The CDN carries only the wrapper, since responses cannot be cached at the edge. And ZooKeeper's recovery is minutes, not seconds, because a replacement server must load 140 GB of weights.

Next: the high-level design and the path a prompt takes through it.

Enjoying the preview?

Create a free account to unlock the rest of this course, the in-browser judge, and live AI mock interviews.

Sign up free to continue