Distributed Computing
Distributed Computing
• In a distributed system, each device or system has its own processing capabilities and
may also store and manage its own data.
• These devices or systems work together to perform tasks and share resources, with no
single device serving as the central hub.
• In this type of system, users can access and use shared resources through a web
browser or other client software.
Components
There are several key components of a Distributed Computing System:
• Network: The network connects the devices or systems in the distributed system,
allowing them to communicate and exchange data.
• Multiple Devices or Systems: Processing and data storage is distributed across multiple
devices or systems.
• Peer-to-Peer Architecture: Devices or systems in a distributed system can act as both clients
and servers, as they can both request and provide services to other devices or systems in the
network.
• Shared Resources: Resources such as computing power, storage, and networking are shared
among the devices or systems in the network.
• Vertical / Horizontal Scaling: Scaling a distributed computing system typically involves adding
more devices or systems to the network to increase processing and storage capacity. This can be
done through hardware upgrades or by adding additional devices or systems to the network.
Advantages of Distributed Computing
• Scalability: Distributed systems are generally more scalable than centralized
systems, as they can easily add new devices or systems to the network to increase
processing and storage capacity.
• Reliability: Distributed systems are often more reliable than centralized systems, as
they can continue to operate even if one device or system fails.
• Flexibility: Distributed systems are generally more flexible than centralized systems,
as they can be configured and reconfigured more easily to meet changing computing
needs.
Disadvantages of Distributed Computing
• Complexity: Distributed systems can be more complex than centralized systems, as
they involve multiple devices or systems that need to be coordinated and managed.
• Performance: Distributed systems may not offer the same level of performance as
centralized systems, as processing and data storage is distributed across multiple
devices or systems.
Client-Server Model
• In the client-server architecture, when the client computer sends a request for data to
the server through the internet, the server accepts the requested process and delivers
the data packets requested back to the client. Clients do not share any of their
resources.
• Examples of the Client-Server Model are Email, World Wide Web, etc.
How does the Client-Server Model Works?
• Client: a Client is a computer (Host) i.e. capable of receiving information or
using a particular service from the service providers (Servers).
• The DNS server responds with the IP Address of the Web Server.
• The Browser sends over an HTTP/HTTPS request to the WEB Server’s IP (provided by the DNS server).
• The Server sends over the necessary files for the website.
• The Browser then renders the files and the website is displayed.
Client Server Request and Response
REMOTE PROCEDURE CALL (RPC)
• A Remote Procedure Call (RPC) is a software communication protocol that one program uses to
request a service from another program located on a different computer and network, without having
to understand the network's details.
• Specifically, RPC is used to call other processes on remote systems as if the process were a local
system. A procedure call is also sometimes known as a function call or a subroutine call.
• RPC acts like a low-level transport protocol for carrying data packets between communicating
programs.
• It does this using a client-server model. The requesting program is called a client, while the service-
providing program is called the server.
THINK OF IT LIKE THIS:
Imagine you are ordering food from a restaurant using a food delivery app.
• The app (the RPC system) sends your request to the restaurant.
• You receive the food and continue your work without worrying about the cooking process.
Just like this, RPC allows a program to call functions on another computer without needing to know how
the remote system works internally.
HOW DOES RPC WORK?
STEP BY STEP RPC EXECUTION FLOW:
CLIENT-SIDE EXECUTION:
• Call: The client initiates an RPC call to request a service from the server.
• Pack: The client stub packages the request into a format suitable for network transmission.
• Send: The RPC Runtime sends the Call Packet (request) to the server.
• Wait: The client waits for a response while the server processes the request.
SERVER-SIDE EXECUTION:
• Receive: The RPC Runtime on the server receives the request.
• Unpack: The Server Stub extracts and processes the request.
• Execute: The Server performs the requested operation.
• Pack: The Server Stub prepares the response.
• Send: The RPC Runtime sends the Result Packet back to the client.
CLIENT RECEIVES THE RESPONSE:
• Receive: The client runtime receives the Result Packet.
• Unpack: The client stub extracts the result.
• Return: The client receives the final result as if it were a local function call.
• It is commonly used in distributed computing and client-server applications where objects need to
communicate remotely.
CHARACTERISTICS OF ROI:
• Granular Control: The client can modify or retrieve the object’s state.
Example Scenario:
1. Online Banking Systems:
• When you check your bank balance via a mobile app or website, your request is sent to a remote banking
server that invokes an object to fetch your account details.
• Example: A banking API remotely accesses and updates transaction records.
CHARACTERISTICS OF MOC:
• Asynchronous Communication: The sender does not wait for an immediate response.
• Decoupling: Sender and Receiver don’t need to be active at the same time.