cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Heller <>
Subject Learning-by-doing (also announcing a new Ruby Client Codename: "Greek Architect")
Date Sat, 19 Jun 2010 01:27:07 GMT

So, last week I finally got around to playing with Cassandra. After a
while I understood the basics. To test this assumption I started
working on my own Client implementation since "Learning-by-doing" is
what I do and existing Ruby Clients (which are awesome) already
abstracted too much for me to really grasp what was going on. Java is
not really my thing (anymore) so I began with the Thrift API and Ruby.

Anyways back to Topic.

This library is now is available at:

Since I have virtually no experience with Cassandra (but plenty with
SQL) I started with the first use-case which I have programmed a bunch
of times before. User Management. I build websites which are used by
other people, so I need to store them somewhere.

Step #1: Creating Users and persisting them in Cassandra

Example here:

I hope my rspec-style documentation doesnt confuse too many people
since I already have a gazillion questions for this simple, but also
VERY common use-case. Since a question is best asked with a concrete
example to refer to, here goes my first one:

Would any of you veterans build what I built the way I did? (refering
to the cassandra design, not the ruby client)

I insert Users with UUID keys into one ColumnFamily. I then index them
by creating a row in another ColumnFamily using the Name as Key and
then adding one column holding a reference to the User UUID. I also
insert a reference into another ColumnFamily holding a List of Users
partitioned by Date.

I'm really unsure about the index design, since they dont get updated
when a User row is removed. I could hook into the remove call (like I
did into mutations) and cascade the deletes where needed, but 10+
years of SQL always want to tell me I'm crazy for doing this stuff!

I'd really appreciate some feedback.


View raw message