Distributed Systems Detailed Explanation
Distributed Systems Detailed Explanation
high availability and fault tolerance. Each node in the system functions autonomously but works
Examples of distributed systems include cloud platforms such as Amazon Web Services (AWS),
- Transparency: Users should interact with the system as though it's a single, unified system, even
- Location transparency: The physical location of resources shouldn't matter to the user.
- Scalability: The system should efficiently handle a growing number of nodes or tasks by distributing
- Fault Tolerance: The system should continue to function even if some of its components fail, using
- Resource Sharing: All users should be able to access resources, such as data, hardware, or
The system model of a distributed system describes how components in the system are structured,
are shared. Distributed systems can be understood in terms of three different models:
1. Physical Model: Defines how the hardware components (e.g., computers, servers) are physically
- Example: A global cloud system with servers in different regions connected via the internet.
2. Logical Model: Describes how processes interact logically, focusing on communication, task
- Example: In a client-server model, clients send requests, and servers respond to those requests,
3. Architectural Model: Describes the software organization of the system, which includes how
- Example: A peer-to-peer (P2P) system where all nodes are equal and can act as both clients and
servers.
1. Heterogeneity: Different computers may have different hardware, operating systems, and network
protocols. A distributed system must work seamlessly across these diverse environments.
2. Transparency: Hiding the distributed nature of the system from users is challenging but necessary
3. Scalability: As the number of nodes or users increases, the system must handle increased load
4. Fault Tolerance: The system must detect and recover from failures automatically, ensuring
5. Concurrency: Many processes may need to access the same resources at the same time,
Unit-II
Message Passing is a form of communication used in distributed systems where different processes
exchange data. Unlike shared-memory systems, there is no common memory, and all
Message passing can be synchronous (where the sender waits for the receiver to get the message)
Examples include APIs, messaging protocols like REST, or middleware like Apache Kafka.
Remote Procedure Call (RPC) is a communication model where a procedure (or function) is
client as if it were a local call. The client doesn't need to manage the details of the network
communication; the system abstracts it away.
Example:
A client application needs to fetch user data from a remote database server. Using RPC, the client
sends a request to the server, which executes the requested operation and returns the results.
Steps in RPC:
2. The arguments are packed (marshaled) into a message and sent to the server.
3. The server receives the message, unpacks the arguments, and executes the procedure.
Marshaling refers to the process of converting the parameters or arguments of a procedure into a
Unmarshaling is the reverse process of converting the received data back into its original format for
Example:
In an RPC call where a client sends two integers to a server to add them, the integers must be
sent over the network. The server then deserializes (unmarshals) the byte stream back into integers,
Remote Method Invocation (RMI) is a Java-specific mechanism for invoking methods on an object
RMI allows objects to call methods on other objects located remotely, hiding the complexity of
applications to maintain an object-oriented approach while interacting with objects that may be
2. Stub and Skeleton: The stub acts as a proxy on the client side, while the skeleton resides on the
Example:
In a distributed banking application, a client can invoke the getBalance() method of a remote object
server hosting the bank account processes the request and returns the result.