I needed to put ten thousand public answer pages live on Statpro with no maintenance window and no rollback button if something broke. Flipping them all at once wasn't an option, and looping over them and hoping was worse.
Statpro is a sports stats site. Its Ask feature answers plain-English sports questions by computing them from the stats database. Answers that pass automated verification become permanent public pages, and the list of verified questions allowed to become pages is the catalog. Activating a page means making it public.
Why one transaction doesn't work
Ten thousand pages is too many to activate in a single transaction. A plain loop has a nastier failure, though. If it dies partway, you're left with a half-live catalog where some pages load and others return a 404.
The pages aren't the only moving part either. The middleware caches results, the CDN edges need invalidating, and a version number in the database has to advance in step, so cached query results don't serve stale data next to new pages. All of that has to move together, or visitors see a site that disagrees with itself.
Shards, approvals and checkpoints
The approach was to split the catalog into shards, which are groups of pages, and activate them batch by batch. Each batch needs an approval tied to its exact contents, so a batch that changed after review can't slip through. After every batch commits, the script writes a checkpoint.
The checkpoint is what replaces the rollback button. If the script crashes, or the database connection drops, or a review fails, the next run reads the checkpoints and skips every shard that already committed. A lock keeps two activation runs from colliding.
There's also a canary gate, a deliberate pause, between activation and publication. The first batch has to pass a human review before the rest are allowed to proceed. If my assumptions about the catalog are wrong, I'd rather learn it from one batch than from all of them.
This is boring infrastructure. Boring infrastructure is what let me launch 10,000 pages at 4 AM and go to bed. If it had failed at batch 47, I'd have resumed from batch 47 and kept everything before it.
A frozen proof of what went live
The part I'm proudest of is the frozen publication proof. I didn't want to trust that the catalog at activation time matched what I'd reviewed. So the migration writes down exactly which leagues, stat types and year ranges the pages cover, meaning the data is known to be complete there, as inline SQL literals. The same immutable SQL feeds both a generated column in the database and the strict parity checks, so the database itself enforces the contract.
Each piece of evidence is a key that encodes the coverage version, league, stat type and year range:
const COVERAGE_EVIDENCE_KEYS = [
"ask-coverage:2026-08-11.5|nfl|player-season-regular|1990-2025",
"ask-coverage:2026-08-11.5|nba|player-game-postseason|2000-2025",
// ... 40+ entries covering MLB, NBA, NFL
] as const;
If a later expansion needs different bounds, it has to add a v2 column and leave the frozen v1 contract alone. That sounds rigid, and it's meant to be. The proof is a tamper-evident record of what was live at launch, and a record you can edit isn't a record.
News went public in the same window
In the same 26-hour stretch, the feed of short player news items went from staff-only to fully public, with a monitoring and operations layer behind it. The interesting piece is the takedown contract. Publishing news isn't enough. You also need a structured way to remove it if a rights issue comes up. The contract defines what a takedown request looks like, how it's validated and what the runtime does once one is approved. That work is easy to defer and painful to build after you need it.
What I'd split next time
The frozen proof took the most design effort, and I'm glad it shipped before launch. The batch activation script is another story. It ended up at 1,057 lines, with checkpoints, approval checks, locking and the canary review all in one file. Next time I'd pull approval verification into its own module, the way the frozen proof already is. When a launch has no undo, each part should be small enough to review on its own.