[zeromq-dev] Paxos Consensus over ZeroMQ

Tom Cocagne tom.cocagne at gmail.com
Mon Mar 25 22:11:34 CET 2013


Paxos provides a primitive for distributed programming that somewhat
akin to Compare-And-Swap for multi-threading. It's a little difficult
to provide specific examples as it's typically just a detail in how
you implement higher-level concepts. That said though, a few things
come to mind.

For each of the items listed below, the key benefits of using Paxos
are consistency and service availability in the presence of node
failures.

* A Master-Master version of the Clone pattern mentioned in the guide.
A pool of peer servers could coordinate updates to a single, shared
key-value store.

* Distributed Locking. A pool of servers could be used to allocate and
free locks for shared resources.

* Maintenance of global configuration data.

* Leader election.

Pretty much anything  you might use Zookeeper for can be accomplished
with Paxos. In fact, I first started looking into Paxos because I had
a few use cases for which setting up a separate Zookeeper installation
wasn't going to be practical.

There are some definite tradeoffs to be considered when using it but
it's a good tool to have on the shelf.

Tom


On Sat, Mar 23, 2013 at 2:02 AM, Pieter Hintjens <ph at imatix.com> wrote:
> Hi Tom,
>
> Do you have any examples where Paxos would solve problems faced by
> developers using 0MQ?
>
> -Pieter
>
> On Sat, Mar 23, 2013 at 7:24 AM, Tom Cocagne <tom.cocagne at gmail.com> wrote:
>> At a meetup just short of a year ago I was asked to post to the list
>> about a Paxos over ZeroMQ side project I'd been working on. At the
>> time, the implementation was roughly alpha quality and the code wasn't
>> particularly clean but it seemed to be fairly well received. For those
>> that are still interested, I'm pleased to say that the project is now
>> pretty much complete. All of the major functionality is in place, the
>> code has been cleaned up, and the documentation is in decent shape.
>>
>> All of the other open-source Paxos implementations I've found are
>> either horribly over-complicated or they inextricably commingle their
>> application-specific logic with their handling of the Paxos algorithm.
>> While trying to get up to speed on Paxos, I never did find a good,
>> clean example of it's implementation and use. For that reason, I made
>> a special effort to gear this implementation specifically for clarity
>> and ease of understanding. The project is split into two separate
>> repositories. One implements the bare Paxos algorithm
>> (https://github.com/cocagne/paxos) and the other uses it on top of
>> ZeroMQ (https://github.com/cocagne/zpax). Beyond being just generally
>> useful libraries, I'm hoping these implementations will serve as
>> approachable examples for others interested in the topic.
>>
>> Tom
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list