Database Reference
In-Depth Information
Figure6-3.The Network Topology Strategy places some replicas in another data center and the re-
mainder in other racks in the first data center, as specified
Replication Factor
The replication factor specifies how many copies of each piece of data will be stored and distrib-
uted throughout the Cassandra cluster. It is specified by the replication_factor setting.
It may seem intuitive that the more nodes you have in your cluster, the more you want to increase
the replication factor. However, you don't want to follow this rule of thumb alone; instead, in-
crease the replication factor in order to satisfy your required service level.
With a replication factor of one, your data will exist only in a single node in the cluster. Losing
that node means that data becomes unavailable. It also means that Cassandra will have to do
more work as coordinator among nodes; if all the data for a given key is on node B, every client
request for that key that enters through node A will need to be forwarded.
You must not set this value higher than the number of nodes in your cluster, as this wouldn't
make any sense. But you also don't want to use this setting to tune Cassandra. Cassandra will
achieve high consistency when the read replica count plus the write replica count is greater than
the replication factor.
So if you have 10 nodes in your cluster, you couldset the replication factor to 10 as the max-
imum. But you might not want to do that, as it robs Cassandra of what it's good at and stymies
its availability, because if a single node goes down, you won't be able to have high consistency.
Instead, set the replication factor to a reasonable number and then tune the consistency level up
or down. The consistency level never allows you to write to more than the number of nodes spe-
cified by the replication factor. A “reasonable number” here is probably fairly low. ONE seems
like the lowest number; however, ANY is similar to ONE but even less consistent, since you might
Search WWH ::




Custom Search