Skip to content
Ameen Abozaid
MID-023

Distributed computing

  • 6 Lessons
  • 2 h practice (estimate)
On this page 8 topics

Overview

Topics

  • Nodes
  • network latency
  • partial failures
  • clocks
  • failure models

Learn first

2 h of practice (estimate)

Learning outcomes

  1. List the fallacies of distributed computing and give a failure example for each.
  2. Explain partial failure: why a timeout does not tell you whether the operation happened.
  3. Explain clock skew and why wall-clock timestamps cannot order events across nodes.
  4. Describe crash, omission, and byzantine failure models at a conceptual level.

Lessons

  1. 01The eight fallacies
  2. 02Latency numbers every engineer should know
  3. 03Partial failure
  4. 04Clocks and ordering
  5. 05Failure models
  6. 06Demo: injecting latency and packet loss with Toxiproxy

Lab and exercises

Lab

MID-023-LAB1 · Unreliable network

Outcomes: 1–4 · Time: ~2 h

  1. Add Toxiproxy between Shop and its payment provider stub (Docker Compose).
  2. Run scenarios: added latency, timeout shorter than latency, dropped response, connection reset.
  3. After each, compare Shop's order status with the provider's record.
  4. Write the observed inconsistencies and which fallacy or failure model each demonstrates.

Acceptance: list of every inconsistency observed.

Exercises (assessment: failure-scenario quiz; five exercises)

IDOutcomeTask
MID-023-EX011For each of the eight fallacies, write one failure example from Shop.
MID-023-EX022Explain, with a timeline, why a timeout on charge() does not mean the card was not charged.
MID-023-EX033Two services log OrderPlaced and OrderPaid with local timestamps; paid appears earlier. Explain two causes and a fix.
MID-023-EX044Classify: node dies, link drops 5% of packets, node returns corrupted prices.
MID-023-EX051Estimate the minimum latency of a request that makes 8 sequential same-datacentre calls of 1 ms each, and say how to reduce it.
Show solutions
  • EX01 For example: reliable network, lost confirmation; zero latency, N+1 remote calls; secure network, plaintext traffic; topology, stale IP; one administrator, firewall change; zero transport cost, large payload bills; homogeneous, mixed API versions; infinite bandwidth, bulk export slows checkout.
  • EX02 Timeline: request sent, provider charges, reply lost, client times out. Shop cannot distinguish this from a request that never arrived.
  • EX03 Clock skew or NTP correction; fix by ordering with a sequence, a version number, or a single log (e.g. one Kafka partition per order).
  • EX04 Crash; omission; byzantine.
  • EX05 At least 8 ms plus processing; reduce by batching, parallel calls, caching, or merging the calls.

Quiz

Outcomes: O1 fallacies · O2 partial failure · O3 clocks · O4 failure models.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1"The network is reliable" is a fallacy because:O1
  2. 2Hard-coding a service IP ignores which fallacy?O1
  3. 3A client call times out. What do you know?O2
  4. 4Retrying a non-idempotent charge after a timeout risks:O2
  5. 5The best defence for safe retries is:O2
  6. 6Why can wall-clock timestamps from two nodes not order events?O3
  7. 7To measure elapsed time within one JVM use:O3
  8. 8A node stops and never returns: which model?O4
  9. 9A node sends wrong, conflicting data to different peers:O4
  10. 10A failed response (lost reply) after the server did the work is an example of:O2

Practical part

Five exercises MID-023-EX01 to EX05 plus the lab. Pass: at least four exercises correct and a lab list that names at least three distinct inconsistencies with their causes.

Common mistakes

Treating a timeout as a failure; ordering events by timestamps from different machines.

Assessment

Failure-scenario quiz.

Career relevance

Every later distributed-systems module.

Type to search levels, phases, modules and lessons.