//
In many distributed systems, certain tasks (like writing to a shared resource, coordinating a workflow, or assigning work to other nodes) must be performed by exactly one node at any given time. This designated node is called the Leader. The process of choosing this leader from a group of candidate nodes is called Leader Election.
One of the simplest leader election algorithms. Each node has a unique numerical ID.
Raft is a modern, widely-used consensus algorithm designed for understandability. It ensures that a cluster of servers agrees on a leader and that the leader's log of operations is replicated correctly.
In practice, many systems delegate leader election to a dedicated coordination service rather than implementing it from scratch.