Hacker News new | past | comments | ask | show | jobs | submit login

> if you simply use the equivalent of basic (single-decree) paxos per key, the writes can be leaderless

Is there any writes acknowledgements in what you describe when replication factor > 1?

How do you ensure that I always read the last written value to the same key?




Both reads and writes go through the basic paxos protocol, so the answer to both is yes.


I've never taken the time to really learn paxos in depth, so forgive my ignorance.

I'm not sure that leaderless mode with basic paxos would be really better in the K/V scenario we're talking about.

There would be a lot of round-trips for each request, so there's higher latency than the raft counterpart, especially for reads. I suppose better availability in the case of node outages would be one advantage.

Anything else I miss?


Nope; latency would be about the same, since it requires two rounds for consensus for all ops. Note that Raft itself has no clue about the specifics of the op, whether it is a read or a write, and for leader to be sure it is still the leader, it needs to wait for an answer from a majority of servers. Of course, this is not done for every single op, but batched. Similar methods will have to be used for my suggestion as well.

Now, in many production cases, one tends to put a lease on leader election. Until the lease is valid, the leader is guaranteed that it is still the leader and no one else has a more up to date state. This allows reads to be served from the leader's state machine without having to touch Raft at all.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: