Database Reference
In-Depth Information
generally not recommended to set a replication factor of 2 if you have
fewer than four nodes in a data center.
Three replicas per data center. If a single node in a replica set fails,
reads that were requested with a consistency level of LOCAL_QUORUM
will still succeed. It is generally not recommended to set a replication
factor of 3 if you have fewer than six nodes in a data center.
There is also a setup that is generally termed “asymmetrical replication.” This
means that the number of replicas in one data center does not match the number
of replicas in the other data centers. There are some very good use cases for this.
For instance, if you do the majority of your reads in datacenter1 and the major-
ity of your writes in datacenter2, having more nodes in datacenter1 to reduce read
latency may be a good strategy. Another good use case would be if you have a
single data center that acts as an analytics data center, using a technology such as
Hadoop. This data center would have drastically different read and write patterns
from the other data centers and could be configured accordingly.
Snitches
The first and most obvious question here is what is a snitch? A snitch is simply a
protocol that helps map IPs to racks and data centers. In other words, it creates a
topology by grouping nodes together to help determine where data is read from.
As an aside, there is no need to use a snitch for writes. Writes function by being
sent to the receiving node and then the receiving node blocks until the consistency
level for that write operation has been met.
When a read request to Cassandra happens, the requesting application asks only
one node, the coordinator node. The consistency level of the read request and the
read_repair_chance for that ColumnFamily decide how the snitch steps in.
Ultimately, only one node will send back the requested data. It is up to the snitch
to determine, typically based on historical performance, which node or nodes that
will be.
There are a few different possible snitches that can be used with Cassandra, and
each comes with its pros and cons. We will discuss what each snitch is and what is
a good use case for the snitch. It should be noted that a snitch has an effect only on
the way Cassandra talks to itself. It has no bearing on client applications and their
communication with Cassandra.
Snitches are configured in your cassandra.yaml file. It is extremely important
to remember that all nodes in a cluster must use the same snitch. If you want to
Search WWH ::




Custom Search