You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sean Ochoa <se...@gmail.com> on 2011/02/05 19:16:22 UTC

row keys

Hey all.

I'm using Pycassa to insert some spatial data into Cassandra.  Here's where
I am on the tutorial:
http://pycassa.github.com/pycassa/tutorial.html#inserting-data  And, I'm not
quite understanding where row-keys come from.  What mind-set should I have
when I generate them for the values that are being inserted?

Oh, and a note about the values that I'm inserting:  I've got an object
identifier, time-stamp, lat, and long.

 - Sean

Re: row keys

Posted by Stephen Connolly <st...@gmail.com>.
you really need to know how you will be pulling the data back out again. you
could use the object id as the row key, timestamp as the column name and
long/lat as the value... that would allow you to query by object is and get
the time sorted location trace... but if you have a lot of frequent readings
for each object, that would be a poor model because very large rows can
impact performance... in that case you might use the object id combined with
the timestamp rounded to the nearest hour (say) to keep the row size
lower...

but if you are more interested in tracking multiple objects per time, you
might use the timestamp as row key, object id as column name, etc...

with cassandra you need to know what queries you will want to make and
design for that

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 5 Feb 2011 18:17, "Sean Ochoa" <se...@gmail.com> wrote: