cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject schema example
Date Tue, 19 May 2009 03:19:17 GMT
Does anyone have a simple app schema they can share?

I can't share the one for our main app.  But we do need an example
here.  A real one would be nice if we can find one.

I checked App Engine.  They don't have a whole lot of examples either.
 They do have a really simple one:
http://code.google.com/appengine/docs/python/gettingstarted/usingdatastore.html

The most important thing in Cassandra modeling is choosing a good key,
since that is what most of your lookups will be by.  Keys are also how
Cassandra scales -- Cassandra can handle effectively infinite keys
(given enough nodes obviously) but only thousands to millions of
columns per key/CF (depending on what API calls you use -- Jun is
adding one now that does not deseriailze everything in the whole CF
into memory.  The rest will need to follow this model eventually too).

For this guestbook I think the choice is obvious: use the name as the
key, and have a single simple CF for the messages.  Each column will
be a message (you can even use the mandatory timestamp field as part
of your user-visible data.  win!).  You get the list (or page) of
users with get_key_range and then their messages with get_slice.

<ColumnFamily ColumnSort="Name" Name="Message"/>

Anyone got another one for pedagogical purposes?

-Jonathan

Mime
View raw message