Thursday, December 27, 2012

Cassandra - What do you need to keep in mind when designing family columns?

Pass the timestamp with each column value. Do not use this timestamp as data in your application. Cassandra uses it internally for conflict resolution.

Super columns may have performance issues. Use composite columns.

Design your schema based on how your application would query data. Identify the frequently used ones. Always remember Cassandra is the map of maps.

De-normalize for read performance.

Use secondary indices only when the column keys are similar (Ex. Family column of User with column key Provinces; and the secondary index is on Provinces)

It is okay to store values in column keys and it is okay to leave column values to null.

Don't store something like "item description" as the column key.

Use wide rows for ordering, grouping, and filtering.

A row is not split across nodes. Cassandra allows 2 billion columns per row.

No comments:

Post a Comment