Chubby is a locking service that provides coordination between a large number of clients trying to do some work, for example, accessing a database. Let's explore some arguments as to why a lock service is added to the system.

Why use a lock service?

It could be argued that a library built around Paxos should have been used which only depends on a name service, instead of a library that accesses a central lock service. The reason is that a Paxos library would provide a standard framework to the programmers if their services can be implemented as state machines. Chubby does provide such a client library which is independent of it. Having said that, adding a lock service to a system does have advantages over using only a client library (that would need all the code for consensus and locking amongst independent parties).

Availability

Developers initially tend not to go for a highly available system. They start with prototypes that run with little load and low availability. While coding, they usually don’t put much thought into structuring their code so that it can be used with a consensus protocol.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.