Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PyCon Ireland 2013: Taming Pythons with ZooKeeper

PyCon Ireland 2013: Taming Pythons with ZooKeeper

(via http://python.ie/pycon/2013/talks/taming_pythons_with_zookeeper/)
Speaker: Jyrki Pulliainen (http://twitter.com/nailor)

Concurrency is hard. Consistency in distributed systems is hard. And then the whole thing should be highly-available and error resilient.

Fear not, there are good news: There exists an awesome tool called ZooKeeper to help you with this. There even exists a plethora of Python libraries for it, but how to know what to ues and how?

This talk will walk you through ZooKeeper and how to use it Python. We'll be focusing on what I think is the most prominient ZooKeeper library out there for Python: Kazoo.

You'll see how to do things in ZooKeeper and how to implement them using Kazoo. We'll also peek in to the recipes Kazoo offers, and if we have enough time, touch a real life application we've used Kazoo and ZooKeeper to build at Spotify.

PyCon Ireland

October 13, 2013
Tweet

More Decks by PyCon Ireland

Other Decks in Technology

Transcript

  1. *

  2. *

  3. October 7, 2013 Seven for the pythonistas gevent-zookeeper zkpython zc.zk

    pykeeper twitter’s zookeeper library zoop txzookeeper
  4. First we need to connect! Text Text zk = KazooClient(hosts='127.0.0.1:2181/namespace,127.0.0.2:2181')

    Text zk = KazooClient(hosts='127.0.0.1:2181,127.0.0.2:2181') from kazoo.client import KazooClient zk = KazooClient(hosts='127.0.0.1:2181') zk.start() # ... zk.stop()
  5. *

  6. from kazoo.recipe.watchers import DataWatch, ChildWatch @DataWatch('/path/to/node') def data_callback(data, stat): #

    ... do_something @ChildWatch('/path/to/node') def child_callback(children): # ... do_something