Non-FictionInformativeEducational

Distributed Computing Projects eBook

A Coursebook on Distributed Computing Projects

by Kelleher Tenesha

  • English
  • 139 pages
  • 2026
  • SamEnrico

A Coursebook on Distributed Computing Projects

Formats

Free sample

Chapter 1: The Silent Crash--–- The email arrived at 9:14 AM on a Tuesday. Subject line: “Site down – severe impact.” By the time you clicked it, the damage was done: forty-seven minutes of downtime, $142,000 in lost revenue, and a Slack channel with 2,300 unread messages. The post‑mortem would later reveal that your application worked perfectly—on your laptop, on the staging server, and during load tests. What failed was something you never even thought to test: the network between your three servers. One of them stopped responding for 1.8 seconds, and your entire system collapsed like a house of cards.Welcome to distributed computing. It’s not about writing clever code. It’s about accepting a brutal truth: networks lie, machines die, and time is an illusion. Most developers learn this the hard way—in production, at 2 AM, with a pager screaming. This book is designed to make sure you learn it here first, with a terminal window and a simulated cluster, before it costs you a job or a company.We’re going to start with something deceptively simple: running a “Hello World” command on three computers at the same time. It sounds trivial. It is not. By the end of this chapter, you’ll have encountered the same failures that bring down billion‑dollar systems, and you’ll have built the mental toolkit to recognize them before they ruin your day.The Fallacy of the Reliable Machine Every developer begins their journey believing in a set of comforting assumptions. The network is reliable. Latency is zero. Bandwidth is infinite. The network is secure. Topology doesn’t change. There is one administrator. Transport cost is zero. The network is homogeneous. These are the Eight Fallacies of Distributed Computing, first articulated by L. Peter Deutsch and later refined by James Gosling at Sun Microsystems. They are not theoretical curiosities—they are the wreckage upon which real systems have shattered.Take the first fallacy: the network is reliable. In your college network, maybe it felt reliable. But in the cloud, packets disappear constantly. A single switch hiccup, a misconfigured firewall, a transient routing glitch—any of these can drop a message without warning. Your code must assume that any network request might fail, might hang forever, or might succeed but the response gets lost. There is no “acknowledgment received” that you can fully trust.The second fallacy—latency is zero—is equally dangerous. When you call a function on the same machine, the return is measured in nanoseconds. When you make an RPC across a data center, that same return can take a hundred milliseconds or more. That’s a difference of seven orders of magnitude. A system designed without respect for latency will collapse under its own weight when scaled. You cannot treat a remote call like a local one.Bandwidth, the third fallacy, is not infinite. Moving a gigabyte across a server rack takes seconds. Moving the same gigabyte across continents takes minutes. And if you’re moving that much data frequently, you will saturate your network link, causing queuing, backpressure, and ultimately failure. The most efficient network call is the one you never make.The remaining fallacies are equally insidious. The network is not secure—any intermediate node can snoop or modify your traffic. Topology changes constantly as machines are added, removed, or fail. There is never just one administrator; every team has different priorities. Transport cost is never zero—every byte has a price. And the network is never homogeneous; you will always have a mix of operating systems, hardware generations, and configurations.In this book, we will violate each of these fallacies deliberately, in controlled experiments, so you can see how your code responds. But first, you need a safe environment to break things.Your First Cluster: Breaking Things on Purpose To understand distributed systems, you must build them. And to build them, you need a cluster—a set of computers that can talk to each other. In the real world, a cluster might be hundreds of servers spread across data centers. In this book, we’ll start with three containers running on your laptop. Containers are lightweight, isolated environments that behave like tiny virtual machines. They are the standard unit of deployment in modern distributed systems, and we will use them through every chapter of this book.Setting up your environment. You will need Docker and Docker Compose installed on your machine. Docker is free, runs on Windows, mac OS, and Linux, and gives you the ability to spin up containers with a single command. If you don’t have it installed, pause here and download it from docker.com. The remainder of this chapter assumes you can run docker --version and see a version number.Once Docker is installed, create a new directory for your work, for example ~/distributed-projects. Inside that directory, create a file called docker-compose.yml. This file will define our cluster. Copy the following configuration:yaml Copy Downloadversion: '3.8'

services: node1: image: alpine:latest command: tail -f /dev/null networks: - cluster-net node2: image: alpine:latest command: tail -f /dev/null networks: - cluster-net node3: image: alpine:latest command: tail -f /dev/null networks: - cluster-net

networks: cluster-net: driver: bridge This configuration creates three containers, each running Alpine Linux (a tiny distribution), and connects them through a virtual network called cluster-net. The tail -f /dev/null command keeps the containers alive without doing anything—they simply exist, waiting for you to interact with them.Run docker-compose up -d in your terminal. The -d flag runs the containers in the background. You should see output indicating that three containers have been created. Verify they are running with docker ps. You should see three entries named something like node1, node2, and node3.Now, let’s run a command on all three nodes simultaneously. Open three terminal windows, or use a multiplexer like tmux or screen. In the first terminal, run:bash Copy Downloaddocker exec -it distributed-projects_node1_1 sh This drops you into a shell inside node1. Repeat for node2 and node3 in the other terminals. You are now looking at three independent Linux systems, each with its own filesystem, processes, and network stack. From the perspective of the containers, they are separate machines.The crash. In the terminal for node1, run echo "Hello from node1". You will see the output instantly. Do the same on node2 and node3. Simple. But distributed systems are not about the happy path. Press Ctrl+C to exit the shell on node1, and then run docker pause distributed-projects_node1_1. This command freezes the container—it still exists, but it stops responding to network requests or CPU scheduling. This simulates a node that has crashed or become unresponsive.Now, from node2’s terminal, try to ping node1. Run ping node1 (the Docker network resolves container names to IP addresses). You will see no response. The packets disappear into silence. This is the first fallacy: the network is not reliable. Your system, which worked perfectly when all three nodes were responsive, now has a silent failure. But here’s the crucial insight: node2 doesn’t know that node1 is paused. It only knows that a packet was sent and no reply came. Is node1 dead? Is the network congested? Is the packet dropped? Without additional machinery…

This is the end of the free sample. Get the eBook to keep going. Buy now

About this book

A Coursebook on Distributed Computing Projects

Details

Author
Kelleher Tenesha
Publisher
SamEnrico
Language
English
Genre
Non-Fiction, Informative, Educational
Released
2026-05-09
Pages (approx.)
139
Available as
eBook, Audiobook

Read better in the ZLOADR app

Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.

More by Kelleher Tenesha

See all

You may also like

See all