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 and Signal Havens for Right-Wing Extremists

Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.

How to Invest in Bitcoin?

Like a stock, you can buy and hold Bitcoin as an investment. You can even now do so in special retirement accounts called Bitcoin IRAs. No matter where you choose to hold your Bitcoin, people’s philosophies on how to invest it vary: Some buy and hold long term, some buy and aim to sell after a price rally, and others bet on its price decreasing. Bitcoin’s price over time has experienced big price swings, going as low as $5,165 and as high as $28,990 in 2020 alone. “I think in some places, people might be using Bitcoin to pay for things, but the truth is that it’s an asset that looks like it’s going to be increasing in value relatively quickly for some time,” Marquez says. “So why would you sell something that’s going to be worth so much more next year than it is today? The majority of people that hold it are long-term investors.”

telegram from kr


Telegram codedump的电报频道
FROM USA