cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremiah Jordan" <>
Subject RE: Appending to fields
Date Wed, 01 Jun 2011 17:10:47 GMT
Cassandra handles this by using a different design, you don't append
anything.  You use the fact that in Cassandra you have dynamic columns
and you make a new column every time you want to put more data in.  Then
when you do finally need to read the data out you read out a slice of
columns, not just one column.


-----Original Message-----
From: Marcus Bointon [] 
Sent: Tuesday, May 31, 2011 2:23 PM
Subject: Appending to fields

I'm wondering how cassandra implements appending values to fields. Since
(so the docs tell me) there's not really any such thing such thing as an
update in Cassandra, I wonder if it falls into the same trap as MySQL
does. With a query like "update x set y = concat(y, 'a') where id = 1",
mysql reads the entire value of y, appends the data, then writes the
whole thing back, which unfortunately is an O(n^2) operation. The
situation I'm doing this in involves what amount to log files on
hundreds of thousands of items, many of which might need updating at
once, so they're all simple appends, but it becomes unusably slow very
quickly. In MySQL it's just a plain bug as it could optimise this by
appending data at a known offset and then bumping up the field length
counter, which is back in at least O(n) territory. Does cassandra's
design avoid this problem?


View raw message