The horror story of MySQL 'Dumper'
summary
A legacy Paper pipeline reads 9 MySQL tables with tens of millions of rows, streams rows row-by-row and initially takes ~500→400→43 minutes after fixes. Practical wins: move processing to dedicated EC2 hosts, switch from C4xlarge to C5 for 10 Gbps network, hoist a regex out of the per-row loop for a 4x micro-optimization and 10x overall speedup, add metrics/alerts, use DB cursors + Redis offsets, shard work across instances and add rate limiting to survive downstream QPS limits.
AI-written summary · about
chapters (12)
- 0:00Start
- 0:14AGATA CIEPLIK
- 1:46Dropbox Paper
- 3:29Tech stack
- 5:03Initial state of things
- 7:02Mysqldumper's network usage
- 8:17What is happening when processing a single row?
- 9:09Taking things out of the loop!
- 10:31Introducing database cursor
- 14:36Mysqldumper's simplified diagram
- 14:48Mysqldumper's actual diagram
- 17:07The end result: success!
