DS Unit-1
DS Unit-1
Here, the user feels like they are interacting with one system, but in the
background, multiple systems are working together.
Key Characteristics
Transparency: Hides the complexity of the system from users (e.g., location,
failure).
Unit 1 1
1. Resource Sharing – Allows multiple users to access shared resources like
files, databases, and printers.
Example: Cloud storage services like Google Drive.
Unit 1 2
Uses load balancing to evenly distribute tasks among nodes.
Example:
Example:
Unit 1 3
2.1 Transaction Processing Systems (TPS)
Operations:
Example:
Characteristics:
Example:
Unit 1 4
Applications of Distributed Systems
1. Search Engines
3. E-Commerce Platforms
4. Streaming Services
6. Healthcare Systems
Purpose: Stores and retrieves patient records across hospitals and clinics
securely and efficiently.
7. Online Gaming
Unit 1 5
Purpose: Distributes game servers worldwide to ensure low latency and
real-time gameplay.
8. IoT Systems
1. Layered Architecture
This style organizes the system into layers, where each layer has a specific
role.
Example:
Unit 1 6
2. Object-Oriented Architecture
Based on loosely coupled objects that interact with each other.
These interactions often use Remote Procedure Calls (RPC) or direct method
calls.
Example:
3. Data-Centered Architecture
All components are directly connected to a centralized database.
Unit 1 7
Example:
4. Event-Driven Architecture
Communication happens through events instead of direct calls.
Example:
Unit 1 8
Middleware in Distributed Systems
Middleware is software that acts as a bridge between an operating system and a
distributed application. It helps different applications or services communicate
and share data.
RPC Function calls between systems Works like a local function call
Unit 1 9
CORBA Cross-language communication Works across multiple languages
Unit 1 10
Interceptors
1. Self-Configuration
2. Self-Healing
The system detects failures and takes corrective action without manual
intervention.
Unit 1 11
Example: Kubernetes restarts failed pods automatically to maintain
application availability.
3. Self-Optimization
1. Cloud Computing:
2. Microservices Architecture:
Unit 1 12
measurement), compares it with the expected value, and makes necessary
corrections to maintain stability and performance.
Key Components of a Feedback Control System
2. Controller
Compares the actual output with the desired setpoint and decides how to
adjust the system.
3. Process/System
Measures the actual output and sends the data back to the controller.
5. Feedback Loop
The continuous cycle where the system takes the output, compares it with
the setpoint, and makes adjustments.
Unit 1 13
1. Centralized Architecture
In a centralized architecture, a single central entity (often called a central server
or master node) controls all or most of the system's operations. This entity is
responsible for managing tasks like data storage, processing, and decision-
making. Other nodes or clients in the system communicate with the central entity
for resources or services.
Key Characteristics:
Single Point of Control: The central server handles the main processing and
decision-making.
Centralized Data Management: All critical data is stored at the central server,
and all queries go through it.
Easy to Manage: Since there’s a central authority, it's easier to manage and
maintain the system.
Unit 1 14
Layers in the Client-Server Model - (Multi layered)
2. Decentralized Architecture
Unit 1 15
In a decentralized architecture, there is no central authority controlling the
system. Instead, multiple distributed nodes operate independently, making their
own decisions and handling their own tasks.
Each node can act as both a client and a server, communicating with other nodes
in a peer-to-peer (P2P) fashion.
Key Characteristics:
Multiple Points of Control: No single central server; every node in the system
has equal authority.
Distributed Data Management: Each node may store its own data or replicate
data among other nodes.
Fault Tolerance: The system can continue functioning even if one or more
nodes fail.
Example:
3. Hybrid Architecture
A hybrid architecture is a mix of centralized and decentralized systems. Some
tasks are handled by a central entity, while other tasks are managed
independently by distributed nodes.
Centralized for Control – A main server or entity manages critical operations.
Unit 1 16
Decentralized for Efficiency – Independent nodes handle tasks without relying on
a central server.
Key Characteristics:
Mixed Data Management: Some data may be centrally stored, while other
data is distributed or replicated across various nodes.
Flexible Design: The system can leverage the benefits of both centralized and
decentralized systems, adapting to the needs of different tasks.
Example:
Edge Servers: edge server systems, hybrid architecture plays a crucial role in
balancing performance, scalability, and reliability.
Unit 1 17
1. Centralized Component (Core Internet & Content Provider)
This part of the system ensures data integrity, control, and consistency
by managing global services.
Edge servers act as decentralized units that are placed closer to the
users.
These servers store cached content and process requests locally without
needing to reach the central system every time.
3. Client Interaction
If not, the edge server fetches it from the central content provider
(centralized aspect).
Process
A process is a program under execution, consisting of various memory sections:
Execution Context
Unit 1 18
A process maintains an execution context, which includes:
Thread
A thread is a lightweight unit of execution within a process. A process can have
one or multiple threads.
A thread allows a process to split into multiple tasks that run concurrently.
Threads share the same memory space but have their own execution context
(stack, PC, SP, registers).
Example: A basic HTTP server processing one request per client at a time.
2. Multi-Threaded Server
Unit 1 19
Spawns a new thread for each client request.
Both client and server use multiple threads for better efficiency.
Virtualization
Virtualization is the process of creating virtual versions of physical resources
like computers, storage, or networks. It allows multiple users, applications, or
organizations to share the same physical infrastructure efficiently.
How Virtualization Works
A special software called a hypervisor is used to create and manage multiple
virtual machines (VMs) on a single physical system.
Hypervisor – A software layer that separates physical hardware from virtual
machines. It ensures that multiple VMs can run independently on the same
machine.
Virtual Machine (VM) – A software-based computer that runs an operating
system and applications like a real computer.
Host Machine – The physical computer running the hypervisor.
Guest Machine – The virtual machines running on top of the hypervisor.
Advantages of Virtualization
Types of Virtualization
Unit 1 20
1. Hardware Virtualization (Virtual Machines)
Creating multiple virtual computers on a single physical machine.
Each virtual computer (VM) has its own CPU, RAM, storage, and OS.
The hypervisor ensures that all VMs share the physical system resources
efficiently.
Example:
Cloud platforms like AWS, Azure, and Google Cloud use virtualization to
provide cloud servers.
2. Application Virtualization
Running an application without installing it directly on a system.
Example:
3. Network Virtualization
Creating multiple virtual networks on a single physical network.
Example:
Unit 1 21
Software-Defined Networking (SDN) lets companies control networks
using software.
4. Desktop Virtualization
Using a virtual desktop instead of a physical computer.
Example:
5. Storage Virtualization
Combining multiple storage devices into a single virtual storage system.
Example:
Google Drive, AWS S3, Dropbox store your data across multiple servers.
Software Agents
Software agents are programs that act autonomously to perform tasks on behalf
of users or other systems. They can make decisions, adapt to changes, and
communicate with other agents.
These agents work together with users or other agents to complete tasks
efficiently.
Unit 1 22
Example: A chatbot that helps customer support by answering common
queries and forwarding complex issues to a human agent.
2. Mobile Agents
These agents can move from one system or network to another, carrying
out tasks remotely.
Example: A software agent that collects stock market data from different
sources and delivers it to your financial app.
3. Interface Agents
These agents interact directly with users, learning their habits and
preferences to provide personalized assistance.
Example: A virtual assistant like Siri or Google Assistant that learns your
favorite apps, reminders, or frequently visited places.
4. Information Agents
These agents gather, process, and deliver useful information from various
sources.
1. Client
A client is a device or software that requests services or data from a server.
Clients rely on servers to process their requests and send back results.
Unit 1 23
Examples:
A web browser (Chrome, Firefox) is a client that requests web pages from
a web server.
2. Server
A server is a powerful computer or software that processes requests from
clients and sends back responses.
It can store data, host applications, or provide services like file sharing, email,
or databases.
Examples:
A database server (like MySQL or MongoDB) stores and retrieves data for
applications.
Code Migration
Code migration refers to moving code from one machine to another in a
distributed system. It helps improve performance, reduce network load, and
balance resources efficiently.
Reasons for Code Migration
3. Fault Tolerance → If one machine fails, code can move to another machine.
Unit 1 24
1. Code Segment → The actual program logic or instructions.
Example: A web page script runs on a different server but starts fresh
each time.
2. Strong Migration
1. Synchronous Communication
Unit 1 25
Example:
API calls that require an immediate response (e.g., requesting user details
from a database).
Use Cases:
2. Asynchronous Communication
The sender sends a message and does not wait for an immediate response.
Example:
Sending an email: the sender does not wait for the recipient to read it.
Message queues (e.g., RabbitMQ, Kafka) where messages are stored and
processed later.
Use Cases:
Notification systems
Unit 1 26
3. Persistent Communication
Messages are stored in a system (e.g., a database or message queue) until the
receiver is ready to process them.
Ensures that messages are not lost even if the receiver is temporarily
unavailable.
Example:
Use Cases:
Transaction processing
API requests,
Synchronous Yes Yes No
RPC
Email, message
Asynchronous No No Optional
queues
Kafka, order
Persistent No No Yes
processing
1. Message-Oriented Communication
Unit 1 27
Used in scenarios where communication is asynchronous (sender and
receiver don’t need to be active at the same time).
Example:
Use Cases:
2. Stream-Oriented Communication
Example:
Use Cases:
3. Multicast Communication
Efficient for broadcasting updates without sending multiple copies of the same
data.
Example:
Live sports streaming, software updates sent to multiple devices, IoT device
communication.
Use Cases:
Unit 1 28
Remote Procedure Call (RPC) is a communication protocol that allows a program
on one machine to execute a function on another machine as if it were a local
function.
This abstraction simplifies distributed computing by hiding the complexities of
network communication, making remote interactions seamless.
Key Characteristics of RPC:
The function call appears local to the client, but it actually executes on a
remote server.
Works on a client-server model, where the client requests execution and the
server processes it.
2. Client Stub – A proxy that converts the request into a format suitable for
network transmission.
3. RPC Runtime – Handles message passing between the client and server,
managing network communication.
4. Server Stub – Receives the request, converts it back into a local function call.
Unit 1 29
5. Server – Executes the actual function and sends back the result.
What is a Stub?
A stub is a piece of code that acts as an intermediary, converting function calls
into network messages and vice versa.
The client stub converts the function call into a network request.
The server stub receives the request and executes the corresponding
function on the server.
2. The client stub converts this request into a network message and sends it to
the remote server.
3. The server stub receives the request, decodes it, and calls the actual
getUserData() function on the server.
4. The server processes the function and sends back the result.
Unit 1 30
5. The client stub receives the response, decodes it, and returns the result as if it
were a normal function call.
File Systems – Enables remote access in systems like NFS (Network File
System).
Advantages:
Unit 1 31
Disadvantages:
Advantages:
Disadvantages:
1. Java Client – The application that makes a remote call to a method on the
server.
Unit 1 32
2. Client Stub – Acts as a proxy for the remote object. It marshals (serializes) the
method call and sends it to the server.
Example:
A banking application where the client interacts with remote objects like
Account.getBalance() .
Use Cases:
Communication
Description Example Use Case
Type
Asynchronous
Independent
Message-Oriented Email, Kafka messaging,
messages exchanged
notifications
Real-time streaming,
Stream-Oriented Continuous data flow Netflix, Zoom
voice calls
Unit 1 33