No history yet

Distributed Systems Basics

Beyond a Single Machine

A distributed system is a group of separate computers that work together so closely they appear as one. Think of it like a team of chefs in a large kitchen. Instead of one chef doing everything from chopping vegetables to plating the final dish, tasks are split among specialists. One chops, another sautés, and another arranges the plate. To the customer, the meal just appears from "the kitchen." They don't see the individual chefs or the coordination happening behind the scenes. Similarly, a distributed system coordinates multiple computers, or nodes, to handle a single large task.

These computers don't share memory or a clock. They're independent, connected only by a network. If one computer fails, the others might not even notice immediately. This independence is both a strength and a challenge.

The Power of Many

One of the biggest advantages is scalability. If your website suddenly gets a huge surge in traffic, a single computer might slow down or crash. With a distributed system, you can just add more computers to the network to handle the extra load. It's like opening more checkout lanes at a grocery store when the lines get long. This ability to add more machines to share the work is often called horizontal scaling.

The other key benefit is fault tolerance. In a system with hundreds or thousands of computers, some are bound to fail. A distributed system is designed to handle these failures gracefully. If one node goes down, its workload can be automatically shifted to other healthy nodes. The overall system keeps running without interruption. This is why services like Google Search or Netflix are almost always available, even when individual servers in their massive data centers fail.

Lesson image

The Inevitable Hurdles

Of course, coordinating many computers isn't easy. One major challenge is a network partition, sometimes called a "split brain" scenario. This happens when a network failure splits the computers into two or more groups that can't communicate with each other. Each group might think the other has failed and try to take over, leading to conflicting actions and corrupted data.

Data consistency is another tough problem. To ensure fault tolerance, data is often copied, or replicated, across multiple machines. But what happens if you update a piece of data on one machine? How quickly does that change get copied to all the others? If a user reads the data from a different machine before the update arrives, they'll see old, stale information. Ensuring every user sees the correct, most recent version of the data at all times is a complex balancing act.

Google's Blueprint

Google was a pioneer in building massive distributed systems to power its services. To manage the incredible amount of data involved in crawling and indexing the web, they created the Google File System (GFS). GFS is a distributed file system designed to run on huge clusters of inexpensive, commodity computers. It automatically handles machine failures and replicates data across multiple nodes to ensure it's always available.

GFS splits huge files into fixed-size chunks, stores multiple copies of each chunk on different machines, and keeps track of it all with a central master server.

To process all that data, Google developed MapReduce. It's a programming model for breaking down a massive computation into two main steps: a "Map" step that processes small chunks of data in parallel across many machines, and a "Reduce" step that combines the results. This approach allowed Google to perform huge calculations, like building its search index, in a highly scalable and fault-tolerant way. The GFS and MapReduce papers laid the groundwork for many later big data technologies, like Hadoop.

These foundational ideas of splitting data and computation across many ordinary machines are central to how modern cloud computing works.