Emergent Leader

Order cluster nodes based on their age within the cluster to allow nodes to select a leader without running an explicit election.

Problem

Peer-to-peer systems treat each cluster node as equal: there is no leader. This means there is no explicit leader election process as happens in the Leader and Followers pattern. Sometimes the cluster also doesn't want to depend on a separate Consistent Core to improve availability. However, there still needs to be one cluster node acting as cluster coordinator for tasks such as assigning data partitions to other cluster nodes and tracking when new cluster nodes join or fail and taking corrective actions.

Solution

One of the common techniques used in peer-to-peer systems is to order cluster nodes according to their age in the cluster. The oldest member of the cluster plays the role of the coordinator. The coordinator is responsible for deciding on membership changes and making cluster-wide decisions, such as ensuring the distribution of Fixed Partitions across cluster nodes.

for more details go to Chapter 29 of the online ebook at oreilly.com

This pattern is part of Patterns of Distributed Systems

23 November 2023