CourseAI System Design: The Complete Course · Module 14: Scale and Evolution · part 96 of 107
Part 96 · Module 14: Scale and Evolution

Lab: Ten times the traffic, and a migration

457 min read·
Module 14 · Lab · About 60 minutes · Needs: lessons 1 and 2 of this module, and the Module 13 lab (or nothing: Step 1 rebuilds Modules 1 to 13)

What you are building

HOW IT WORKS Scale and change, run for real scale_sim.py 10x replay, quotas migrate.py Intake's store, gates exits.py residency, lock-in design step 10, migrations.md ADR-024 to ADR-026, ten failure-mode rows Gemini Developer API: no tenant's fallback or way out
What this lab adds (blue): a replay of ten times the target through the real quotas and queue, the embedding migration on Intake's own store, and ways out checked by the residency code. Each writes into the design documents (grey).

The lessons measured scale and change on their own. This lab runs them through the repository: Lesson 1's replay meets Module 11's per-tenant rule and Module 10's admission gate, Lesson 2's migration runs on Intake's real store with every edit arriving through Module 5's sync, and the lock-in scorecard reads the finished code.

One rule changed after the lessons were written. Guide 03 (corrected 19 October 2026): the Gemini Developer API fails residency for every tenant, US included, so no fallback or way out may name it. Lesson 1 says Gemini passes "only for US tenants" and Lesson 2's scorecard names "Gemini, through the port" as the chat model's way out. This lab follows the corrected rule and shows both.

Nothing calls a hosted model. Lesson 2's two embedding models download from Hugging Face once. Open a new Colab notebook, module-14-lab.ipynb, and run each cell in order.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan