Skip to content
A simple HTTP based write though key value cache built on top of Zookeeper.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

A simple HTTP based write though key value cache built on top of Zookeeper.


This was a chance for me to write a "real world" Clojure project and experiment with Zookeeper watches. Though I don't recomend using this in production, you're welcome to use it for reference. Keep in mind that:

  • zookeeper-clj hasn't had any activity for years. (It seems stable though!)
  • I don't handle many edge cases that you'd normally want to handle in production.
  • I don't know Clojure best practices. (This is the most complex thing I've written in Clojure!)

File Structure

  • core.clj parses command line args, connects to Zookeeper and starts an HTTP server.
  • app.clj defines HTTP handlers for interacting with the cache.
  • zookeeper.clj defines the state object of the cache and connection, key value interfaces with Zookeeper, and async cache updates using Zookeeper watches.
  • core_test.clj contains tests and test helpers.


$ zookeyper --help
Usage: zookeyper <options>
  -p, --port PORT       3333            Listen port number
  -z, --zk-hosts HOSTS  Zookeeper comma separated hosts
  -h, --help


$ ./zk/ # Start a local Zookeeper.
$ lein test     # Run the test suite.
...             # Do some development.
$ ./zk/  # Stop the local Zookeeper.
You can’t perform that action at this time.