Sep 20 2009

Announcing Ottoman

As promised

Ottoman is a lightweight, reliable key-value store with multi-version concurrency control.

A key-value store is a persistent on-disk dictionary that maps arbitrary keys (usually short text strings) to arbitrary values (binary data of any length). There’s already a large and venerable family of libraries that do this, often referred to by the name “db”. Notable members include dbm, Berkeley DB, cdb and Tokyo Cabinet. What makes Ottoman different?

  1. It tries to provide extremely reliable storage, immune to file corruption caused by operating system crashes or power failure while writing.
  2. It stores past versions of the database, as a useful side-effect of the way it works. Applications can use this to provide features like snapshots, timelines or persistent undo. (You can prune old versions, for space or privacy reasons, by writing a fresh copy of the file.)
  3. It has very low memory overhead. The file and its contents are memory-mapped, so even large values can be accessed without having to copy them into the heap. (Opening a database only mallocs a few hundred bytes!)
  4. It allows concurrent read/write access by multiple processes. Optimistic concurrency — as used by version-control systems like Subversion — keeps file locking to a minimum: readers are //never// blocked at all, and writers are only blocked briefly (clients can’t lock the database for arbitrary periods, only for as long as it takes the accumulated changes to be written to disk.)

Why is it named after a footstool? First, as an homage to CouchDB. Secondly, it turns out ottomans can be used for storage. Third, because I have a mild fascination with Asian and Islamic history.

_…Read more at the project home page!_


7 Responses to “Announcing Ottoman”

  • dete Says:

    You sir, are a credit to the community.

    Hope I get some time to dig into this soon; could be just the ticket for some stuff we’re working on…

    • jens Says:

      Cool! Let me know if you use it for anything. It’s been a tough slog finishing up this release (against my ADD tendency to wander off and play with the next shiny thing that shows up) and having actual users will improve my motivation :-)

  • natevw Says:

    If this is to CouchDB what SQLite is to MySQL, then you have written step 1 of an upcoming idea/project for me! I’m grabbing the source now; thanks for sharing.

    • jens Says:

      You’re a mind reader, nate! I was just thinking of that exact analogy this morning, although in all honesty, Ottoman is still muchmuchmuch more basic than sqlite. It’s more like sqlite’s internal B-tree API, in that it’s a single table with a single key. (And of course, Ottoman has no sorting yet.)

  • Jon Pugh Says:

    Dude, hook it up to the Script Editor and you’ll have Frontier!

  • ric Says:

    This is really interesting. I hope I get some time to work through this. Thanks so much. Wish me luck!