Friday, February 19. 2010Zookeeper for web developers
Have you ever developed any kind of distributed system? When doing so for the first time, you're very likely to fall in the trap of the Fallacies of Distributed Computing. I've done so, you'll do so too.
Now zookeeper is an application, that helps you implement many distributed protocols on top of it. The hard work of implementing fault tolerance, assuring consistency and that kind of stuff is done by zookeeper in the background. A zookeeper cluster consists of at least three servers running zookeeper (zk). A client can connect to each zk server and issue read and write requests. Zookeeper guaranties that a write either fails or is consistent and that a read will get you the most recent state.
Zookeeper exposes a filesystem like hierarchy of so called znodes. Every znode can have children but also stores data. The data stored in a znode is assumed to be small (less then 1MB). Clients can subscribe to different events on a znode and will be notified of changes in the znode itself of it's children. Some usage examples come to my mind, which could be especially interesting for PHP developers:
Companies that use zk include Facebook, Yahoo, Rackspace and as rumors tell also twitter. Now this is all kind and sweet, the only sad thing is, there's no PHP binding yet. There are bindings for Java, C, Python and Perl. So if you're desperately searching what PHP extension you should write next, just take the zk C binding and expose it to PHP! Maybe you're a student and would like to participate in the Google Summer of Code? It should be possible to find a mentor for this project either in the PHP or zk project. For GSOC the project could include a PHP session implementation in the extension code and the possibility of persistent zk sessions across PHP calls. If you're in the region of eastern Switzerland: There'll be a presentation about zookeeper at the Webtreff Kreuzlingen on one of the next mondays. Trackbacks
No Trackbacks
Comments
There is a PHP extension. I released it a couple of months ago on Github.
http://madfermentationist.blogspot.com/
Shame on me. I've not even searched for it. Here's the github repo:
github.com/andreiz/php-zookeeper Thank you Andrei!
Also up on PECL btw:
http://pecl.php.net/package/zookeeper |