Maggie Nelson

More distributed key/value storage options

by maggie on Jul.14, 2009, under entry

CouchDB has infected me and I’ve been reading a lot about alternative ways to store data AND organize it. In the midst of options for alternatives to relational databases, these two stand out:

Cassandra – “Cassandra is a highly scalable, eventually consistent, distributed, structured key-value store. Cassandra brings together the distributed systems technologies from Dynamo and the data model from Google’s BigTable. Like Dynamo, Cassandra is eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based data model richer than typical key/value systems.”

The huge appeal of Cassandra seems to be the approach to make it highly fault-tolerant. Writes never fail. Data is always available. No single point of failure. If you’re making a Twitter-like app, you should consider it.

Tokyo Cabinet – “Tokyo Cabinet uses hash algorithm to retrieve records. If a bucket array has sufficient number of elements, the time complexity of retrieval is “O(1)”. That is, time required for retrieving a record is constant, regardless of the scale of a database. It is also the same about storing and deleting. Collision of hash values is managed by separate chaining. Data structure of the chains is binary search tree. Even if a bucket array has unusually scarce elements, the time complexity of retrieval is “O(log n)”.”

Tokyo Cabinet is slightly newer and is apparently stupidly fast, faster than any other storage solutions out there (at least for now). It’s written in C and provided as API of C, Perl, Ruby, Java, and Lua.

Do you know anyone who has used these two already? Care to share your experiences?

:, , , , , , ,
5 comments for this entry:
  1. Karl Katzke

    I haven’t used any of these yet (haven’t had a project yet that wasn’t heavily relational) but another one to add to your list is Redis. There’s more info on the differences and advantages vs. Tokyo Cabinet in the Redis README.

  2. Mikko Koppanen

    Hi,

    Tokyo Cabinet is not distributed. The network part for Tokyo Cabinet is called Tokyo Tyrant:

    http://tokyocabinet.sourceforge.net/tyrantdoc/

  3. maggie

    Hi Mikko – thank you for the clarification. I admit that I just started reading about it. :) Thanks for the Tokyo Tyrant info – I am going to read about it right now!

  4. Jonathan Ellis

    One of the things that makes Cassandra interesting is that it provides more than a generic key/value store. First, it’s really a key/ColumnFamily model, which gives you a richer data model and more efficient updates and queries. Second, it supports range queries over your keys, which is essential for many applications

    I wrote about the limitations of a strict key/value api here: http://spyced.blogspot.com/2009/05/why-you-wont-be-building-your-killer.html

  5. Mikko Koppanen

    Hi maggie,

    check out the Tokyo Tyrant extension for PHP as well. Feedback is welcome :)

    http://github.com/mkoppanen/php-tokyo_tyrant/tree/master

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Tags

RSS Planet PHP

  • Module Bootstraps in Zend Framework: Do's and Don'ts
    I see a number of questions regularly about module bootstraps in Zend Framework, and decided it was time to write a post about them finally. In Zend Framework 1.8.0, we added Zend_Application, which is intended to (a) formalize the bootstrapping process, and (b) make it re-usable. One aspect of it was to allow bootstrapping of individ […]
    Matthew Weier O'Phinney
  • Webinar - New in Zend Framework 1.10!
    Zend Framework 1.10 sports a ton of new features, as well as completely revamped online documentation. In this webinar, Matthew Weier O’Phinney, Framework Project Lead, and Ralph Schindler, Zend Framework Software Engineer, will present a synopsis of the new features, discuss the new online documentation system and how it’s built, and answer your questions a […]
    Zend Developer Zone
  • ConFoo PHP 5.3 == Awesome! Slides
    Finally managed to upload my slides from my ConFoo PHP 5.3 == Awesome! talk. Slides Thanks for all the attendees, especially those who asked questions […]
    Ilia Alshanetsky
  • ConFoo PHP 5.3 == Awesome! Slides
    Finally managed to upload my slides from my ConFoo PHP 5.3 == Awesome! talk. Slides Thanks for all the attendees, especially those who asked questions […]
    Ilia Alshanetsky
  • Slides from my Confoo.ca talk now online
    I’ve just uploaded the slides from my confoo.ca talk “Making software management tools work for you”. You can download the slides from here. Thanks again to everyone who attended! Please give me feedback on joind.in. […]
    John Mertic