Distributed Systems
A distributed system is a collection of separate computers that work together over a network so smoothly that they feel like a single computer to the user. Instead of one powerful machine handling everything, many machines split up the workload, share information, and coordinate with one another to get large tasks done faster and more reliably
<h3>Definition and Core Concept</h3><h2><!--StartFragment--><p>At its core, a distributed system connects multiple independent hardware or software components—often called <b>nodes</b>—located on different machines across a local network or the internet. These nodes communicate and coordinate their actions exclusively by passing messages to each other.</p><p>In a traditional centralized setup, if the main server crashes or gets overwhelmed, the entire application goes down. In contrast, distributed systems share data, processing power, and storage across many nodes. While the underlying architecture is complex and spread out across the globe, the end user only interacts with a single unified service (like Google Search, Netflix, or online banking).</p></h2><h3>Key Features</h3><h2><ul><li><p><b>Concurrency:</b> Multiple machines execute tasks simultaneously. Many operations happen at the exact same moment across different processors without stepping on each other.</p></li><li><p><b>Lack of a Global Clock:</b> Because computers are physically separated, their internal clocks drift. Distributed systems cannot rely on a single, shared absolute time to order events, relying instead on logical clocks or synchronization protocols.</p></li><li><p><b>Independent Failures:</b> Individual computers or network cables can fail at any time while the rest of the system continues running normally.</p></li><li><p><b>Scalability:</b> The system can easily grow to handle heavier workloads simply by adding more computers (horizontal scaling) rather than buying one massive, expensive server (vertical scaling).</p></li><li><p><b>Resource Sharing:</b> Hardware, software, files, and databases are distributed and shared among users and applications seamlessly.</p></li><li><p><b>Transparency:</b> The complexity is hidden from the user. You don't need to know where files are stored, which server handles your request, or if a background machine just failed and restarted.</p></li></ul></h2><h3>Common Real-World Examples</h3><h2><ul><li><p><b>The World Wide Web:</b> Millions of independent web servers, browsers, and content delivery networks (CDNs) exchanging data daily.</p></li><li><p><b>Cloud Computing Platforms:</b> Services like AWS, Microsoft Azure, and Google Cloud that pool thousands of servers to host applications and run complex computations.</p></li><li><p><b>Distributed Databases:</b> Systems like Apache Cassandra or Google Spanner that store pieces of data across multiple servers so information is never lost if one machine breaks.</p></li><li><p><b>Peer-to-Peer Networks:</b> Systems like BitTorrent or blockchain networks (such as Bitcoin) where every participating computer shares files or verifies transactions without any central authority.</p></li></ul></h2><h3>Main Challenges</h3><h2><ul><li><p><b>Network Latency and Reliability:</b> Messages sent across networks face delays, dropped packets, or temporary connection cutoffs.</p></li><li><p><b>Data Consistency:</b> When data is copied across several servers for safety, ensuring every server reflects the exact same updates at the same time is extremely difficult (often governed by the <b>CAP theorem</b>.</p></li><li><p><b>Security:</b> With messages constantly traveling over networks between separate machines, protecting data from interception and securing multiple entry points becomes much harder than locking down a single computer.</p><!--StartFragment--></li></ul></h2><h3><br></h3>
