Paxos algorithm implementation

I read an article entitled “Paxos made simple,” but still got some bewilders:

  • What does "paxos algorithm instances" mean? does each instance indicate that there is input / command from external clients? and the paxos algorithm for each instance will run in parallel.

  • If there is only one "outstanding" developer who can issue a proposal, then what is the difference between the paxos algorithm and the two-phase commit algorithm ???

  • Where can we apply the paxos algorithm in the real world / project?

Thanks!

the document seems to have a clearer description: http://research.microsoft.com/pubs/64634/web-dsn-submission.pdf

more ideas?

+4
source share
1 answer

What do paxos instances refer to? does each instance indicate that there is input / command from external clients? and the paxos algorithm for each instance will run in parallel.

I answered the “instance” question in another question , so I just summarize here.

Basically, this is similar to saying “quicksort instance” to mean a single run of the algorithm. In the case of Paxos, instead of sorting the list, a value is selected for several hosts. Multiple instances of paxos can / run in parallel. Participants should be aware of this, therefore it is well said that it is indicated explicitly.

If there is only one "outstanding" developer who can issue a proposal, then what is the difference between the paxos algorithm and the two-phase commit algorithm ???

Distinguished Proposer is an optimization and is not a requirement for the algorithm. Distinguished Proposer reduces the disclosure of two sentences related to preparing / receiving messages, which is important if you want the instance to finish. In this model, a node sends a request to the Distinguished Proposer instead of suggesting for itself. If he thinks the Honored Preview is dead, he just offers it for himself. (He should not be / he can never be 100% sure that the Dear Provider is dead).

Where can we apply the paxos algorithm in the real world / project?

First of all, I use Paxos to elect leaders. For example, if I have several nodes that can perform a task, this is a database wizard, I use Paxos for the paxos instance to select the wizard.

The secondary use case is a strictly consistent database. The problem is that this can be slow due to the number of messages required by Paxos, so I do not use it for things that are better served by another database. That is, I use it mainly for customization. Take, for example, the election of the chief database leader mentioned above. Am I saving the result so that the nodes can query things like "who is the current database wizard"? Paxos also publishes its results, so in normal mode, I just listen to this stream, not request.

+9
source

Source: https://habr.com/ru/post/1414794/


All Articles