advanced
Fault-Tolerant Distributed Key-Value Store
Design a linearizable, distributed key-value store focusing on consensus and partition tolerance.
📝 محتوى الأمر
Design a distributed, fault-tolerant key-value store that guarantees strict linearizability. In your response, detail the choice of consensus algorithm (e.g., Raft, Paxos, or Zab) and justify your selection. Explain how the system handles network partitions (CAP theorem trade-offs) and the recovery process once the partition heals. Describe the sharding strategy used to ensure scalability and the mechanism for data replication across nodes. Include pseudocode or a flowchart illustrating the leader election process and log replication mechanism.