Disaster tolerance with Apache Cassandra
Adjusting Consistency
Although Cassandra prioritizes around availability at moments of network failure, it does include options for enhancing consistency in normal operations. For each query in an application, you can select a consistency level: Any
, One
(Two
, Three
), Quorum
, or All
. Then a special rule is applied for the query, which is only considered fulfilled if the specified number of nodes confirm the write operation or give the same answer to a read query. The more answers, the more consistency, but the price of pursuing a high level of consistency is a certain loss of performance, because several nodes need to react. High consistency also weakens availability. Configuring your Cassandra system for high consistency tends to push it toward the CP end of the CAP diagram (refer to Figure 1). For example, an update with the consistency level of All
can be written to the cluster in which three of the replication nodes store the data (Replication Factor: 3
). If a node does not respond, the procedure is stopped and an exception is thrown. The most commonly used consistency level for important operations is Quorum
. Accordingly, the write is considered successful if 50 percent +1 nodes confirm the write operation.
Conclusions
Cassandra is too complex for a typical small to medium-sized project. However, companies that don't want to keep data on a single server, need geographic distribution, and are looking for the highest possible availability would do well to consider the Cassandra option. Apache Cassandra is an excellent tool for companies that wish to quickly create distributed, disaster-tolerant systems.
« Previous 1 2
Buy this article as PDF
(incl. VAT)