No history yet

Introduction to Distributed Systems

What Makes a System Distributed?

A distributed system is a collection of separate, independent computers that appears to its users as a single, unified system. Think about using a search engine. You type a query, and in a fraction of a second, you get a result. Behind the scenes, your request isn't handled by one supercomputer. Instead, it's processed by thousands of coordinated machines, each doing a small piece of the work. You don't see the complexity, you just see a single, powerful service.

The key characteristics of these systems are that components are autonomous, run at the same time (concurrently), and are connected by a network. A failure in one computer doesn't necessarily bring down the whole system. This design is fundamentally different from a program running on a single machine.

Why Bother with the Complexity?

Building a distributed system is more complex than writing a program for one computer, so there must be good reasons to do it. The main motivations are scalability, fault tolerance, and resource sharing.

Scalability is the ability to handle a growing amount of work by adding resources to the system.

Imagine a single, powerful web server. As more users visit the site, the server slows down. To handle the load, you could replace it with an even more powerful, and expensive, machine. This is called vertical scaling. The distributed approach is horizontal scaling, where you just add more standard, cheaper machines. Instead of one giant carrying a huge load, you have a team of people, each carrying a small part. It's often more cost-effective and flexible to add more team members than to find a bigger giant.

Fault tolerance is about resilience. If one of the computers in the system fails, perhaps due to a hardware issue or a software bug, the overall system can continue to operate. Your online banking service doesn't shut down just because one of its servers has a problem. Other servers take over the failed machine's workload, often without you ever noticing. This redundancy makes the system highly available and reliable.

Resource sharing allows multiple users or computers to access the same data or devices, like a shared database, a file system, or even specialized hardware.

The Core Challenges

The benefits of distributed systems come with a unique set of challenges. These aren't just technical hurdles; they are fundamental problems that engineers must solve.

Lesson image

One major challenge is concurrency. In a distributed system, many things are happening at once on different machines. If two people try to book the last available seat on a flight at the exact same moment, the system must correctly handle their simultaneous requests to ensure the seat isn't sold twice. This requires careful coordination, which is tricky when the computers involved are physically separated.

Another issue is partial failure. In a single computer, if something fails, the whole machine usually crashes. In a distributed system, one node can fail while the others continue to run. The healthy nodes must be able to detect the failure, re-route work, and continue operating correctly without the failed component. This is much harder than it sounds. How long do you wait for a response from another machine before you decide it has failed? What if it's just being slow?

Finally, there's latency. The speed of light puts a hard limit on how fast information can travel between computers. This communication delay, or latency, is unavoidable. An algorithm that works perfectly on a single machine might be painfully slow in a distributed system because it has to wait for messages to travel across the network. Designing systems that work efficiently despite these delays is a central goal of distributed computing.

Let's review these core ideas.

Quiz Questions 1/5

Which of the following best describes a distributed system?

Quiz Questions 2/5

A popular e-commerce website is experiencing slowdowns due to high traffic. Instead of replacing their main server with a more powerful one, they decide to add several more standard servers to share the load. This approach is known as:

Understanding these basic concepts is the first step toward designing robust and scalable applications that power the modern internet.