...
/Detailed Design of Chubby: Part I
Detailed Design of Chubby: Part I
Learn about the components, different types of requests, and the namespace of the server in Chubby.
Components of the Chubby system
Communication between clients and servers happens through the client library linked with the client application.
Note: Chubby also has another component called a proxy server (this is an optional component that we discuss later).
If we look at the illustration above, there is a single server providing the Chubby service. If that server fails, the service will be down. To handle this, Chubby deploys a set of servers called a Chubby cell. A Chubby cell usually consists of five servers placed in different racks to reduce correlated failures. The servers placed in the same rack may share the electric power. For example, in case of a short circuit, the whole rack will be unavailable, and if we keep all the servers of a Chubby cell in the same rack, all of them will be unavailable. So, the servers are placed in different racks to reduce the system's unavailability. We may distribute replicas across data centers to guard against the full data center failure. However, doing so makes data consistency trickier and adds latency.
Servers
All the servers in the Chubby cell are replicas of each other and maintain copies of Chubby's database. Out of all the replica servers in the Chubby cell, one is elected as the primary using a consensus protocol. The rest of the servers in the Chubby cell are called secondary replicas or simply replicas.
Primary replica: The primary replica has to get the votes of a majority of replicas and a guarantee from those replicas that they won't choose a different primary replica for a small period (a few seconds). This guarantee is known as the primary replica lease. Under the condition that the primary replica continues to receive a majority of the vote, the replicas periodically renew the primary replica lease. ...