官术网_书友最值得收藏!

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:

主站蜘蛛池模板: 宣恩县| 木里| 泽库县| 沁阳市| 青海省| 余姚市| 肥城市| 儋州市| 贡觉县| 聂拉木县| 绥江县| 武功县| 陆丰市| 普陀区| 峨山| 洛浦县| 宜城市| 肥西县| 马鞍山市| 吴江市| 芷江| 济南市| 时尚| 资源县| 大同县| 大足县| 光泽县| 轮台县| 奉节县| 武功县| 读书| 陵川县| 修武县| 夏邑县| 安福县| 甘洛县| 乃东县| 南郑县| 禹城市| 永安市| 桃江县|