Quorum (distributed computing)
A quorum is the minimum number of votes that a distributed transaction has to obtain in order to be allowed to perform an operation in a distributed system. A quorum-based technique is implemented to enforce consistent operation in a distributed system.
Quorum-based techniques in distributed database systems
Quorum-based voting can be used as a replica control method,as well as a commit method to ensure transaction atomicity in the presence of network partitioning.
Quorum-based voting in commit protocols
In a distributed database system, a transaction could execute its operations at multiple sites. Since atomicity requires every distributed transaction to be atomic, the transaction must have the same fate at every site. In case of network partitioning, sites are partitioned and the partitions may not be able to communicate with each other. This is where a quorum-based technique comes in. The fundamental idea is that a transaction is executed if the majority of sites vote to execute it.Every site in the system is assigned a vote Vi. Let us assume that the total number of votes in the system is V and the abort and commit quorums are Va and Vc, respectively. Then the following rules must be obeyed in the implementation of the commit protocol:
- Va + Vc > V, where 0 < Vc, Va V.
- Before a transaction commits, it must obtain a commit quorum Vc.
The total of at least one site that is prepared to commit and zero or more sites waiting Vc. - Before a transaction aborts, it must obtain an abort quorum Va
The total of zero or more sites that are prepared to abort or any sites waiting Va.
Quorum-based voting for replica control
In replicated databases, a data object has copies present at several sites. To ensure serializability, no two transactions should be allowed to read or write a data item concurrently. In case of replicated databases, a quorum-based replica control protocol can be used to ensure that no two copies of a data item are read or written by two transactions concurrently.The quorum-based voting for replica control is due to .
Each copy of a replicated data item is assigned a vote. Each operation then has to obtain a read quorum or a write quorum to read or write a data item, respectively. If a given data item has a total of V votes, the quorums have to obey the following rules:
- Vr + Vw > V
- Vw > V/2