Systems & Backend

Leader Election

Picking exactly one node to be in charge — and handling the moment the old leader doesn’t know it lost.

Leader election designates one node to coordinate (order writes, assign work) so the rest can follow. The hard part is not choosing — consensus or a lease from etcd/ZooKeeper handles that — but the deposed leader that keeps acting on stale authority. Leases with expiry plus fencing tokens (monotonic epoch numbers checked by downstream systems) are the standard defense.