Chubby is a distributed lock service; it does a lot of the hard parts of building distributed systems and provides its users with a familiar interface (writing files, taking a lock, file permissions). The paper describes it, focusing on the API rather than the implementation details; it is written in a very readable style. There are amusing stories about other Google engineers (their users) using the API incorrectly; in response, they either fix the API or the implementation so that it's no longer a problem.
Chubby provides locks and files. Distributed systems usually have one master (in a database, the master approves all writes before they're real); when the master dies, a new machine needs to be elected master. Without Chubby, this is a hard problem and implementations are error prone. With Chubby (which depends on Paxos, the gold standard for this), a machine will try to grab a lock & write it's name in a file when it wants to elect itself master; if it succeeds, it's the new master and the other machines will believe it once they read it's name in the file. Chubby provides an simple interface, but still gives you the correctness of using Paxos (which is very complex to use).
You have to work at Google if you want to see Chubby's source code, but ZooKeeper is an opensource alternative.
Read full article from Paper of the Week: The Chubby Lock Service for Loosely-Coupled Distributed Systems - Blog - Recurse Center
No comments:
Post a Comment