cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juho Mäkinen <>
Subject Re: Indexing&Locking in Cassandra
Date Thu, 16 Sep 2010 13:24:58 GMT

> I have a few questions about indexing and locking in Cassandra:
> - if I understood well only row level indexing exists prior to v0.7. I mean only the
primary keys are indexed. Is that true?

Yes and no. The row name is the key which you use to fetch the row
from cassandra. There are methods to iterate thru rows but that's not
efficient and should be used only in batch operations. Columns inside
rows are sorted by their names so they are also indexes as you use the
column name to fetch the contents of the column. If you want to index
data by other ways you need to build your own application code which
maintains such indexes and the upcoming 0.7 version will bring some
handy features which makes the coders job much easier.

> - is it possible to use composite primary keys? For instance I have a user object: User(name,birthday,gender,address)
and I want to have the (name,birthday) columns as PK. Can I do? If yes, how?

You can always create your row key as a string like "$name_$birthday".
Did this answer to your question?

> - does Cassandra support CF (table) level locking? Couls someone explain me/provide a
link how?

No, cassandra doesn't have any locking capabilities. You can always
use some external locking mechanism like zookeeper
[] or implement your own sollution
on top of cassandra (not recommended as it's quite hard to get it

 - Juho Mäkinen / Garo

View raw message