Thursday, December 27, 2012

From Relational Database to Cassandra

The following is an analogy to introduce Cassandra to people with relational database background. The left side is the Cassandra model; the right side is the relational model.
Keyspace - Database
Column Family - Table
Row Key - Primary key
Column key - Column name
Column value - Column value

However, when designing Cassandra keyspace schema, it's better to think of Cassanda column families as a map of a map:
Map < RowKey, SortedMap < ColumnKey, ColumnValue > >
Super column groups columns, turning the two nested maps into three nested map.
Map < RowKey, SortedMap < ColumnKey,
SortedMap < ColumnKey, ColumnValue> > >

No comments:

Post a Comment