# Leader Election

> Coordinate actions by electing one instance as the leader

- **Category**: Cloud
- **Subcategory**: azure
- **Canonical URL**: https://designpattern.fyi/patterns/azure_leader_election/

---

## Description
The Leader Election pattern coordinates actions in a distributed application by electing one instance as the leader. The leader manages a collection of collaborating task instances. This ensures that only one instance performs specific tasks while others stand by, preventing duplicate work and conflicts.


## Use Cases
Use when you need to coordinate distributed tasks or when you want to prevent duplicate work across instances.





## Trade-offs


### Advantages

- Prevents duplicate work

- Coordinated task execution

- Automatic leader failover

- Distributed coordination




### Considerations & Drawbacks

- Complexity of leader election

- Network partition handling

- Potential split-brain scenarios







---
**Reference**: [Original Source](https://learn.microsoft.com/en-us/azure/architecture/patterns/leader-election)

