Distributed Systems Unit 1
Distributed Systems Unit 1
Independent
Each node can fail independently, and the system must tolerate it.
Failures
Cloud Computing (AWS, Azure, Offers computing, storage, and networking across
GCP) distributed data centers
Peer-to-Peer Systems (e.g., Each node acts as both client and server — sharing
BitTorrent) resources equally
🔹 4. Data Migration
Data Migration refers to transferring data from one machine/location to another in a
distributed setup.
✅ Purposes:
Balancing storage load
Backup and replication
Moving data closer to users
Upgrading systems
⚠️Challenges:
Maintaining data integrity and consistency
Minimizing downtime
Secure transmission of sensitive data
🔹 5. Computation Migration
Computation Migration involves moving code or executing processes from one machine
to another. This helps in load distribution, failure recovery, and improving performance.
✅ Why Migrate Computation?
Perform heavy computation on more powerful nodes
Move tasks closer to the data
Reduce response time
Adapt to system failures
🔄 Types:
1. Strong Migration – Moves code and current execution state
2. Weak Migration – Moves code only; restarts execution from beginning
⚠️Challenges:
Capturing execution state (in strong migration)
Platform compatibility
Communication overhead
Security of executing code remotely
2. Layered Architecture
Functions divided into layers: Presentation, Business Logic, Data.
Layered Architecture in distributed systems organizes the system into hierarchical
layers, each with specific functions and responsibilities. This design pattern helps
manage complexity and promotes separation of concerns.
In a layered architecture, the system is divided into distinct layers, where each layer
provides specific services and interacts only with adjacent layers.
This separation helps in managing and scaling the system more effectively.
3. Peer-to-Peer (P2P) Architecture
No fixed client or server.
The peer-to-peer model is a decentralized system where all computers (called
peers) are equal. Each peer can ask for services and also give services to others. It is
highly flexible and scalable because peers can join or leave anytime.
There is no central server — all peers talk to each other directly and share
resources like files or data by following certain rules. Peers search and connect to
each other whenever they need something.
Example: Torrent file sharing (BitTorrent).
4. Multi-tier Architecture
Extends client-server into more layers: Presentation tier, Application tier, and Data
tier.
Common in web applications.
1. Presentation Tier:
The presentation tier, also known as the user interface tier, is responsible for presenting
information to users and accepting user inputs. Its main purpose is to handle user interactions
and display data in a human-readable format. This tier provides the interface through which
users interact with the application.
2. Application Tier:
The application tier, also referred to as the business logic tier or middle tier, contains the core
logic and functionality of the application. It processes user requests, implements business
rules, performs computations, and coordinates the application's overall behavior. This tier acts
as an intermediary between the presentation tier and the data tier.
3. Data Tier:
The data tier, also known as the persistence tier or backend tier, is responsible for managing
data storage, retrieval, and manipulation. It stores the application's data in a structured format,
making it accessible to other tiers as needed. This tier ensures data integrity, security, and
efficiency in data operations.
5. Hybrid Architecture
Combination of the above models.
Example: P2P for resource sharing + client-server for control.
🔹 Architectural Concerns:
Scalability – System’s ability to grow.
Fault tolerance – System’s resilience to failure.
Security – Authentication, encryption, access control.
Transparency – Hiding complexity from users (e.g., location, access).
🔹 Importance of Internetworking:
Enables distributed systems to span across heterogeneous networks and platforms.
Supports global communication and data sharing over the internet.
Allows systems to scale beyond a single network boundary.
🔹 Key Components and Concepts:
1. Routers:
Devices that forward data packets between different networks.
Use IP addresses and routing tables to determine the best path.
2. Gateways:
Act as bridges between networks using different protocols.
For example, connecting a TCP/IP network with a Bluetooth or ZigBee network.
3. IP Addressing:
Every device in an internetwork is assigned a unique IP address.
Ensures correct delivery of messages across networks.
4. DNS (Domain Name System):
Translates human-readable names (like www.google.com) into IP addresses.
Supports accessibility in large-scale distributed systems.
5. NAT (Network Address Translation):
Allows private IP addresses to access the public internet through a router.
Supports address management and security.
6. Firewalls and VPNs:
Firewalls control access and protect internal networks.
VPNs allow secure remote access over public internets.
🔹 Internetworking Protocols:
IP for addressing and routing.
ICMP for diagnostics.
BGP (Border Gateway Protocol) for routing between autonomous systems.
ARP (Address Resolution Protocol) for resolving IP to MAC addresses.
🔎 Real-life Example:
A cloud-based email system like Gmail uses:
Networking to connect your device to a local access point.
Internetworking to route your email through multiple networks and data centers
spread across the world.
Heterogeneity
IPC works across different platforms, OS, and hardware.
support
Fault tolerance IPC must handle failures in networks, systems, and processes.
2. Sockets
Provide a communication endpoint for sending/receiving data.
Built on TCP/IP or UDP/IP protocols.
Common in languages like Java, Python, C.
🔹 Types:
Stream Sockets (TCP): Reliable, ordered, connection-based.
Datagram Sockets (UDP): Faster, no guarantee of delivery/order.
5. Message Queues
Use intermediate buffer queues to store messages temporarily.
Messages can be retrieved asynchronously.
Supports decoupling between sender and receiver.
Useful in event-driven or microservice architectures.
🔷 Communication Patterns
Pattern Description Example
Client-server
Sockets Python Sockets / Java NIO
applications
Distributed
RMI Java RMI Java
applications
Asynchronous
Messaging RabbitMQ, Kafka event
processing
Cloud and
REST APIs Web services mobile
backends
Communication method Direct function call Message passing via network protocols
Transparency Fully transparent Partial – some aspects like delays are visible
Stub A proxy on the client side that represents the remote object.
IDL (Interface Definition Used to define object interfaces in a language-neutral way (in
Language) CORBA, for example).
Latency Network delays make remote calls slower than local ones.
🔷 Introduction
In a distributed system, objects are often located on different machines, and these objects
need to interact and communicate just like local objects do in object-oriented systems. This
communication, however, is more complex due to the network, platform, and language
boundaries.
Hence, communication between distributed objects enables method calls on remote objects
across networks, and is implemented using Remote Method Invocation (RMI), Remote
Procedure Calls (RPC), and object request brokers (like CORBA).
Stub (Proxy) A local representative of the remote object; provides same interface.
Server-side component that receives the request and invokes the actual
Skeleton
method.
Dispatcher Selects the correct method and invokes it on the server object.
Message Passing Message queues decouple senders and receivers RabbitMQ, Kafka
Network Latency Remote calls are slower than local method calls.
🔷 What is RPC?
Remote Procedure Call (RPC) is a powerful concept in distributed systems that allows a
program to execute a procedure (function) on a remote machine as if it were a local call.
The complexities of networking—like sending data over TCP/IP, message encoding, and
decoding—are hidden from the user.
📌 In Simple Words:
RPC lets you call a function on another computer as easily as calling one in your own code.
🔷 RPC Architecture
Here are the main components involved:
Component Description
Client Stub Acts as a local interface, marshals the call and sends it.
Server Stub Unmarshals the request and invokes the actual function.
🔷 Types of RPC
Type Description
🔷 Advantages of RPC
Simplicity: Easy to use and understand (like calling local functions).
Modularity: Separation of client and server code.
Abstraction: Hides low-level network details.
Language Support: Widely supported in many programming languages.
🔷 Limitations of RPC
Issue Explanation
Lack of Object RPC is procedural; does not support OOP features like
Orientation polymorphism.
Tight Coupling Both client and server must share the same interface (IDL).
🔷 What Is a Notification?
A notification is a message sent to interested parties when an event occurs. It may include:
Type of event.
Timestamp.
Source of the event.
Relevant data or context.
🔷 Event-Notification Architecture
The Publisher-Subscriber Model is commonly used:
🧩 Components:
Component Role
🔷 Types of Notifications
Type Description
🔷 Use Cases
Use Case Event Notification
🔷 Benefits
Loose coupling between components.
Improved scalability — new subscribers can join dynamically.
Real-time responsiveness.
Efficient resource usage — only react when needed.
🔷 Challenges
Challenge Description
Duplicate Events Subscribers might receive the same notification multiple times.
Remote Object
Provides actual implementation of the remote interface.
(Implementation)
RMI Server Hosts the remote object and listens for remote invocations.