I want to try out Cassandra Cluster. My main question is about scalability.

Every node in a Cassandra cluster has the same copy of data. So when I have in total 1 TB and have 5 nodes -> 5TB.

This at some point will get huge. How do I scale Cassandra so that the storage can be distributed? Do I need to shard manually then again?


The data is automatically distributed in the cluster based on the value of the partition key of your tables. So you need to take care about creating correct data model - don't have the partitions that have hundred thousands of rows, etc.

If the data model is correct, then you can scale Cassandra by just adding the new nodes, and then data will be redistributed between nodes.

| improve this answer | |
  • But I thought every node in a cassandra cluster has the same value - that makes it also robust and scale. – Fabian Lurz Jul 13 '18 at 6:32
  • Yes, it doesn't contradict to what I written about... You model your data as tables with partition keys, the value in this column is hashed, and node(s) are selected to hold data for this value of partition key. As you add new nodes, the data is redistributed between nodes – Alex Ott Jul 13 '18 at 6:35
  • Ok sorry for the stupid questions. So that means that each node of a cassandra holds exactly the same data - but upon read/write it will get decided by the partition key where to read/write -> after a successful write gossip protocols copys the data again to all other cassandra nodes. Is that correct? – Fabian Lurz Jul 13 '18 at 6:40
  • Not really - how data is distributed is decided when you write the data (based on the replication factor). When you read, you know what nodes are holding the replicas for given partition key, and reach them. I recommend to look to this architecture guide: docs.datastax.com/en/dse/6.0/dse-arch – Alex Ott Jul 13 '18 at 6:44
  • 1
    yes, something like... – Alex Ott Jul 13 '18 at 8:44

Cassandra does store its data in distributed fashion among the cluster nodes, using the murmur3partitioner(your 1 tb will be distributed 0.2 tb on each node). If you don't want your 1 tb data to become 5 tb change the replication factor from 5 to a desired lower value and run nodetool cleanup on all nodes.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.