danchia / ddb

Apache License 2.0
128 stars 28 forks source link

Replication using CURP simply better than with Paxos or Raft #2

Open dumblob opened 5 years ago

dumblob commented 5 years ago

I can see Replicate vs Paxos or Raft in the roadmap, but I think it's overkill for replication as there seems to be an easier and faster way to accomplish that - see CURP (Consistent Unordered Replication Protocol).

What Paxos or Raft is good for is distributed transactions in a sharded environment (aka horizontal partitioning). In this case there is currently no known way how to do it more efficiently than using Paxos or Raft for updating a distributed ledger keeping the information about success or failure of such transaction (see FaunaDB as tested by Jepsen).

publicocean0 commented 5 years ago

Normally a db is designed for clustering mode too, so probably using Raft you can sodisfy either replication either distributed transactions in a same consensus strategy no? else you have to use 2 different sockets for 2 different strategies. Anyway is there a curp library for java or golang? Maybe the better solution would be create a library with raft and curp in the same socket permitting 2 protocols in the same socket

dumblob commented 5 years ago

Normally a db is designed for clustering mode too, so probably using Raft you can sodisfy either replication either distributed transactions in a same consensus strategy no? else you have to use 2 different sockets for 2 different strategies.

I'm not sure if I understand correctly. CURP solves (very efficiently and simply) the failover scenario of one or more nodes (i.e. replication). Whereas Raft/Paxos solves a distributed transaction synchronization issue (i.e. sharding at the presence of transactions). Both technologies solve a different thing, thus being complementary and can be therefore used simultaneously (yes, you could use Raft/Paxos also for replication, but it's highly inefficient). Note also, that CURP is easy to implement compared to Raft/Paxos.

Anyway is there a curp library for java or golang?

Currently I don't know of any :cry:.