0

Spanner's TrueTime API claims to be necessary for strong consistency and very high availability is achieved. I wonder if the same level of consistency and availability can be achieved using Raft(w/o atomic clock which is not practical for most of us)?

The idea is to implement each split(shard) by a Raft cluster. Spanner and Raft's write protocols are almost the same(coordinated by the leader and use locks). In Spanner, reads are handled by replicas. Replicas contact leader to verify its last commit timestamp is as updated as the leader, so no stale data is returned. Raft can do this too by verifying that the follower's last commit log index is the same as the leader.

I suppose the performance will be similar. Did I miss anything?

Useme Alehosaini
  • 2,998
  • 6
  • 18
  • 26
luanjunyi
  • 1,634
  • 1
  • 15
  • 17
  • Could you please include what have you done? – Soni Sol Nov 16 '20 at 23:52
  • Have you looked at [CockroachDB](https://github.com/cockroachdb/cockroach)? That sounds roughly what they do (albeit with _some_ time-based synchronization to speed some things up). – ariels Apr 01 '21 at 20:45
  • Also [yugabytedb](https://www.yugabyte.com/tech/raft-consensus-algorithm/) - similar to cockroachdb, uses raft for the same purpose. – Sumit S Apr 12 '23 at 15:44

0 Answers0