Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra - Understanding Rack Concept on PropertyFileSnitch example

Tags:

cassandra

I am working on multi DC deployment and one thing is not clear to me - this is the rack concept interpretation from Cassandra perspective.

I can enforce replication order by defining proper key ranges. Why do I need to specify racks additionally in cassandra-topology.properties ?

Lets take as example Cassandra documentation: http://www.datastax.com/docs/1.1/cluster_architecture/replication

If I have replication factor 3, and my row key is stored on Node 1, than replicas will be stored on Node 2 and 3 - this is obvious when we look on ring structure, so... why do I need to duplicate this information in rack configuration?

like image 632
Maciej Miklas Avatar asked Feb 19 '23 04:02

Maciej Miklas


1 Answers

The rack configuration allows cassandra to optimize replica placement so you have better fault tolerance properties. If you have all your replicas in rack 1, and that rack goes down, you'll lose the data. If you tell Cassandra about your rack configuration it will keep replicas on different racks.

like image 95
rs_atl Avatar answered May 31 '23 13:05

rs_atl