🧠 WHAT IS A DISTRIBUTED SYSTEM?
A distributed system is a group of computers that work together as one system.
This is the foundation of modern platforms like Google, Netflix, and Amazon.
DEFINITION:
Multiple machines → One unified system
⚖️ CAP THEOREM
In distributed systems, you can only guarantee two of the three properties.
C = Consistency
A = Availability
P = Partition Tolerance
Real systems must choose trade-offs depending on their purpose.
🧭 CONSENSUS SYSTEMS
Consensus is how multiple servers agree on a single value or decision.
Examples:
- Leader election
- Data agreement
- Transaction confirmation
📡 EVENT-DRIVEN ARCHITECTURE
Systems communicate using events instead of direct API calls.
Service A → Event → Queue → Service B → Service C
📨 MESSAGE QUEUES
Message queues store tasks before processing to avoid system overload.
Producer → Queue → Consumer
🗄️ DISTRIBUTED DATA STORAGE
Data is split and stored across multiple machines for scalability and reliability.
Techniques:
✔ Sharding
✔ Replication
✔ Partitioning
🛡️ FAULT TOLERANCE
Systems must continue working even when parts of the system fail.
Methods:
✔ Backup servers
✔ Replication
✔ Failover systems
👑 LEADER ELECTION
One server is chosen to coordinate the system.
Used in:
✔ Databases
✔ Kubernetes
✔ Distributed clusters
📌 MODULE 10 SUMMARY
✔ Distributed systems = multiple machines working together
✔ CAP theorem defines system trade-offs
✔ Message queues handle communication
✔ Fault tolerance ensures reliability
✔ Leader election controls coordination