Pages




Monday, August 8, 2011



Digg this

How Does Google Do It? Meet the Google File System (2)

page 1 · 2
Google Labs Logo
How It Works
Unlike a general purpose file system, GFS is meant to work across a cluster instead of a single machine.  The basic architecture of a GFS cluster consists of a single master server and multiple chunkservers.  The master node is responsible for maintaining all of the file system metadata: access permissions, mappings from files to chunks, locations of chunks in the cluster, etc.  Each chunkserver is responsible for storing chunks as files on a local disks.  And chunks are fixed size units of storage that make up files in the GFS; they are often replicated across multiple chunkservers
for redundancy.


As you might have guessed, chunks are large - 64MB.  Compare that with a typical 4KB block size for ext3 and you can see that chunks are really big.  When you're working with large files like Google does then large chunks allow you to go to fewer locations for related data.  Concentrating more data in a single place also reduces network overhead across chunkservers and allows clients to take advantage of a persistent TCP connection more often instead of having to constantly open and close connections when reading files.  Put simply, the large chunks mean fewer places to go to read a file.


Aside from having large chunks, a lot of effort was put into GFS to ensure availability and reliability of data.  For instance, chunks are replicated not only across servers, but also across racks.  And priority replication is given to chunks that are determined to be poorly replicated in the cluster.  

Master servers determine the status of chunkservers in the cluster through regular heartbeats.  And should a master server fail, it is quickly recoverable from replicated checkpoints and an operational log.  Therefore, at any time either a master server or a chunkserver can fail and be quickly recovered.


Bottom Line
Google created a filesystem (GFS) that assumes very large files in a large clustered environment where server outages are not only expected, they are common.  GFS was born out of a need that Google had to optimize their own applications and ensure the reliability of their data.  And to think all of this is just part of what makes my search results pop up when I click the Search button on Google.com.


<<previous

No comments:

Post a Comment