Every modern distributed database needs consensus: a way to make a cluster of servers agree on the same sequence of operations even when some servers crash or messages are lost. The classic answer is Paxos — but classic Paxos has a catch.
In Paxos, one server plays the role of leader. Every command, no matter where it originates, must pass through that leader, who assigns it a global slot number. The leader becomes a funnel: all writes queue up behind it, and if the leader is far away your latency pays the price of an extra network round-trip.
EPaxos — Egalitarian Paxos — was published by Iulian Moraru, David G. Andersen, and Michael Kaminsky at SOSP 2013. Its central insight is deceptively simple: two commands only need to be ordered relative to each other if they conflict. Commands that read and write different keys can execute in any order and produce the same result — they commute. If two commands commute, there is nothing to agree on between them, and each can be committed independently at any replica, with no single bottleneck.
Where classic Paxos imposes a total order on all commands, EPaxos builds a dependency graph: each command records which other in-flight commands it conflicts with, and replicas execute them in a topological sort of that graph. Commands that never share a conflict edge are free to race ahead.
Comments
Loading comments...