Distributed systems

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/116

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:32 AM on 8/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

117 Terms

1
New cards

Distributed System (textbook definition)

A collection of independent, autonomous hosts connected through a communication network that communicate and coordinate their actions exclusively by passing messages.

2
New cards

No shared memory (architectural constraint)

Processes in a distributed system must use the network stack for all communication; there is no shared memory between hosts.

3
New cards

No shared clock (architectural constraint)

There is no single global "tick" to perfectly synchronize events across a distributed system.

4
New cards

No shared operating system (architectural constraint)

Nodes in a distributed system typically run their own local OS instances (e.g., Linux, Windows).

5
New cards

Tanenbaum & Van Steen's Definition of Distributed System

A collection of autonomous computing elements, connected by a network, which appear to its users as a single coherent system.

6
New cards

Autonomous (in distributed systems)

Nodes fail independently of one another.

7
New cards

Coherent (in distributed systems)

Users should not need to know which machine handled their request; the system presents a unified interface.

8
New cards

Leslie Lamport's View of Distributed Systems

"You know you have one when the crash of a computer you have never heard of stops you from getting any work done." Highlights the reality of partial failure and the need for state consistency.

9
New cards

Node (distributed systems)

An independent processing entity with local memory; in modern environments often a virtualized instance or container.

10
New cards

Link (distributed systems)

A communication channel that facilitates message passing between nodes; unlike internal bus lines, links are unreliable (latency, packet loss, partitions).

11
New cards

Motivations for Distribution

Resource Sharing (hardware/software/data access), Collaboration (sharing info across distances), and Inherent Distribution (systems naturally spread out, e.g., national ATM networks).

12
New cards

Advantage: Performance/Price of Distributed Systems

Microprocessors (distributed) have a low, cost-effective performance/price ratio compared to mainframes (centralised), which have a high, expensive ratio.

13
New cards

Advantage: Total Power of Distributed Systems

Distributed systems can achieve high total power (e.g., 10,000 CPUs) whereas mainframes are limited by single-chip cycle speed.

14
New cards

Advantage: Higher Availability

Achieved through redundancy (multiple server nodes and storage devices) so the system survives even if individual components fail.

15
New cards

Advantage: Incremental Growth

The ability to "scale out" by adding resources gradually, avoiding disruptive "forklift upgrades" required in centralized systems.

16
New cards

Concurrency (core characteristic)

In distributed environments, autonomous components execute simultaneously, handling separate tasks/requests across machines; requires managing race conditions and resource contention.

17
New cards

Lack of a Global Clock (core characteristic)

Because there is no global "correct time," local timestamps can't order events across machines; logical or vector clocks are used to determine causality.

18
New cards

Independent Failures / Partial Failure

Unlike centralized systems with a Single Point of Failure (SPOF), distributed systems face partial failure — one node may be down while others remain healthy; software must be "failure-aware."

19
New cards

Heterogeneity (core challenge)

A distributed system must bridge differences in hardware (ARM vs x86), operating systems, networks (protocols/media), programming languages, and data formats.

20
New cards

Middleware

The software layer that sits above the OS to mask heterogeneity; often implemented as API Gateways, Message Brokers, or Service Meshes (e.g., Istio, Linkerd, RabbitMQ).

21
New cards

Security (core challenge in distributed systems)

Mechanisms/frameworks that protect data in transit and validate server identities so clients aren't communicating with malicious nodes (TLS, Authentication, Authorization, Certificates).

22
New cards

Failure Detection

Using heartbeats or timeouts to find failed nodes.

23
New cards

Failure Masking

Hiding failures by retrying requests or using redundant replicas.

24
New cards

Failure Recovery

Bringing a failed node back into a consistent state with the rest of the cluster.

25
New cards

Transparency (distributed systems)

The critical concept of concealing the physical distribution of processes and resources so users experience the system as if it were local.

26
New cards

Access Transparency

Hides differences in data representation and how resources are accessed; read local and remote files similarly (e.g., RMI/RPC, NFS).

27
New cards

Location Transparency

Hides where a resource is physically located; user uses a URL, not an IP address.

28
New cards

Migration Transparency

Allows resources to move without user impact (e.g., moving a service between cloud regions).

29
New cards

Replication Transparency

Hides that a resource is copied for performance or reliability (e.g., multiple database copies).

30
New cards

Concurrency Transparency (type)

Hides that multiple users are accessing the same resource simultaneously (e.g., many users editing at once).

31
New cards

Failure Transparency (type)

Hides that a node crashed and was recovered in the background (e.g., request succeeds despite a node crash).

32
New cards

Vertical Scaling (Scale Up)

Adding more CPU or RAM to a single machine; has a physical and financial ceiling.

33
New cards

Horizontal Scaling (Scale Out)

Adding more nodes to the system; the preferred method for modern web-scale applications, offering theoretically infinite growth.

34
New cards

Scalability (Load and Capacity)

Measures how well a system handles increased load by increasing total capacity; in a well-architected system, 2x nodes should yield roughly 2x throughput.

35
New cards

Bottleneck (scalability)

A centralized component (e.g., single auth server, single non-partitionable SQL database) that limits scaling and represents a Single Point of Failure (SPOF).

36
New cards

Client-Server Architecture

Foundational asymmetric model: the Client actively initiates requests (user-facing); the Server passively listens, manages resources, and responds.

37
New cards

Multi-tier (N-tier) Architecture

Decomposes a system into logical layers: Presentation Tier (UI), Application Logic Tier (business rules), and Data Tier (persistent storage).

38
New cards

Peer-to-Peer (P2P) Architecture

A decentralized model where every node acts as both client and server (a "servent"); no central authority, resilient to censorship and traffic spikes (e.g., BitTorrent, Blockchain).

39
New cards

Microservices Architecture

The system is decomposed into small, independent services that communicate via lightweight protocols (e.g., REST); each can use a different language, be deployed independently, and scaled based on its own load.

40
New cards

Cloud-Native Architecture

Uses virtualized infrastructure on demand (containers, Kubernetes, service discovery, auto-scaling) to provision nodes quickly and handle scaling requirements.

41
New cards

Inter-Process Communication (IPC)

Communication between processes over the network; the exchange of data between two or more separate, independent processes/threads — it's what makes distributed systems distributed.

42
New cards

IPC "Island Analogy"

Each process is an island with its own address space, code, and data; the OS acts as a bridge, and the API is the "bridge deck" enabling high-level IPC programming.

43
New cards

Reasons Processes Cooperate

Information Sharing (e.g., banking database), Computation Speedup (e.g., Google Search), Modularity/Reliability (e.g., Netflix microservices), Convenience (e.g., WhatsApp messaging).

44
New cards

Shared Memory Model (IPC)

Processes communicate via a common memory region. Pros: fast/low latency, efficient data sharing, simple to manage. Cons: complex synchronisation, scalability limits, security/access control issues.

45
New cards

Message Passing Model (IPC)

Processes communicate by sending/receiving messages. Pros: loose coupling, safety from concurrency bugs, fault isolation. Cons: network delays, message loss, serialization overhead.

46
New cards

Send(destination, message)

Basic messaging operation: sends a message to a destination process.

47
New cards

Receive(source, buffer)

Basic messaging operation: receives a message from a source and stores it in a buffer.

48
New cards

Connect() / Disconnect() (messaging)

Additional messaging operations: Connect() establishes a logical communication channel between processes; Disconnect() terminates the channel and releases resources. Not all systems need explicit connections (e.g., UDP is connectionless; TCP/gRPC are connection-oriented).

49
New cards

Host Address (IP)

Identifies the machine on the network.

50
New cards

Port Number

Identifies the specific service (process) on a machine; a port typically has one receiver but can accept messages from many senders.

51
New cards

Service Name

A human-friendly name that maps to a port (e.g., http, smtp, ssh).

52
New cards

URL (higher-level addressing)

Combines protocol, host, port (optional), and path to identify a service (e.g., https://api.example.com:443/orders).

53
New cards

Message Header

Contains metadata about a message: message type, source/destination ID, length, sequence number, priority, checksum.

54
New cards

Message Body

The actual content or payload being transmitted in a message.

55
New cards

Direct Communication

The sender communicates directly with the intended receiver; sender must know the receiver's identity/address; typically tightly coupled and synchronous (e.g., HTTP, gRPC, TCP).

56
New cards

Indirect Communication

Processes exchange messages through an intermediary (message broker, queue, event bus); sender and receiver don't need to be online simultaneously; loosely coupled, usually asynchronous, high scalability/fault tolerance (e.g., Kafka, RabbitMQ, JMS).

57
New cards

Unicast

One sender sends a message to exactly one receiver (e.g., HTTP request, TCP socket).

58
New cards

Multicast

One sender sends a message to multiple interested receivers (e.g., service discovery, replicated systems, event notifications).

59
New cards

Why Multicast Matters

Used for Replication (updating multiple servers), Service Discovery, Event Distribution (updates to many subscribers), and Fault Tolerance (keeping replicas consistent).

60
New cards

Synchronous Communication

Sender is blocked, waiting for a reply, from the moment the call is sent until the response is received (receiver also blocks while processing).

61
New cards

Asynchronous Communication

Sender's call is non-blocking; sender is free to do other work while waiting; the reply/response is handled later (e.g., via callback or polling).

62
New cards

Indefinite Blocking (failure mode)

A process might "hang" forever if a network link fails during a blocking call.

63
New cards

Timeout (failure handling)

Returns a special error code if a process blocks for too long, allowing recovery logic to run.

64
New cards

Deadlock (IPC)

Occurs when blocking operations are issued in the wrong sequence, e.g., Process 1 waits for Process 2 while Process 2 waits for Process 1.

65
New cards

Key IPC Design Questions

Direct or indirect communication? Synchronous or asynchronous? Buffered or unbuffered? Fixed-size or variable-size messages? These choices affect performance, scalability, and reliability.

66
New cards

Buffering (messages)

Allows messages to be stored temporarily, delivered later, and processed asynchronously; benefits include absorbing traffic bursts, improving performance, and decoupling sender/receiver — at the cost of extra memory usage.

67
New cards

The Representation Problem

Different computer architectures represent data differently (e.g., Intel x86 vs AMD64 vs ARM), which complicates transmitting high-level data structures as network bytes.

68
New cards

Byte-ordering (Endianness)

A heterogeneity challenge: Big-endian (e.g., UNIX SPARC) vs Little-endian (e.g., Wintel) systems represent multi-byte data differently.

69
New cards

Marshalling

The process of flattening a structured, in-memory data object into a standard external format (e.g., JSON) so it can be transmitted as a sequence of bytes across the network.

70
New cards

Unmarshalling

The process of rebuilding the original structured data object from the standard-format bytes received over the network.

71
New cards

JSON (serialization format)

Text format that is human readable and easy to debug, but produces larger messages.

72
New cards

XML (serialization format)

Text format that is self-describing but verbose.

73
New cards

Protocol Buffers / Apache Avro

Binary serialization formats that produce smaller messages and enable faster processing than text formats like JSON/XML.

74
New cards

Transport Layer (in IPC)

Provides end-to-end communication between applications on different hosts, creating a reliable communication channel on top of IP; uses port numbers to address specific processes/services.

75
New cards

TCP (Transmission Control Protocol)

Connection-oriented, reliable byte-stream protocol.

76
New cards

UDP (User Datagram Protocol)

Connectionless, "best-effort" datagram service — fast but unreliable.

77
New cards

How TCP Achieves Reliability

Segmentation (splits large messages into segments), Sequence Numbers (unique ID per segment), Acknowledgements (three-way handshake: SYN, SYN-ACK, ACK), and Retransmission (if no ACK arrives before timeout).

78
New cards

HTTP (as Application Layer IPC)

Operates at Layer 7 (Application) of the OSI model; uses a request-response pattern over TCP; commonly used to expose REST APIs in microservices and web applications.

79
New cards

HTTP Methods (CRUD)

POST = Create/Insert, GET = Read/Select (never changes resource), PUT = Update/Override existing resource, DELETE = Remove resource.

80
New cards

Common HTTP Status Codes

200 OK (success), 201 Created (success for POST), 400 Bad Request (missing parameters), 401 Unauthorized (missing authentication), 404 Not Found (resource doesn't exist), 500 Server Error (server-side problem).

81
New cards

RESTful Services

Resource-oriented communication where resources are identified by URLs; principles include Stateless, Cacheable, Scalable, and Platform Independent.

82
New cards

API Gateway

A single entry point for all client requests that routes them to appropriate microservices; handles authentication, authorization, rate limiting, logging, caching, and request routing.

83
New cards

Publish-Subscribe (Messaging)

Publishers send events to a message broker (e.g., Apache Kafka) organized by topics; subscribers receive events. Decouples producers and consumers; scalable, resilient, ideal for event-driven architectures (e.g., Kafka, RabbitMQ, Azure Service Bus).

84
New cards

Remote Invocation

A mechanism for executing functions on a remote machine that gives the illusion the function executes locally; a high-level abstraction built on top of message-passing (IPC).

85
New cards

IPC vs Remote Invocation

IPC is a low-level mechanism for exchanging data via message passing (send/receive). Remote Invocation (RPC/RMI/gRPC) is a high-level abstraction built on IPC that lets a process invoke a method on another machine as if it were local.

86
New cards

Remote Procedure Call (RPC)

An extension of conventional procedure calls that allows a program to execute a procedure on a remote machine as if it were a local function call, hiding networking details (sockets, formatting) under the hood.

87
New cards

Key Benefits of RPC

Simplifies distributed application development, promotes code reusability, provides language/platform independence (with proper IDL), and improves maintainability and productivity.

88
New cards

Client Stub

A client-side proxy that receives client requests, marshals the procedure name/arguments, sends the request to the server, receives the response, unmarshals the result, and returns it to the client.

89
New cards

Server Stub

A server-side proxy that receives client requests, unmarshals incoming parameters, invokes the appropriate procedure, receives the execution result, marshals the return value, and sends the response to the client.

90
New cards

External Data Representation (XDR)

A standard format used to ensure data integrity during transmission between machines that represent data differently; key idea is converting local data into a portable format before transmission (e.g., Protocol Buffers in gRPC).

91
New cards

Binding (Remote Invocation)

The process of determining the location and identity of a remote procedure, allowing the client to obtain a service handle, network address, or endpoint — like looking up a contact in a phone directory before calling.

92
New cards

Static Binding

The server's address is hardcoded into the client at compile time; efficient but inflexible.

93
New cards

Dynamic Binding

The server registers its interface with a Binder (naming/directory service); the client queries the Binder to "look up" the service handle before making the call.

94
New cards

Service Contract

An agreement between client and server on how they will understand each other, typically defined using an Interface Definition Language (IDL).

95
New cards

Interface Definition Language (IDL)

A language-independent way to specify procedure names, input parameters, and return types; an IDL compiler (stub generator) automatically creates client and server stubs (e.g., .proto files in gRPC/Ballerina).

96
New cards

Synchronous Remote Call

The client thread blocks and waits for the response; simple to program but inefficient since waiting wastes client thread resources; good for short operations/low concurrency.

97
New cards

Asynchronous RPC

The client does not block; it continues other work while the response is delivered later via a callback/event; better resource utilization and higher concurrency, but requires an asynchronous programming model.

98
New cards

Deferred Synchronous RPC

The client continues other work immediately after the request, then later polls or waits for the result; simpler than fully asynchronous (no callbacks) but still more efficient than pure blocking.

99
New cards

gRPC Timeout / Deadline

A time limit set by the client for an RPC call to complete; if the server doesn't respond in time, the client aborts the call and returns an error (e.g., DEADLINE_EXCEEDED).

100
New cards

Retry Mechanism (gRPC)

The client automatically retries a failed RPC request to overcome transient issues (network blips, temporary unavailability), using a retry policy (max attempts, delay, backoff multiplier) and retryable status codes.