After data is sharded using consistent hashing, each data shard has multiple replicas stored on different nodes, improving data reliability and durability
Even if some nodes fail, data is not lost, and services remain uninterrupted
Consistent hashing ensures that data distribution is independent of the number of nodes. Adding or removing nodes affects only a small portion of data on the hash ring, enabling smooth scalability
When node loads are uneven, load balancing can be achieved by adjusting the number of virtual nodes or rehashing, ensuring roughly equal load across nodes
The distributed architecture inherently supports horizontal scalability, allowing system capacity and throughput to scale linearly by adding more nodes
Follower Read: Allows reading data from non-leader nodes, reducing the read load on the leader and improving system throughput
ReadIndex: Return consistent data index, ensuring clients read the latest consistent data while avoiding unnecessary synchronization overhead
Prevote: Reduces invalid votes during leader election, speeding up election of new leader and minimizing service interruptions caused by leader changes
Protocol Overview: Paxos, proposed by Leslie Lamport in 1990, is a classic distributed consistency protocol. It uses multiple rounds of voting to elect a leader and ensure the leader submits correct updates
Industry Applications: Widely used in distributed systems like Google’s Chubby and Apache ZooKeeper to ensure data consistency.
Protocol Overview: Raft, introduced by Diego Ongaro and John Ousterhout in 2014, is a newer consistency protocol. It ensures data consistency through leader election, heartbeat mechanisms, and log replication
Industry Applications: Adopted by modern distributed systems like Etcd, Consul, and CockroachDB, leveraging Raft to simplify consistency implementation and enhance availability and reliability.
Protocol Overview: Two-Phase Commit is an atomic commit protocol ensuring all participants agree on a decision. It includes a prepare phase and a commit phase, coordinated to decide whether to commit or abort a transaction
Industry Applications: Despite issues like blocking and single-point failures, 2PC is used in some distributed databases and transaction management systems
Theory Overview: CAP theorem states that a distributed system cannot simultaneously guarantee Consistency, Availability, and Partition Tolerance. Trade-offs are made based on business needs
Industry Application: Distributed KV systems design around CAP trade-offs. For example, Cassandra prioritizes availability and partition tolerance over consistency, while Google’s Spanner emphasizes consistency