Weighted voting

from Wikipedia, the free encyclopedia

The weighted voting ( latin quorum Consensus ) is a method that the data integrity on replicated databases is to ensure. In systems that consist of a large number of units, a way must be found to read and write data from them in a faulty environment . This should also ensure tolerance for unit failures without endangering the consistency of the data.

Procedure

Robustness against failures of individual nodes ( network element ) and consistency of the data are required .

The quorum consensus procedure can not only deal with the failure of individual nodes, but also guarantee consistency when the network breaks down into individual, independent partitions. It is important that when several partitions are created in the network, which can occur due to communication errors, only one partition makes changes to the data.

A quorum is used for this purpose. Nodes that belong to a partition are only allowed to operate if they have quorum. In the simple case, this is the majority (half of the members + one node), but can also be achieved by weighting the individual members.

Write quorum (WT = 3) and read quorum (RT = 3) when accessing a data element

Each node of the system is given a weight and consists of a so-called read quorum RT and a write quorum WT , which must be fulfilled when accessing. In addition, a version number is introduced that is updated when writing and also read out when reading.

The following must apply for setting RT and WT :

  • , only with a majority will be written
such as
  • , at least one current version is found when reading

When writing a date, the sum of the weights of the nodes described must reach the writing equorum. This means that updates are only made in the case of a majority and only one partition can make changes, the consistency of the database is maintained. The nodes participating in the quorum are updated, other nodes keep their old value.

The read quorum must be achieved when reading, so several nodes are generally read. Different versions can be read, but the quorum guarantees that at least one current version is included. This is used.

properties

The choice of RT and WT offers flexibility. This allows the speed or priority of reading and writing to be set in a database system (small RT for fast reading, small WT for fast writing).

Thus, with a weight of 1 for each node and the updating of all nodes when writing and reading only one node can be modeled ( ROWA ).

In contrast to other methods for distributed replication, no subsequent recovery is necessary if a node fails. The failed node comes back on the network and may contain outdated data. However, the reading quorum ensures that the current version is always found.

example

Given are 5 nodes each with a weight of 1. If RT  = 1 and WT  = 5, this means that only one node has to agree to a read operation. For write access, however, you have to write to all resources. However, this system would not be fail-safe.

On the other hand, you could also set WT  = 4 and RT  = 2; writing would still be possible if a node failed.

Disadvantages of the procedure

The quorum consensus method generates a high load when reading data because several nodes have to be read in order to achieve the read quorum.

A large number of replications are also necessary in order to cope with the failure of a few components (e.g. 3 nodes to survive the failure of one node).

improvement

With the missing writes algorithm , a ROWA strategy can be used as long as there are no failures. So every node is updated when there is a change. This enables fast reading (only from one node) to be achieved. Only in the event of a failure is a changeover to quorum consensus to compensate for the failed nodes.

literature

  • Kemper, Alfons and André Eickler: Database Systems - An Introduction . 7th edition. Oldenbourg Verlag Munich, 2009, ISBN 978-3-486-59018-0 .

Web links