2022UCI8068 Ravi S Pandey CIOT
Distributed Systems
Unit 1
1. Characteristics of Distributed Systems Versus Centralized Systems
Key Characteristics of Distributed Systems:
• Concurrency and Parallelism:
Multiple components or processes operate simultaneously on different machines.
• No Global Clock:
There is no single time reference; synchronization must be achieved through protocols.
• Independent Failures:
Each node or link may fail independently without necessarily bringing the whole system
down.
• Scalability:
Systems can grow by adding more nodes, improving processing power and storage.
• Transparency:
The distributed nature is hidden from the user, presenting the system as a single coherent
entity.
Differentiation from Centralized Systems:
Centralized systems rely on a single server or location for processing and data storage. In
contrast, distributed systems spread these tasks across multiple nodes, enhancing resilience and
scalability but introducing challenges in coordination and consistency.
Examples of Applications Bene ting from Distributed Approaches:
• Cloud Services:
Services like Amazon Web Services (AWS) distribute load across data centers for high
availability.
• Content Delivery Networks (CDNs):
CDNs use distributed nodes to deliver content rapidly to users worldwide.
• Blockchain Networks:
Decentralized ledgers operate on distributed nodes to provide fault tolerance and
transparency.
2. Real-World Applications of Distributed Systems
Application Examples and Their Bene ts:
• Cloud Computing Platforms (e.g., AWS, Google Cloud):
How They Leverage Distributed Architecture:
1
fi
fi
2022UCI8068 Ravi S Pandey CIOT
◦ Data is replicated across geographically dispersed centers.
◦ Workloads are balanced among numerous servers, reducing latency and
improving fault tolerance.
◦ Users experience high availability and scalable resources.
• Distributed Databases (e.g., Apache Cassandra, Amazon DynamoDB):
Bene ts:
◦ Data partitioning and replication improve read/write performance.
◦ The distributed design offers resilience against node failures, ensuring continuous
service.
• Content Delivery Networks (CDNs):
Performance Improvements:
◦ By caching content on edge servers near users, CDNs reduce data transmission
time.
◦ They provide better load distribution and reduce network congestion, enhancing
user experience.
3. Challenges in Consistency and Fault Tolerance
Primary Challenges:
• Consistency:
◦ Data Replication Issues: Maintaining a single, consistent state across multiple
nodes.
◦ Network Partitions: The CAP theorem forces trade-offs between consistency,
availability, and partition tolerance.
• Fault Tolerance:
◦ Node Failures: Individual failures may disrupt the overall system if not properly
handled.
◦ Error Propagation: Handling cascading failures without affecting overall system
performance.
Strategies to Address These Challenges:
• Consensus Algorithms:
Protocols like Paxos or Raft ensure that nodes agree on a common state despite failures.
• Replication and Redundancy:
Data is duplicated across nodes, so if one node fails, others can take over.
• Quorum-Based Approaches:
Operations are considered successful only when a majority of nodes con rm the change.
2
fi
fi
2022UCI8068 Ravi S Pandey CIOT
4. In uence of Physical Models on Design and Implementation
Impact of Physical Models:
• Topology and Network Layout:
◦ LAN vs. WAN: Local Area Networks offer lower latency compared to Wide Area
Networks, which may be used to connect remote nodes.
◦ Data Center Con gurations: Redundant network paths within a data center can
minimize downtime and improve speed.
• Examples:
◦ Geographically Distributed Data Centers: Provide fault tolerance but may face
increased latency due to physical distance.
◦ Clustered Systems: A tightly coupled cluster (e.g., within a single building)
offers high-speed interconnects, enhancing performance.
5. Architectural Models: Client-Server vs. Peer-to-Peer
Client-Server Model:
• Advantages:
◦ Centralized control simpli es security and management.
◦ Easier to implement and maintain.
• Disadvantages:
◦ Potential single point of failure.
◦ Scalability issues when too many clients overwhelm the server.
Peer-to-Peer (P2P) Model:
• Advantages:
◦ No central bottleneck; nodes share resources directly.
◦ Greater fault tolerance since the failure of one node does not disrupt the network.
• Disadvantages:
◦ Complex management and security challenges.
◦ Variable reliability as peers may have heterogeneous capabilities.
In terms of scalability and reliability, P2P can scale well and handle failures gracefully, whereas
client-server models often require more robust servers and additional load-balancing strategies
to manage large-scale applications.
6. Fundamental Networking Principles
Key Networking Concepts:
• Latency:
◦ The delay before data begins transmission; critical in time-sensitive applications.
• Bandwidth:
3
fl
fi
fi
2022UCI8068 Ravi S Pandey CIOT
◦ The amount of data that can be transmitted in a given time period; in uences
throughput.
• Reliability:
◦ The guarantee that data reaches its destination without errors.
Effect on Distributed Systems:
Latency and bandwidth constraints dictate the design of communication protocols. Systems must
be designed to handle delays and potential data loss, impacting the overall responsiveness and
ef ciency of the distributed architecture.
7. Role of Internet Protocols (TCP/IP and UDP)
TCP/IP:
• Reliability:
Ensures data integrity and correct ordering through error detection and retransmission
mechanisms.
• Use Cases:
Suitable for applications where data accuracy is critical (e.g., web pages, le transfers).
UDP:
• Speed:
Offers low overhead and fast data transmission without the guarantee of delivery.
• Use Cases:
Ideal for real-time applications like video streaming or online gaming where speed is
preferred over perfect accuracy.
Together, these protocols enable diverse communication requirements across distributed systems,
balancing reliability and performance.
8. Multicast Communication vs. Unicast and Broadcast
De nitions:
• Unicast:
Communication between a single sender and a single receiver.
• Broadcast:
Data sent from one sender to all nodes in a network segment.
• Multicast:
Communication where data is sent from one sender to a selected group of receivers.
Advantages of Multicast:
• Ef ciency:
Reduces network load by sending a single stream to multiple receivers.
4
fi
fi
fi
fl
fi
2022UCI8068 Ravi S Pandey CIOT
• Group Communication:
Ideal for applications like video conferencing and real-time data distribution where
multiple recipients need the same information simultaneously.
9. Overlay Networks in Distributed Systems
De nition and Role:
An overlay network is a virtual network built on top of another network. It abstracts the
underlying physical network, enabling exible and ef cient data routing.
Enhanced Functionality:
• File Sharing:
Applications like BitTorrent use overlay networks to locate and exchange le pieces
ef ciently.
• Real-Time Data Distribution:
Systems such as distributed hash tables (DHTs) bene t from overlay structures to
improve lookup speeds and manage dynamic node membership.
10. Emerging Trends and Technologies
Current Trends Shaping Distributed Systems:
• Cloud Computing:
Enables on-demand resource allocation and global scalability.
• Edge Computing:
Moves computation closer to the data source, reducing latency and bandwidth usage.
• Blockchain:
Provides decentralized trust and tamper-resistant data storage.
• Microservices Architectures:
Decompose applications into smaller, independently deployable services, enhancing
agility and scalability.
These trends collectively drive improvements in performance, fault tolerance, and user
experience while reshaping how distributed systems are designed and deployed.
5
fi
fi
fl
fi
fi
fi
2022UCI8068 Ravi S Pandey CIOT
Unit 2
1. Remote Procedure Call (RPC)
De nition and Function:
RPC allows a program to execute a procedure on a remote system as if it were a local call,
abstracting the network communication details.
Key Bene ts:
• Transparency:
Simpli es distributed application development by hiding the complexities of network
communication.
• Ease of Use:
Developers invoke remote procedures with minimal changes to code structure.
Potential Drawbacks:
• Latency Issues:
Network delays can impact performance.
• Error Handling Complexity:
Remote calls require robust exception management and timeout mechanisms.
2. Java RMI (Remote Method Invocation)
Overview:
Java RMI facilitates the development of distributed Java applications by allowing objects on
different JVMs to communicate.
Main Components:
• Remote Interfaces:
De ne the methods that can be called remotely.
• Stub and Skeleton:
(Skeletons are used in legacy implementations.) Stubs act as proxies for remote objects.
• RMI Registry:
A naming service that allows clients to locate remote objects.
These components collectively hide the complexity of network communication and enable
seamless remote method invocation.
6
fi
fi
fi
fi
2022UCI8068 Ravi S Pandey CIOT
3. Role of Message Queues
Enhancements Through Message Queues:
• Asynchronous Communication:
Decouples senders and receivers, allowing for non-blocking operations.
• Load Buffering:
Helps manage varying loads by queuing messages until they can be processed.
• Improved Reliability:
Ensures messages are not lost even if the recipient is temporarily unavailable.
Contrast with Synchronous Communication:
• Synchronous Methods:
Require immediate responses, potentially causing delays and resource bottlenecks.
• Message Queues:
Allow the system to continue processing without waiting for immediate
acknowledgment.
4. Shared Memory in Distributed Systems
Concept:
The shared memory model allows processes to access a common memory space, facilitating
inter-process communication.
Challenges:
• Synchronization:
Preventing race conditions and ensuring consistency when multiple processes access the
same data.
• Data Consistency:
Maintaining a coherent view of data across distributed nodes.
Mitigation Strategies:
• Locks and Semaphores:
Provide mutual exclusion to critical sections.
• Transactional Memory:
Ensures that memory operations complete entirely or not at all.
• Distributed Consensus Algorithms:
Help maintain consistency across different nodes.
7
2022UCI8068 Ravi S Pandey CIOT
5. Processes vs. Threads
Processes:
• Characteristics:
◦ Independent execution with separate memory spaces.
◦ More isolation, reducing interference between tasks.
• Impact on Performance:
Higher overhead for creation and context switching.
Threads:
• Characteristics:
◦ Lightweight units within a process that share memory space.
◦ Enable ner-grained parallelism.
• Impact on Scalability:
Easier to manage large numbers of concurrent tasks, though they require careful
synchronization to avoid issues like race conditions.
Effective management of both processes and threads is crucial for achieving optimal
performance and scalability in distributed systems.
6. Operating System Features Supporting Distributed Systems
Key Features:
• Multi-Threading and Process Scheduling:
Allow ef cient use of CPU resources for concurrent tasks.
• Virtual Memory Management:
Provides abstraction of physical memory, aiding in resource allocation.
• Inter-Process Communication (IPC):
Mechanisms such as sockets, shared memory, and message passing facilitate distributed
coordination.
These OS features help in managing resources and processes ef ciently across a distributed
environment.
7. Distributed Objects
De nition and Role:
Distributed objects are software components that can be invoked remotely. They encapsulate data
and behavior, promoting modular design.
Importance:
8
fi
fi
fi
fi
2022UCI8068 Ravi S Pandey CIOT
• Modularity:
Breaks down complex applications into manageable components.
• Interoperability:
Facilitates communication between heterogeneous systems by using standardized
interfaces.
This modular approach simpli es development and enhances reusability across distributed
systems.
8. Common Object Request Broker Architecture (CORBA)
Overview:
CORBA is a standard that enables communication among distributed objects across diverse
platforms.
Key Components:
• Object Request Broker (ORB):
Manages communication and request dispatching between clients and remote objects.
• Interface De nition Language (IDL):
Speci es the interfaces that objects expose, independent of programming languages.
• Object Adapters:
Bridge between the ORB and the application objects, managing requests and responses.
CORBA ensures interoperability by standardizing the way distributed objects communicate
across different systems.
9. Enterprise JavaBeans (EJB)
Function:
EJB is a server-side component architecture designed for building scalable, distributed enterprise
applications.
Architectural Advantages:
• Scalability:
Supports dynamic load balancing and clustering.
• Transaction Management:
Provides built-in support for complex transactions.
• Persistence Support:
Facilitates seamless integration with databases.
EJB abstracts many of the underlying complexities of distributed computing, allowing developers
to focus on business logic.
9
fi
fi
fi
2022UCI8068 Ravi S Pandey CIOT
10. Fractal Architecture in Distributed Systems
Concept:
Fractal architecture is characterized by self-similarity, where the system is built from smaller,
similarly structured components that replicate the overall design.
Promoted Bene ts:
• Scalability:
Each component can scale independently, allowing the system to grow organically.
• Flexibility:
Reusable design patterns simplify modi cations and maintenance.
• Modularity:
Encourages a design where components can be developed, tested, and deployed
independently.
In practice, fractal architectures are used to build systems that need to adjust dynamically to
changing loads and requirements, ensuring both high performance and resilience.
10
fi
fi