Course contentsShow
← System Design
Lesson 599 of 1,91917. Consensus AlgorithmsFree lesson

What Is Distributed Consensus?

Understand consensus as agreement among distributed nodes on a single value despite failures and network issues.

What Is Distributed Consensus?

You'll learn: What distributed consensus means and why getting multiple independent computers to agree on something is fundamental to building reliable distributed systems.

The Core Problem

Imagine a group of friends trying to decide on a restaurant for dinner, but they can only communicate through unreliable text messages that might get lost, arrive out of order, or be delayed. Some friends might disappear mid-conversation (their phones died). Despite all this chaos, everyone needs to agree on one restaurant, and once decided, that choice must stick—no one can accidentally end up at different places.

This is distributed consensus: getting multiple independent nodes (computers) in a distributed system to agree on a single value or decision, even when:

  • Nodes can fail or crash
  • Network messages can be lost, delayed, or duplicated
  • Communication is asynchronous (no shared clock)

Why Consensus Matters

Consensus underlies nearly everything in distributed systems:

  • Leader election: Which node should coordinate operations?
  • Transaction commit: Should we commit or abort this distributed transaction?
  • State machine replication: What's the next operation all replicas should execute?
  • Configuration changes: Should we add this new node to the cluster?

Without consensus, you can't build reliable systems that tolerate failures. You'd have split-brain scenarios, inconsistent states, and conflicting decisions.

The Challenge

Consensus is hard because you need agreement, validity (the agreed value was actually proposed by someone), and termination (the decision completes eventually)—all while nodes crash and networks partition.

Key Takeaway: Distributed consensus is the fundamental problem of making multiple independent nodes agree on a single value despite failures and network issues—it's the foundation for coordination, consistency, and reliability in distributed systems.