0
votes

I am learning cassandra 2.0

As per Documentation cassandra distributes column family data across nodes(in cluster) based on primary key using hashing. But If my column family does not have any primary key, then how cassandra will distribute column family data accross node?

1
If you are coming from the Relational Database world, thinking of the primary key as a composite of columns that uniquely identify a 'partition' (loosely equals table) will help. If your data does not have uniqueness at the row level, why store the same row twice?Nathan

1 Answers

6
votes

All Cassandra tables (column families) must have a primary key.

Quoth the CQL3 documentation:

Within a table, a row is uniquely identified by its PRIMARY KEY (or more simply the key), and hence all table definitions must define a PRIMARY KEY (and only one)