Telegram Group & Telegram Channel
#分布式
Paxos解决的核心问题是:分布式系统里如何确定一个值。Paxos的做法是:给每次提交一个版本号,一个版本确定之后就不再能修改。

这里的“版本号”不一样非得是自然数,只需要满足全序性(total order,简单理解一个全序关系里的任意两个元素都能对比大小)就可以了。正因为版本号必须满足全序关系,才能保证前面说的“版本的值确定之后,不能再进行修改”。

比如Raft里面的版本号就是(Term,Index),这也是满足全序关系的,Raft里面对比(Term,Index)大小关系的算法大体是:
if (left.Term == right.Term)
return left.Index > right.Index
else
return left.Term > right.Term


所以从这个意义上来说,Raft本质上还是Paxos,可以理解为换了另外一种版本号来实现的Paxos。

多说一句,实际上定义一类新的数据类型时定义这类型数据之间的比较关系,C++里面早就有了,提供了operator >、>=、<、<= 这些操作符函数。很早之前学C++的时候就已经知道,但是那时候还没有上升到数学的层面理解为什么需要定义这些关系,一直到我接触了全序、偏序关系的概念才恍然大悟。

再推一次XP的这篇讲解Paxos原理的文章,其它讲Paxos的文章,多是一上来给读者按照论文给出流程,专注在How,而这篇文章反向来推导过程,给出了Paxos的Why。
12👍2



tg-me.com/codedump_notes/676
Create:
Last Update:

#分布式
Paxos解决的核心问题是:分布式系统里如何确定一个值。Paxos的做法是:给每次提交一个版本号,一个版本确定之后就不再能修改。

这里的“版本号”不一样非得是自然数,只需要满足全序性(total order,简单理解一个全序关系里的任意两个元素都能对比大小)就可以了。正因为版本号必须满足全序关系,才能保证前面说的“版本的值确定之后,不能再进行修改”。

比如Raft里面的版本号就是(Term,Index),这也是满足全序关系的,Raft里面对比(Term,Index)大小关系的算法大体是:

if (left.Term == right.Term)
return left.Index > right.Index
else
return left.Term > right.Term


所以从这个意义上来说,Raft本质上还是Paxos,可以理解为换了另外一种版本号来实现的Paxos。

多说一句,实际上定义一类新的数据类型时定义这类型数据之间的比较关系,C++里面早就有了,提供了operator >、>=、<、<= 这些操作符函数。很早之前学C++的时候就已经知道,但是那时候还没有上升到数学的层面理解为什么需要定义这些关系,一直到我接触了全序、偏序关系的概念才恍然大悟。

再推一次XP的这篇讲解Paxos原理的文章,其它讲Paxos的文章,多是一上来给读者按照论文给出流程,专注在How,而这篇文章反向来推导过程,给出了Paxos的Why。

BY codedump的电报频道


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/codedump_notes/676

View MORE
Open in Telegram


codedump的电报频道 Telegram | DID YOU KNOW?

Date: |

The global forecast for the Asian markets is murky following recent volatility, with crude oil prices providing support in what has been an otherwise tough month. The European markets were down and the U.S. bourses were mixed and flat and the Asian markets figure to split the difference.The TSE finished modestly lower on Friday following losses from the financial shares and property stocks.For the day, the index sank 15.09 points or 0.49 percent to finish at 3,061.35 after trading between 3,057.84 and 3,089.78. Volume was 1.39 billion shares worth 1.30 billion Singapore dollars. There were 285 decliners and 184 gainers.

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.codedump的电报频道 from ms


Telegram codedump的电报频道
FROM USA