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


telegram Telegram | DID YOU KNOW?

Date: |

Telegram hopes to raise $1bn with a convertible bond private placement

The super secure UAE-based Telegram messenger service, developed by Russian-born software icon Pavel Durov, is looking to raise $1bn through a bond placement to a limited number of investors from Russia, Europe, Asia and the Middle East, the Kommersant daily reported citing unnamed sources on February 18, 2021.The issue reportedly comprises exchange bonds that could be converted into equity in the messaging service that is currently 100% owned by Durov and his brother Nikolai.Kommersant reports that the price of the conversion would be at a 10% discount to a potential IPO should it happen within five years.The minimum bond placement is said to be set at $50mn, but could be lowered to $10mn. Five-year bonds could carry an annual coupon of 7-8%.

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

telegram from tw


Telegram codedump的电报频道
FROM USA