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.