Mechanics of Flite - How to do an upsert in Cassandra
In a recent post I talked about how to do an upsert in MySQL. Doing an upsert in Cassandra 1.2 using CQL 3 is more straightforward. Why? Because in Cassandra every INSERT
(and every UPDATE
) is actually an upsert. Cassandra is a distributed database that avoids reading before a write, so an INSERT
or UPDATE
sets the column values you specify regardless of whether the row already exists. This means inserts can update existing rows, and updates can create new rows. It also means it's easy to accidentally overwrite existing data, so keep that in mind.
Read full article from Mechanics of Flite - How to do an upsert in Cassandra
No comments:
Post a Comment