Wrote an essay on how MySQL binlog replication actually works

Arpit Bhayani

Arpit Bhayani

Jan 16, 2026 • 1 min read


Wrote an essay on how MySQL binlog replication actually works under the hood.

This week, I went deep into binary log formats, event structures, threading models, replication modes, and all the practical considerations for running replication at scale. I have covered how the source (master), replica, relay log, SQL threads, and multi-threaded appliers all coordinate to keep data consistent.

If you want to know and understand how MySQL replicates changes, why row-based logging matters, how replication lag happens, and best practices for production deployments, give this essay a read. It’s pretty in-depth.

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses