Distributed systems: goals and types
Goals of distributed systems (correctness, transparency, scalability, reliability, availability, performance, security) and common types/architectures (client–server, peer-to-peer, cluster, cloud, grid, sensor, real-time), with reliability formulas and exam-style examples.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Two or three sentences: where an engineer uses this.
Distributed systems are used whenever computation, storage or services must be shared across multiple networked computers. An engineer designs distributed systems to meet goals such as reliability, availability, scalability, and transparency while choosing an appropriate type (for example client–server, peer-to-peer, cluster, cloud) to match performance and fault-tolerance requirements.
Key ideas
Explain plainly from first principles. Define every term before using it and bold each term when it is defined.
- System: a set of interacting components that together perform computation. In distributed systems the components run on separate physical machines.
- Distributed system: a collection of independent computers that appears to its users as a single coherent system. (Assumption: components communicate by message passing over a network.)
- Component: a single computing node (process or machine) in the distributed system.
- Fault: a defect in hardware, software, network, or human operation that can cause incorrect behaviour.
- Error: a part of the system state that may lead to a failure; faults can cause errors, and errors can lead to failures (fault–error–failure chain).
- Fault model: the class of faults a system is designed to tolerate (e.g., crash, omission, timing, Byzantine).
- Failure: the observable incorrect behaviour at a component caused by a fault.
- Reliability: the probability that a system performs correctly for a specified time interval under stated conditions.
- Availability: the fraction of time a system is ready to serve requests (often measured as uptime). If a system is highly available it may still be unreliable in the long run (they are related but different).
- Transparency: hiding the distributed nature from users and programmers. Types of transparency usually listed and tested: access transparency (same operations everywhere), location transparency (objects identified without revealing location), replication transparency (multiple copies hidden), concurrency transparency (concurrent access managed), failure transparency (failure handling hidden), migration transparency, naming transparency (uniform names independent of location or access path), performance transparency (system can be reconfigured to improve performance without user impact), scaling transparency (system can be expanded/shrunk without changing applications).
- Scalability: the property that system performance or manageability degrades slowly as system size increases. Common dimensions: size (number of nodes/clients), geographical distribution, administrative domain.
- Consistency: agreement on shared data values across replicas (we define only the idea here; the formal models such as strong or eventual consistency are taught later in the course).
- Latency: time taken for a message or request to be delivered/served.
- Throughput: number of operations completed per unit time.
Goals of a distributed system (formal statement often required in exams):
- Correctness: The system must perform the functions required by users (application-specific). This usually requires consistency for replicated data and safety properties in protocols (nothing bad happens) and liveness properties (something good eventually happens).
- Transparency: Hide distribution so that users/programmers see a single system.
- Fault tolerance: Continue to operate correctly despite faults. This requires detection, masking or recovery mechanisms.
- Scalability: Performance and administrative cost should scale with the number of components.
- Performance: Low latency and high throughput according to application needs.
- Security: Authentication, authorization, confidentiality, and integrity of data and messages.
- Openness: Use standardized, publicly defined interfaces and protocols to support interoperability, portability, and extensibility.
Types of distributed systems — exact descriptions and what to draw for diagrams. For each type, state the assumptions and typical use-cases.
Client–server: Many clients send requests to one or more servers that provide services or data. Assumption: servers are relatively powerful and long-lived; clients are less trusted and may be many. Draw: one box labelled "Server" connected by arrows to several boxes labelled "Client 1, Client 2, ...". Label arrows "RPC/HTTP requests" and show optional arrow back labeled "responses".
Peer-to-peer (P2P): Each node (peer) can act both as client and server; functionality and data are distributed across peers. Assumptions: nodes may join/leave frequently, there is no central authority. Draw: several nodes in a mesh with bi-directional links; label nodes "peer" and annotate "no central server".
Cluster computing: A set of tightly-coupled machines (often in one data centre) working together to provide high performance or redundancy. Assumption: low-latency LAN, homogeneous hardware. Draw: a rack of identical boxes connected to a switch, label "cluster" and annotate "single administrative domain".
Cloud / Data-centre systems: Large-scale distributed systems providing services (compute, storage) via virtualization. Assumption: multi-tenant, elastic resource allocation. Draw: many servers behind a load balancer, with clients on the left and storage on the right; label "cloud provider".
Grid computing: Federated resources across administrative domains for high-throughput batch jobs. Assumption: heterogeneous resources, designed for scientific computing.
Sensor networks / IoT: Many small, resource-constrained nodes with local sensing and intermittent connectivity. Assumption: energy-limited, lossy networks. Draw: many small sensor nodes around an environment, arrows to a gateway.
Real-time distributed systems: Systems with timing constraints (deadlines) for tasks; e.g., avionics. Important to specify hard deadlines (failure to meet is catastrophic) vs soft deadlines.
Classification by coupling:
- Tightly-coupled: nodes share fast interconnect, low latency (e.g., cluster).
- Loosely-coupled: nodes connected by standard networks with higher latencies (e.g., Internet-scale P2P).
Trade-offs and simple theorems/relations often asked in exams:
- Replication improves availability and fault tolerance but makes consistency harder to maintain (qualitative trade-off; formal relations such as CAP will be taught later).
- Adding more nodes can increase throughput but may increase latency and coordination overhead (explain with stepwise reasoning: more nodes -> more network links/messages -> more contention/coordination).
When an exam asks for a diagram comparing types, draw a small labelled network for each type as above and annotate the main properties (latency, trust model, fault model).
Formulas
Each formula on its own line, followed by symbol meaning, SI unit and when it applies.
Availability = MTTF / (MTTF + MTTR)
- MTTF = mean time to failure (seconds), i.e., mean up time between failures; MTTR = mean time to repair (seconds). Availability is unitless (fraction between 0 and 1). Applies to repairable systems in steady state (alternating renewal); no exponential/memoryless assumption is required.
MTTF = 1 / λ
- MTTF = mean time to failure (seconds), λ = constant failure rate (failures per second). Applies when failures follow an exponential distribution (memoryless).
R(t) = e^{-λt}
- R(t) = reliability (probability of no failure in interval [0,t]), λ = failure rate (s⁻¹), t = time (s). Applies to exponential failure model.
Probability of k failures in time T = ( (λT)^k / k! ) · e^{-λT}
- Poisson probability with parameter λT; λ = average rate (s⁻¹), T = time (s). Applies when failures are Poisson processes.
Throughput = Number of completed operations / time (s)
- Unit: operations per second. Applies generally to measure performance.
Latency ≈ network RTT + queueing delay + service time
- RTT = round-trip time (s), queueing delay = time waiting for service (s), service time = processing time at server (s); approximate rule used for request–response systems, especially under load.
Worked examples
Two or three exam-standard problems with clear steps.
Example 1 — Numerical: availability from MTTF and MTTR Question: A server has MTTF = 3000 hours and MTTR = 2 hours. Compute availability. Solution steps:
- Convert to same units (hours is fine). MTTF = 3000 h.
- Use formula: Availability = MTTF / (MTTF + MTTR).
- Substitute numbers: Availability = 3000 / (3000 + 2) = 3000 / 3002.
- Compute: 3000 / 3002 = 0.999333... ≈ 0.999333. Answer: Availability ≈ 0.999333 (99.9333%).
Example 2 — Reliability using exponential model Question: A node has failure rate λ = 2×10⁻⁶ s⁻¹. What is the probability it survives 1 week (7 days)? Solution steps:
- Convert time: 7 days = 7 × 24 × 3600 = 604800 s.
- Use R(t) = e^{-λt}.
- λt = 2×10⁻⁶ × 604800 = 1.2096.
- R(604800) = e^{-1.2096} ≈ 0.298. Answer: Probability of survival ≈ 0.298 (29.8%).
Example 3 — Short model answer question (theory) Question: Explain why replication improves availability but can reduce consistency. Give a short example. Model answer: Replication stores multiple copies of data on different nodes. If one replica fails, other replicas can serve requests — so availability improves because more replicas reduce the chance that every copy is unavailable simultaneously. However, when updates occur, replicas must be synchronized. If updates are applied at different times to different replicas (network delays, partitions), replicas may temporarily disagree — this is the consistency problem. Example: Two replicas A and B both store counter x=0. Client1 updates A to x=1 while Client2 reads B before B has received the update; B returns 0 — inconsistency observed. Thus replication trades off availability and consistency unless strong coordination is used.
Common mistakes
What students actually get wrong in exams.
- Mixing up MTTF and MTBF: MTTF is for non-repairable items, MTBF commonly used for repairable systems; many professors accept MTBF=MTTF in steady-state but state the difference. In exams, prefer Availability = MTTF/(MTTF+MTTR) and, if you use MTBF, clearly define whether it means mean up-time between failures (equal to MTTF) or time between failures including repair.
- Forgetting units when plugging numbers into formulas (convert hours/days to seconds if λ is in s⁻¹).
- Using availability formula but not clarifying whether MTBF includes MTTR — explain assumptions.
- Drawing P2P as a single ring without annotating overlay vs physical links (explain which you mean).
- Saying "replication always improves everything" — must mention consistency/coordination costs.
- Confusing latency and throughput: higher throughput can come at cost of increased latency.
For your exam
Kinds of questions and what full-marks answers include.
- Definitions: short precise definitions for terms such as distributed system, transparency, fault, failure, availability, reliability. Full marks: concise definition plus one short example.
- Short notes: list and explain goals (fault tolerance, transparency, scalability, performance). Full marks: bullet points with short explanation and one example each.
- Derivations: prove Availability = MTTF/(MTTF+MTTR) from a steady-state alternating renewal (up/down) model. Full marks: state assumptions (renewal process with finite mean up/down times), define MTTF and MTTR, derive fraction of time system is up.
- Numericals: availability and reliability problems using given MTTF/MTTR or λ; always show unit conversions and intermediate steps. Full marks: correct formula, substitution, calculation, unit clarity, final answer with percent.
- Diagrams: draw architectures (client–server, P2P, cluster, cloud) and label key elements and message flows. Full marks: clean diagram, labels, 2–3 annotations of properties.
- Short essay: trade-offs of replication (availability vs consistency vs performance). Full marks: clear argument, small example, mention how coordination or protocols (later topics) solve issues.
Never attempt topics reserved for later without reference: e.g., do not give full proof of CAP theorem or Paxos here — refer to those later topics by name.
Quick check
Three short questions.
- Define availability in one line.
- Write the formula linking availability, MTBF and MTTR.
- Name two differences between client–server and peer-to-peer systems.
Answers: 1) Fraction of time system is ready to serve requests (uptime). 2) Availability = MTTF / (MTTF + MTTR). 3) Client–server has dedicated servers and usually central control; P2P has symmetric peers with no central authority and nodes act as both client and server.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?