How a 10-stage internet-radio directory sync pipeline lives inside a single C++ daemon, and the single MariaDB RENAME TABLE call that gives the public yp.casterclub.com directory zero-downtime guarantees even when the upstream Xiph feed breaks.
Live repository
What the article will cover
The problem
How "the upstream feed broke halfway through your sync" becomes "your public directory is empty" — and why that's unacceptable.
The 10-stage pipeline
Fetch → parse → crawl → sanitize → verify → write → guard → archive → swap → export. What each stage does and how they share state safely in one process.
Writing to temp tables
Why every write goes to temp_stations / temp_mounts instead of live, and what guarantees that buys you.
The Swap Guard
The 100-station floor that aborts the swap on a bad sync. The full check matrix and the abort/retry logic.
RENAME TABLE: the atomic call
The single line of SQL that flips live to old and temp to live atomically. Why MariaDB guarantees this and what happens to in-flight reads.
Why microservices would lose this
A walk through how splitting this pipeline into a "fetcher service" and "writer service" breaks the guarantee — and what saga patterns can't recover.