Company
Date Published
Author
Sugu Sougoumarane
Word count
1968
Language
English
Hacker News points
None

Summary

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.