cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben McCann <>
Subject How to store a list of values?
Date Mon, 26 Mar 2012 07:04:57 GMT
I have a profile column family and want to store a list of skills in each
profile.  In BigTable I could store a Protocol
a repeated field, but I'm not sure how this is typically accomplished
in Cassandra.  One option would be to store a serialized
Thrift<>or protobuf, but I'd prefer not to do
this as I believe Cassandra doesn't
have knowledge of these formats, and so the data in the datastore would not
not human readable in CQL queries from the command line.  The other
solution I thought of would be to use a super column and put a random UUID
as the key for each skill:

skills: {
  '4b27c2b3ac48e8df': 'java',
  '84bf94ea7bc92018': 'c++',
  '9103b9a93ce9d18': 'cobol'

Is this a good way of handling lists in Cassandra?  I imagine there's some
idiom I'm not aware of.  I'm using the
Astyanax<>client library,
which only supports composite columns instead of super
columns, and so the solution I proposed above would seem quite awkward in
that case.  Though I'm still having some trouble understanding composite
columns as they seem not to be completely documented yet.  Would this
solution work with composite columns?


View raw message