1.
Architectures of Distributed Systems
A Distributed System is a collection of independent computers that appear to the users as a
single coherent system.
Goals
Resource sharing
Scalability
Fault tolerance
Transparency
Performance
2. System Architecture Types
Distributed systems can be organized based on how components communicate or interact.
2.1 Client–Server Architecture
Clients request services
Servers provide services
Examples: Web servers, databases
2.2 Peer-to-Peer (P2P) Architecture
No fixed roles
Nodes act as both client and server
Examples: BitTorrent, blockchain
2.3 Multi-Tier / N-Tier Architecture
Presentation layer
Application layer
Data layer
Used in enterprise applications.
2.4 Distributed Object Architecture
Objects are distributed
Communication via Remote Method Invocation (RMI)
2.5 Service-Oriented Architecture (SOA)
Involves loosely coupled services
Uses protocols like SOAP, REST
3. Issues in Distributed Operating Systems
Distributed OS must handle:
1. Transparency
o Location, access, migration, replication, concurrency, failure transparency
2. Scalability
o System should work efficiently as it grows
3. Fault Tolerance
o Retry, replication, recovery
4. Concurrency control
o Managing simultaneous access
5. Security
o Authentication, authorization, encryption
4. Communication Networks
Distributed systems communicate using:
Network Types
LAN (Local Area Network)
MAN (Metropolitan Area Network)
WAN (Wide Area Network)
Topologies
Bus, star, ring, mesh
Network Protocols
TCP/IP
UDP
HTTP/HTTPS
5. Communication Primitives
These are the basic communication mechanisms.
5.1 Message Passing
send(message)
receive(message)
Types:
Blocking / Non-blocking
Synchronous / Asynchronous
5.2 Remote Procedure Call (RPC)
Allows calling procedures on remote machines
5.3 Remote Method Invocation (RMI)
Object-oriented version of RPC
6. Theoretical Foundations
Distributed systems have fundamental limitations, such as impossibility of perfect
synchronization or absolute global time.
7. Inherent Limitations of Distributed Systems
1. Lack of global clock
o No two clocks are perfectly synchronized
2. Network latency and unpredictable delays
3. Partial failures
o Some nodes fail while others work
4. Concurrency issues
o Multiple processes executing simultaneously
8. Lamport’s Logical Clocks
Lamport introduced a method to order events without a global clock.
Rules
1. Each process increments its counter before each event.
2. When sending a message, include timestamp.
3. On receiving, set
4. timestamp = max(local, received) + 1
Result
Provides partial ordering: “happens-before” relation
9. Vector Clocks
An improved version of logical clocks providing causal ordering.
Concept
Each process maintains a clock vector
On event → increment its own entry
On receive → element-wise max + 1
Vector clocks detect concurrent events.
10. Causal Ordering of Messages
Message m1 → m2 if:
m1 happens-before m2
A system with causal ordering ensures delivery follows cause-effect order.
11. Global State
A global state represents the status of all processes + channel states at some instant.
Used for:
Checkpointing
Deadlock detection
Termination detection
12. Cuts in Distributed Computation
A cut is a set of local states, one per process.
Types
Consistent cut
o If an event is included, all events that happened-before it are also included
Inconsistent cut
o Violates happen-before relation
13. Termination Detection
Required to check if a distributed computation has finished.
Methods
Dijkstra–Scholten algorithm
Credit distribution techniques
Token-based algorithms
14. Distributed Mutual Exclusion
Used when processes need exclusive access to shared resources in distributed systems.
Goals
Mutual exclusion
Progress
Fairness
15. Classification of Mutual Exclusion Algorithms
15.1 Token-Based Algorithms
A single token represents permission.
Whoever holds token enters critical section.
Example: Token Ring Algorithm
15.2 Non-Token-Based Algorithms
Processes exchange messages to request permission.
Examples:
Lamport’s Algorithm
Ricart–Agrawala Algorithm
Maekawa’s Algorithm