- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 326字
- 2021-07-03 00:19:22
High availability
The simplest database deployments are run as a single instance on a single server. This sort of configuration is highly vulnerable to interruption: if the server is affected by a hardware failure or network connection outage, the application's ability to read and write data is completely lost until the server is restored. If the failure is catastrophic, the data on that server might be lost completely.
Master-slave architectures improve this picture a bit. The master instance receives all write operations, and then these operations are replicated to follower instances. The application can read data from the master or any of the follower instances, so a single host becoming unavailable will not prevent the application from continuing to read the data. A failure of the master, however, will still prevent the application from performing any write operations, so while this configuration provides high read availability, it doesn't completely provide high availability.
Cassandra, on the other hand, has no single point of failure for reading or writing data. Each piece of data is replicated to multiple nodes, but none of these nodes holds the authoritative master copy. All the nodes in a Cassandra cluster are peers without a master node. If a machine becomes unavailable, Cassandra will continue writing data to the other nodes that share data with that machine and will queue the operations and update the failed node when it rejoins the cluster. This means that in a typical configuration, multiple nodes must fail simultaneously for there to be any application - visible interruption in Cassandra's availability.
How many copies?
When you create a keyspace, Cassandra's version of a database, you specify how many copies of each piece of data should be stored; this is called the replication factor. A replication factor of 3 is a common choice for most use cases.
The image below perfectly illustrates high availability in Cassandra. Clients reconnect to different node in case a node is down:
- 大數據技術與應用基礎
- Project 2007項目管理實用詳解
- Dreamweaver CS3網頁設計與網站建設詳解
- 機器自動化控制器原理與應用
- Docker High Performance(Second Edition)
- 基于32位ColdFire構建嵌入式系統
- 網絡化分布式系統預測控制
- Learn CloudFormation
- 中國戰略性新興產業研究與發展·工業機器人
- Salesforce for Beginners
- Deep Learning Essentials
- Windows 7來了
- Oracle 11g基礎與提高
- 百度智能小程序:AI賦能新機遇
- Network Science with Python and NetworkX Quick Start Guide