Primary writes binlog; replicas apply events for read scaling and failover—async replication means replica lag is normal.
Topology
- Primary (master) — accepts writes
- Replica (slave) — read-only copies for scaling
- GTID — global transaction IDs simplify failover (modern setups)
Read/write split
Laravel can route reads to replica—ensure read-your-writes UX hits primary when needed.
Important interview questions and answers
- Q: Replication lag?
A: Replica may be seconds behind—stale reads possible. - Q: Binlog format ROW?
A: ROW format safer for deterministic replication with triggers.
Self-check
- Which node takes writes?
- What is replication lag?
Tip: Route read-your-writes traffic to primary.
Interview prep
- Lag?
Replica behind primary—stale reads possible.
- Binlog?
Records changes for replicas.