Maggie Nelson

databases and code goodness

  • Author: maggie
  • Published: Jul 14th, 2009
  • Category: entry
  • Comments: 5

More distributed key/value storage options

Tags: , , , , , , ,

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?

Tags: , , , , , , ,

5 Responses to “More distributed key/value storage options”


  1. Karl Katzke
    on Jul 14th, 2009
    @ 10:48 am

    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
    on Jul 14th, 2009
    @ 12:25 pm

    Hi,

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

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


  3. maggie
    on Jul 14th, 2009
    @ 1:15 pm

    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
    on Jul 14th, 2009
    @ 1:54 pm

    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
    on Jul 14th, 2009
    @ 2:02 pm

    Hi maggie,

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

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

© 2010 Maggie Nelson. All Rights Reserved.

This blog is powered by the Wordpress platform and beach rentals.