API Fundamentals Course
API Fundamentals
/
Advanced

Distributed Systems Basics

Definition

A computing paradigm where multiple independent computers appear to the end-user as a single unified system, working together to achieve massive scale and fault tolerance.

Explain Like I'm New

Instead of buying one 10-million-dollar supercomputer that will take down your whole company if its power supply breaks, you buy 1,000 cheap laptops and wire them together. If 5 laptops catch fire, the system doesn't even notice. But programming them to perfectly share data without confusing each other is extremely difficult.

Real World Example

Netflix. When you load Netflix, your UI is assembled by querying dozens of different databases running on thousands of different AWS servers simultaneously.

Common Use Cases

  • •Cloud architecture
  • •High availability
  • •Fault tolerance

Terminal Output

bash / terminal
/* The challenge of Distributed Systems: Data Consistency 1. User updates their profile picture. 2. The request goes to Server A (in New York). Server A updates Database A. 3. Database A begins copying the new picture to Database B (in London). 4. Milliseconds later, a friend in London views the profile. 5. The request hits Server B. Database B hasn't received the copy yet. 6. The friend sees the OLD profile picture. (This is called Eventual Consistency). */

Interview Questions

basic

  • What does 'Fault Tolerance' mean in a Distributed System?

intermediate

  • Explain the CAP Theorem in one sentence.

Flash Cards

Question

What is Fault Tolerance?

Click to reveal answer
Answer

The ability of a system to continue operating properly even if one or more of its components completely fails or crashes.

Question

What is CAP Theorem?

Click to reveal answer
Answer

It states that a distributed database can only provide two out of three guarantees simultaneously: Consistency (everyone sees the same data), Availability (the system is always up), and Partition Tolerance (the system works even if the network cable between the servers is cut).