TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Neat Algorithms: Paxos

331 点作者 hbrundage超过 10 年前

10 条评论

krat0sprakhar超过 10 年前
This is up for debate but this[0], IMHO, is pretty much the gold standard of explaining distributed algorithms.<p>[0] - <a href="http://thesecretlivesofdata.com/raft/" rel="nofollow">http:&#x2F;&#x2F;thesecretlivesofdata.com&#x2F;raft&#x2F;</a>
评论 #8807574 未加载
评论 #8807520 未加载
评论 #8807013 未加载
评论 #8807139 未加载
评论 #8807521 未加载
ahelwer超过 10 年前
Software engineers love Paxos because it takes something very complex (a distributed system) and makes it equivalent to working with a single machine: you only ever talk to the leader. It gives you redundancy at the expense of performance.<p>Paxos is used to achieve something called Strong Consistency, where each node sees the same message in the same order. If you think of each node as a deterministic state machine, they are guaranteed to end up in the same state after responding to the same sequence of messages. It&#x27;s nice and intuitive, but requiring global synchronization on every write is terrible for performance.<p>Other consistency schemes exist. A popular one is Eventual Consistency, where writes are made immediately at any node (not just the leader) and the system is expected to synchronize in the background and &quot;converge&quot; to the same state. However, this can result in merge conflicts: if you&#x27;re editing a document in collaboration with other users, what if you edit a word in a paragraph while another user deletes that entire paragraph? Does the system resolve this automatically, or require user assistance? The answer to this question varies according to system requirements. I think most HN users have experienced the joys of resolving merge conflicts.<p>A newer model is something called Strong Eventual Consistency, which is similar to Eventual Consistency but merge conflicts are impossible by design: every update to the system must be commutative, associative, and idempotent with other updates. It is not always possible to design your system this way. These systems are implemented with Conflict-Free Replicated Data Types (or ad-hoc equivalents) and have excellent liveness&#x2F;throughput&#x2F;performance characteristics compared to Strong Consistency.<p>CRDTs are not as simple as Paxos. You&#x27;re forced out of the cozy one-system world and your system must deal with two nodes concurrently holding different values. For most applications, magic Paxos dust is all you need. For others, CRDTs are an excellent tool.
评论 #8807625 未加载
评论 #8809525 未加载
评论 #8807426 未加载
emin-gun-sirer超过 10 年前
This well-illustrated post is technically about the core Synod agreement protocol in Paxos. Building a consistent distributed service on top requires additional scaffolding and infrastructure. Typically, people layer on a system that implements a &quot;replicated state machine (RSM)&quot; on top, which maintains the illusion of a single consistent object, even though it is composed of distributed replicas.<p>Also keep in mind that Raft, Zab, and View-Stamped replication (in reverse chronological order) are alternatives to the Synod protocol in Paxos. These protocols differ from Paxos by employing a different leader-election mechanism and slightly different way of maintaining their invariants.<p>There have been many Paxos variants. This site [1] shows the various Paxos variants over a timeline and points out their contributions.<p>Those of you interested in building replicated state machines using Paxos should take a look at OpenReplica [2]. It is a full Multi-Paxos implementation that takes any Python object and makes it distributed and fault-tolerant, like an RPC package on steroids.<p>[1] <a href="http://paxos.systems/" rel="nofollow">http:&#x2F;&#x2F;paxos.systems&#x2F;</a><p>[2] <a href="http://openreplica.org/faq/" rel="nofollow">http:&#x2F;&#x2F;openreplica.org&#x2F;faq&#x2F;</a>
评论 #8807384 未加载
amelius超过 10 年前
Also interesting: [1]<p>&gt; Raft is a consensus algorithm that is designed to be easy to understand. It&#x27;s equivalent to Paxos in fault-tolerance and performance. The difference is that it&#x27;s decomposed into relatively independent subproblems, and it cleanly addresses all major pieces needed for practical systems. We hope Raft will make consensus available to a wider audience, and that this wider audience will be able to develop a variety of higher quality consensus-based systems than are available today.<p>[1] <a href="https://raftconsensus.github.io/" rel="nofollow">https:&#x2F;&#x2F;raftconsensus.github.io&#x2F;</a>
评论 #8808140 未加载
评论 #8807266 未加载
ash超过 10 年前
&gt; Honest-to-goodness real-life implementations of Paxos can be found at the heart of … Google’s magnificent Spanner database…<p>I&#x27;m not sure about Spanner and Paxos. Sebastian Kanthak said during his Google Spanner talk:<p>&quot;If you&#x27;ve been to the Raft talk this morning, our Paxos implementation is actually closer to the Raft algorithm than to what you&#x27;d read in the Paxos paper, which is… if you haven&#x27;t read it, don&#x27;t read it, it&#x27;s horrible.&quot; (at 7:43)<p><a href="http://www.infoq.com/presentations/spanner-distributed-google" rel="nofollow">http:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;spanner-distributed-googl...</a>
Animats超过 10 年前
Nice animations.<p>How do you keep a broken or hostile node from advancing the sequence number to the end of the sequence number space?<p>There&#x27;s an algorithm from one of Butler Lamson&#x27;s grad students at MIT which fixes this, but it seems to require one more message per cycle. (<a href="http://pmg.csail.mit.edu/~castro/thesis.pdf" rel="nofollow">http:&#x2F;&#x2F;pmg.csail.mit.edu&#x2F;~castro&#x2F;thesis.pdf</a>) That paper later appears as a Microsoft Research paper on how to make an NFS-like file system with this consensus properly. Did Microsoft ever put that in a product?
lordnacho超过 10 年前
Having looked for a few minutes, it really reminds me of the routing protocols used for distributing routes in networks. (Also Layer 2 stuff IIRC). There you also find heartbeats, elections, etc.<p>Is there a connection?<p>Also, does it have anything to do with the Byzantine Generals Problem?
评论 #8807169 未加载
评论 #8807145 未加载
subbu超过 10 年前
The animations are a bit fast. Would&#x27;ve been great if the reader could control them. Easier to learn.
_almosnow超过 10 年前
&gt; Side note: it’s important that no two proposers ever use the same sequence number, and that they are sortable, so that they truly reference only one proposal, and precedence between proposals can be decided using a simple comparison.<p>They are moving the core problem into a different domain. Worst explanation of PAXOS ever... nice animations though.<p>Edit: &#x27;Worst explanation&#x27; is just an exaggeration, obv. It is nice, but doesn&#x27;t explain really important issues.
评论 #8808799 未加载
fitshipit超过 10 年前
&gt; Know Paxos? Stealth-mode big data startup is hiring founding engineer<p>lol