Single-Leader Replication

Single-Leader Replication A data-flow diagram generated by Archify. 01 / Clients 02 / Routing 03 / Replication 04 / Followers Write Client · sends every write · 01 / Clients · leader-only writes Write Client sends every write leader-only writes Read Client · scales out reads · 01 / Clients · any replica Read Client scales out reads any replica Leader / Primary · accepts all writes · 02 / Routing · serializes writes Leader / Primary accepts all writes serializes writes Read-Your-Writes · own data from leader · 02 / Routing · stale-read remedy Read-Your-Writes own data from leader stale-read remedy Replication Log · stmt · WAL · logical · 03 / Replication · decouples replicas Replication Log stmt · WAL · logical decouples replicas Replication Lag · seconds to minutes · 03 / Replication · eventual consistency Replication Lag seconds to minutes eventual consistency Sync Follower · leader waits for ack · 04 / Followers · semisynchronous Sync Follower leader waits for ack semisynchronous Async Follower · no waiting, may lag · 04 / Followers · unbounded lag Async Follower no waiting, may lag unbounded lag all writes through the leader write path append every change hot path ship log, wait for ack semisynchronous if the user just wrote read-your-writes otherwise read from a follower stale reads possible stale value until it catches up eventual consistency ship log, fire and forget async shipping Legend primary data async batch data store data flow