Graph
Consensus Algorithm

🤝Consensus Algorithm

NEW

Also known as: Consensus Protocol

A fault-tolerant method for multiple nodes to agree on a single value or sequence despite failures.

DESCRIPTION

Consensus algorithms enable replicated services to behave like a single reliable system. They coordinate log replication and ordering of operations, ensuring safety and liveness under failures. Paxos and Raft are widely used crash-fault-tolerant protocols; PBFT variants tolerate Byzantine faults. Consensus underpins databases, coordination services, and distributed schedulers.

ALTERNATIVE DEFINITIONS

Wikipedia

In computer science, consensus algorithms are fault-tolerant mechanisms to achieve agreement on a single data value among distributed processes or systems.

Stresses agreement among distributed processes with fault tolerance.

Source

Raft Paper (Ongaro, Ousterhout)

Raft is a consensus algorithm for managing a replicated log.

Defines consensus via the replicated log abstraction in a concrete protocol.

Source

Paxos Raft State Machine Replication Leader Election Byzantine Fault Tolerance Quorum

COMPETING TERMS

CRDTs

RELATIONS

KNOWLEDGE AREAS

Data Architecture Software Engineering Infrastructure Data Storage & Operations

TARGET AUDIENCE

Software Developer Cloud Architect Data Engineer MLOps Engineer Data Architect

EXTERNAL SOURCES

TOP QUESTIONS

Why do distributed systems need a Consensus Algorithm?

To maintain a single, correct order of operations across replicas despite node and network failures, enabling strong correctness guarantees.

Category: Relevancy

What is the difference between Paxos and Raft?

Both ensure safety and liveness under crashes; Raft emphasizes understandability with a leader-based design and clear roles.

Category: Comparison

When would CRDTs be preferable to consensus?

For highly available, commutative data types where occasional conflicts can be automatically merged without global coordination.

Category: Opinion

What failures do typical consensus protocols tolerate?

They tolerate crash failures and message loss but not arbitrary (Byzantine) behavior unless using BFT variants.

Category: Concept

What are common mistakes implementing consensus?

Ignoring log compaction, election edge cases, and persistence guarantees often leads to split-brain or data loss.

Category: Mistakes

How do quorums relate to consensus?

Majority quorums ensure any two majorities intersect, preventing conflicting decisions and preserving safety.

Category: Concept

How to test a consensus implementation?

Use deterministic simulations, model checking, and Jepsen fault-injection to exercise partitions, timeouts, and crashes.

Category: Testing

Is consensus always required for replication?

No. Leaderless quorum systems and CRDTs replicate without global consensus, trading off consistency or operation semantics.

Category: Misunderstanding

What is state machine replication?

A pattern where consensus orders commands consistently across replicas, which execute them deterministically to stay in sync.

Category: Concept