janetsmith
janetsmith

Reputation: 8732

How to fix data anomalies in Cassandra?

To gain read performance, data model in Cassandra are denormalized to certain extend.

As denormalized produces duplicated record, how to avoid data anomalies?

Upvotes: 0

Views: 306

Answers (2)

jbellis
jbellis

Reputation: 19377

jsfeng's answer is good on general principles, but a more specific answer is to use atomic batches: www.datastax.com/dev/blog/atomic-batches-in-cassandra-1-2

Upvotes: 1

jsfeng
jsfeng

Reputation: 11

As I know, there could be 2 ways to keep your data in different column family(CF) consistent:

  1. Whenever you update row/column value in one CF, also update the corresponding row/column in other CF.
  2. Run some background batch process to reconcile column values to make them consistent.

Which way you want to use, that may depends on how you did you model your data, and how strict is your application's requirement for data consistency among different CF.

Upvotes: 1

Related Questions