Introduction to Chubby

Learn about Google's Chubby locking service and its requirements.

Problem statement

Achieving consensus among several participants has been a challenge in distributed systems. Many attempts have been made to achieve a reliable solution to this consensus problem. Chubby, mainly a locking service, attempts to solve this consensus problem by extending an already existing consensus algorithm, Paxos, which is discussed later in this lesson. We’ll take the example of the election of a primary among peers (to be discussed later) as the core problem to which it provides a solution. We’ll also discuss how this locking service helps in the leader election in later chapters.

Note: We will discuss how this locking service helps in the leader election in later chapters.

It is a distributed consensus problem, and we need a solution based on asynchronous communication that describes the behavior of most real networks, like the Internet.

Such asynchronous communication allows packets to be lost, delayed, and reordered. Hence, our system needs a solution to achieve synchronization, coarse-grained (for longer durations) rather than fine-grained (for shorter and focused durations). It will help us solve the problem of selecting a leader from a set of otherwise equivalent servers precisely, which is the main problem statement here.


Question: Chubby utilizes coarse-grained locking instead of fine-grained locking. Can you list the primary reasons or advantages behind Chubby’s choice of coarse-grained locking?

Coarse-grained vs. Fine-grained Locking in Chubby Locking

Paxos—an existing solution

The PaxosPaxos is a family of protocols for solving consensus in a network of unreliable or fallible processors. (Source: Wikipedia) protocol handles asynchronous consensus in a distributed system. Paxos is at the heart of most working protocols for asynchronous consensus that were present at the time of Chubby’s introduction. To use Paxos to achieve this functionality, we can simply build a ...