Vous êtes sur la page 1sur 13

Chubby system

What is Chubby system?


• Lock service in a loosely-coupled distributed system
• Large number of small machines
• High speed network (1Gbits/ethernet)
• Focuses more on reliability and fault tolerance and less on
performance.
• Used in Google: GFS, Bigtable, etc.
• It stores small amount of meta-data, as the root of the distributed
data structures
Structure of Chubby System
There are two main components in the system, chubby master and the chubby client library. Each
application interested in distributed coordination links with the chubby client library. The client
library then executes the locking protocol on client application’s behalf.
• A chubby cell consists of a small set of servers (replicas)
• A master is elected from the replicas via a consensus protocol like paxos
Master lease: several seconds
If a master fails, a new one will be elected when the master leases expire
• Client talks to the master via chubby library
All replicas are listed in DNS; clients discover the master by talking to any replica a replica
Structure of Chubby System
System Structure
• Replicas maintain copies of a simple database
• Clients send read/write requests only to the master
• For a write:
The master propagates it to replicas via the consensus protocol
Replies after the write reaches a majority of replicas
• For a read:
The master satisfies the read alone

• If a replica fails and does not recover for a long time (a few hours)
A fresh machine is selected to be a new replica, replacing the failed one
It updates the DNS
Obtains a recent copy of the database
The current master polls DNS periodically to discover new replicas a replica
File based interface
• Chubby exports UNIX file system like APIs. Files and directories are called nodes. There
are no links allowed in the system.
• A file can be opened in a read/write mode indicating the exclusivity. Clients get a handle
to the given node.
• ls/foo/wombat/pouch
1 st component (ls): lock service (common to all names)
2 nd component (foo): the chubby cell (used in DNS lookup to find the cell master)
The rest: name inside the cell

Locks
• Any node can act as a lock
• Advisory rather than mandatory
• Client can create a node/file in a write(exclusive) or read(shared) mode
Sequencer
Opaque byte string describing the state of the lock
Name of the lock + Lock mode (exclusive or shared) + Lock generation
number
Lock holder can generate a sequencer
Caching
To reduce read traffic
• File Data
• Meta Data
• File Absence
• Consistent, write through cache
Scaling techniques
Proxies
– Handling KeepAlive requests
– Read requests

Partitioning
– Enable large Chubby cells
– Little communication between partitions
Usage
● Initially as a lock service
● Most popular use as a name service
● GFS: to appoint a master server
● Bigtable
– Master election
– Master discovers its controlling servers
– Clients to find their master
Google APIs
What’s Google APIs
• Google APIs is a set of application programming interfaces (APIs) developed by Google
which allow communication with Google Services and their integration to other
services.
• Third-party apps can use these APIs to take advantage of or extend the functionality of
the existing services.
• The APIs provide functionality like analytics, machine learning as a service or access to
user data.
• Google offers a variety of APIs, mostly web APIs for web developers and mobile
developers.
• The APIs are based on popular Google consumer products, including Google Maps,
Google Earth, AdSense, Adwords, Google Apps and YouTube.
• For example –
YOU use Google+ from your web browser.
Your Android application uses Google+ through Google+ API.
i.e: Google APIs are the tools we need to build applications that can use Google Products.
How Google APIs work behind the scenes ?
• Most of Google APIs are web-based APIs. This kind of APIs are called
RESTFUL APIs ,because they are based on REST architecture.
• REST is a style of software architecture that is based on HTTP
protocol to retrieve data. Simply, in order to use Google APIs , you
only need to make HTTP requests to get data.
• Example: “Google Places API”

https://maps.googleapis.com/maps/api/place/nearbysearch/xml?locat
ion=36.825,2.3257&radius=50000&sensor=false&key=AddYourOwnKe
yHere
Types of Google web APIs
Public APIs:
• Interact with public content
• Is less secure and harder to manage
• Need an authentication key to be able to retrieve data.
For eg. EBay is a platform from which to buy and sell goods.

Private APIs:
• Interact with user private data
• More secure and easy to manage
• Need an authorization process before accessing to user data.
For eg. Home-Cost is a home building cost calculator.
Benefits of using Google APIs :
• Automation

• Application

• New data available

• Efficiency

• Integration

• Personalization

Vous aimerez peut-être aussi