Paxos Variants and optimization

Source: Internet
Author: User

Theoretical advanced-Paxos variants and optimization of distributed systems

Introduction

The basic principles of basic Paxos and Multi Paxos are understood in the theory advanced-Paxos of distributed systems, but it is not enough to understand the fundamentals if we want to apply Paxos to engineering practice.

There are many optimization based on Paxos, in order to ensure that the consistency protocol is correct (safety), reduce the Paxos resolution communication steps, avoid single point of failure, to achieve node load balancing, so as to reduce latency, increase throughput, improve availability, below we understand these Paxos variants.

Multi Paxos

First of all, let's review the Multi Paxos,multi Paxos determines a series of values based on basic Paxos, the resolution process is as follows:

Phase1a:leader submitted proposals to acceptor

Phase1b:acceptor returns the most recently accepted offer (that is, the largest proposed ID and the corresponding value that was accepted), and returns null if the proposal was not accepted

Phase2a:leader collects acceptor responses in two different situations

Phase2a.1: If the reply content is empty, then choose a proposed value freely

Phase2a.2: If the reply content is not empty, then select the value of the proposal with the largest ID in the answer

Phase2b:acceptor the resolution to learner

Multi Paxos in leader is used to avoid live locks, but the presence of leader brings other problems, one is how to elect and maintain the only leader (although no leader or more leader does not affect consistency, but affects the resolution process progress), Second, the node that acts as the leader will bear more pressure, how to balance the load of the node. MENCIUS[1] proposed that the node rotates as the leader to achieve a balanced load; a lease (lease) can help implement a unique leader, but leader failure conditions can cause the service to be unavailable for a short period of time.

Fast Paxos

In multi Paxos, proposer-leader, acceptor-learner, from the proposal to the completion of the resolution of a total of 3 communications, can reduce the communication steps?

For multi Paxos phase2a, if you can freely propose value, you can let proposer directly initiate the proposal, leader exit the communication process, into proposer, acceptor, learner, which is fast The origin of paxos[2].

Multi Paxos proposed by the leader, so there is no resolution of a plurality of value,fast Paxos directly proposed by the proposer, a resolution may have multiple proposer proposals, there are multiple value, namely the proposed conflict ( Collision). Leader initiates the process of initiating the resolution (progress) and resolving the conflict, and when the conflict occurs leader re-participates in the resolution process and rolls back to 3 communication steps.

The Paxos itself implies a feature that can also achieve the goal of reducing communication steps, and if Acceptor's last determination (chosen) is from Proposera, then the resolution Proposera can directly propose a reduction in the communication step. If such an effect is to be achieved, the history of the previous resolution determination (chosen) needs to be recorded in proposer, acceptor, to know before the proposal which proposer proposal was last determined and whether the resolution could save a communication step.

Epaxos

In addition to improving the efficiency of the Paxos resolution from the point of view of reducing communication steps, there are other aspects that can be reduced Paxos resolution delay, such as generalized paxos[3] proposed non-conflicting proposals (such as the writing of different keys) can simultaneously resolution, in order to reduce the Paxos delay.

Further, Epaxos[4] (egalitarian Paxos) proposes a Paxos optimization method that supports both the non-conflict proposal and the simultaneous submission of a reduced delay, balanced load on each node, while reducing the communication steps to a minimum.

To achieve these goals, Epaxos's implementation has several key points. The first is that there is no global leader in the Epaxos, but each proposed proposer as the leader of the proposal (command leader), and the second is the proposal that does not affect each other (interfere) can be submitted at the same time; third, skip prepare, directly into the accept phase. The process of Epaxos resolution is as follows:

The left side shows the resolution process for each of the two update requests that are not affected, and the right side shows the resolution of the two update requests that affect each other. Multi Paxos, Mencius, epaxos latency and throughput comparisons:

In order to determine whether the resolution of mutual influence, achieve Epaxos to record the dependency between the resolution.

Summary

The above describes several variants based on Paxos, Mencius nodes in turn to do leader, balanced node load, Fast Paxos reduce a communication step, generalized Paxos allow non-impact resolution at the same time, Epaxos no global leader, Each node shares the load equally.

Optimization is endless, as is the case with Paxos, Paxos variants and optimizations that apply to different scenarios and ranges will continue to emerge.

[1] mencius:building efficient replicated state machines for WANs, Yanhua Mao,flavio P. Junqueira,keith Marzullo, 2018

[2] Fast Paxos, Leslie Lamport, 2005

[3] Generalized Consensus and Paxos, Leslie Lamport, 2004

[4] There is more Consensus in egalitarian parliaments, Iulian Moraru, David G. Andersen, Michael Kaminsky, 2013

Paxos Variants and optimization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.