- 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:
- Dreamweaver CS3 Ajax網頁設計入門與實例詳解
- 21天學通JavaScript
- 我的J2EE成功之路
- 軟件架構設計
- R Data Mining
- 傳感器技術實驗教程
- 極簡AI入門:一本書讀懂人工智能思維與應用
- 影視后期制作(Avid Media Composer 5.0)
- OpenStack Cloud Computing Cookbook
- Blender 3D Printing by Example
- Hands-On Reactive Programming with Reactor
- FPGA/CPLD應用技術(Verilog語言版)
- 強化學習
- 工業機器人力覺視覺控制高級應用
- Hands-On Deep Learning with Go