Hard Database Systems Distributed Databases
Explain the Raft consensus algorithm used in distributed databases.
Answer
Raft ensures distributed consensus for replicated state machines. Nodes are leader, follower, or candidate. Leader election: followers timeout waiting for heartbeat, become candidates, request votes. Leader handles all writes, replicates log entries to followers. Safety: committed entries are durable. Split-brain prevented by requiring majority quorum. Simpler than Paxos. Used in etcd, CockroachDB, TiKV. Handles leader failure, network partitions, and ensures linearizability.
IIT Certified
Master These Concepts with IIT Certification
175+ hours of industry projects. Get placed at Bosch, Tata Motors, L&T and 500+ companies.
Relevant for Roles
Systems Architect Senior Software Engineer Distributed Systems Engineer