Q1Distributed System
Question
Discuss the various design issues and challenges in building a distributed system.
Answer
An exhaustive review of the architectural design challenges in Distributed Systems, violently detailing the catastrophic problems of network latency, clock synchronization, fault tolerance, and absolute security.
Engineering a massive Distributed System (like Google's Spanner database) is mathematically and architecturally one of the most difficult tasks in computer science. The fundamental assumption that "the network is reliable and instantaneous" is a catastrophic fallacy. Engineers must violently overcome several absolute physical limitations.
1. The Absence of a Global Physical Clock
In a single computer, all programs share one quartz clock. In a distributed cluster of 5,000 servers scattered across Earth, every server has its own hardware clock. Due to thermal variations, these clocks mathematically "drift" apart. If Server A writes a file at 10:00:00 and Server B overwrites it a second later, but Server B's clock is 5 seconds slow (09:59:56), the system will catastrophically overwrite the newer file with the older file. Solving this requires complex Logical Clocks or GPS-synchronized Atomic Clocks.
2. Network Latency and Partial Failures
In a centralized system, a crash is binary: it is either completely alive or completely dead. In a distributed system, "Partial Failure" is a nightmare. Node A sends a critical message to Node B. If no reply arrives, Node A mathematically cannot know if Node B lost power, if the network cable was physically severed, or if Node B is simply executing extremely slowly. This ambiguity makes Distributed Consensus (Paxos/Raft) incredibly difficult.
3. Concurrency and Mutual Exclusion
Thousands of users might violently attempt to modify the exact same replicated database record simultaneously. Without a centralized CPU to lock the RAM, the system must deploy massive, heavy network-based locking algorithms to prevent race conditions.
4. Security and Scalability
As the system physically scales from 10 to 10,000 nodes, the network traffic (broadcast storms) can exponentially increase, crashing the system. Furthermore, every single open network port is a potential attack vector, requiring massive cryptographic overhead on every internal message.