April 2022 Summaries
2 posts from PlanetScale
Filter
Month:
Year:
Post Summaries
Back to Blog
In a consensus system, handling race conditions and establishing leadership are crucial. To address these challenges, the authors propose two approaches to resolving races: lock-based and lock-free. The lock-based approach guarantees that only one elector can make changes to the system by obtaining a lock, which simplifies the problem of changing leadership but introduces problems with forward progress and requires accurate clocks. In contrast, the lock-free approach assigns a time-based order to electors and allows the newest elector to win over an older one, naturally supporting forward progress but introducing uncertainty about stability and complicating consistent reads. The authors recommend using a lock-based system for large-scale consensus systems due to its simplicity and stability benefits.
Apr 28, 2022
1,968 words in the original blog post.
The consensus algorithm process involves several key components, including durability, which is the main reason for using a consensus system. The leader election process is complex and separates concerns such as establishment, revocation, forward progress, race handling, and propagation of requests. Traditional algorithms like Paxos and Raft conflate too many concerns, making it difficult to modify or replace individual parts without breaking the entire algorithm. A new approach focuses on establishing and revoking leadership through separate actions, which can be performed individually and are not necessarily atomic. Proposal numbers are used in traditional algorithms to establish leadership, but alternative methods such as replication mechanisms can also be used. The current leader's identity may not always be known, requiring additional considerations for revocation. Different algorithms can be interchangeable, and other approaches to establishing and revoking leadership exist, including physically shutting down a machine if necessary.
Apr 06, 2022
1,362 words in the original blog post.