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: |

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

Launched in 2013, Telegram allows users to broadcast messages to a following via “channels”, or create public and private groups that are simple for others to access. Users can also send and receive large data files, including text and zip files, directly via the app.The platform said it has more than 500m active users, and topped 1bn downloads in August, according to data from SensorTower.codedump的电报频道 from it


Telegram codedump的电报频道
FROM USA