Leader election for reads
When a leader helps, when quorum reads are safer, and how fencing applies.
Leader election for reads
Business constraint
Metadata must be strongly ordered. Followers exist for read scale. Product asks "why not always read followers?"
Naive v0
All writes to leader; all reads to random followers. Or single leader with no failover rehearsal.
Failure drill
Stale reads after failover. Split brain if two leaders. Read-your-writes broken after redirect.
Evolution path
Iteration 1
Define read classes: strong (leader or quorum), bounded-stale (follower with lag SLO), eventually consistent.
Iteration 2
Leader election with fencing; clients pin epoch. Quorum reads when leader is a bottleneck but linearizability needed.
Iteration 3
Chaos: kill leader under load; measure stale window and client recovery.
Implementation cut
Document which API paths are strong vs stale. Do not hide failover behind silent wrong answers.
Numbers
Election time. Max accepted lag for stale reads. Incorrect-read incidents in drills = 0 for strong paths.
Pattern tags
Self-check
- What do quorum reads buy vs leader reads?
- Why fencing in election?
- When are follower reads OK?
- What breaks read-your-writes?
- What do you measure in a failover drill?
Walkthrough
Recordings will appear here when published. Until then, work the failure drill and lab locally — pause after each iteration and write the metric that moved.