UNIT-1 What Is: Q1: Distributed System? or Why Would You Design A System As A Distributed System
UNIT-1 What Is: Q1: Distributed System? or Why Would You Design A System As A Distributed System
INTRODUCTION
NOV-DEC 2022
For Example- when you use google or Netflix, the service you use is powered by
many servers (computers) all over the world working together to quickly deliver the
results or stream videos. This setup makes things faster, more reliable, and able to
handle large amount of data or users at once.
Key benefits of DS include:
Distributed systems offer several advantages, making them a popular choice for
modern applications. Here are the key benefits explained simply:
1. Scalability
• Distributed systems can easily grow by adding more machines or nodes. This
helps handle more users or data without overloading a single machine.
• It can handle more tasks by adding more computers.
2. Reliability
• If one machine fails, others can take over. This ensures the system keeps
running smoothly, reducing downtime.
3. Performance
• Tasks are divided among multiple machines, so they get done faster. This
improves the overall speed and efficiency of the system.
4. Flexibility
• Different parts of the system can run on different types of machines. This
makes it easier to use resources efficiently.
5. Cost-effectiveness
• Instead of one expensive supercomputer, you can use multiple affordable
machines to get similar results.
6. Fault Tolerance
• If one computers fails then others can continue the work.
7. Geographical Distribution
• Machines can be located in different places, allowing users from all over the
world to access the system quickly and reliably.
8. Resource Sharing
• Distributed systems let machines share their resources, like storage or
computing power, for better utilization.
9. Speed
• By Spreading out tasks, things get done faster.
Characteristics of a Distributed System:
1. Multiple Nodes
o A distributed system consists of multiple nodes (computers, servers, or
devices), each performing a specific task.
2. Coordination
o Nodes coordinate with each other to complete tasks, often through
communication protocols like HTTP, RPC, or gRPC.
3. Shared Goals
o All nodes work together to achieve common objectives, like processing
user requests or storing large amounts of data.
4. Transparency
o A good distributed system hides its complexity from users. For instance,
users don’t need to know which server processes their request.
1. Hardware Nodes:
o Physical devices like computers, servers, or IoT devices.
2. Network:
o A communication channel (e.g., the Internet or LAN) connecting the
nodes.
3. Middleware:
o Software that manages communication, coordination, and data sharing
between nodes.
4. Applications:
o Programs or services running on the system, like cloud storage,
databases, or e-commerce platforms.
1. Scalability: DS can handle more complexity and tasks by adding more computer
to the network the efficiency of the system should be increased.
2. Reliability: If one machine fails, others can take over. This ensures the system
keeps running smoothly, reducing downtime.
3. Performance: By spreading out the tasks into multiple computers the system can
work faster and the system performance should be increased.
6. Hide Complexity: Make it easy for users by hiding how the system works behind
the scenes, like where data is stored or how it’s managed.
7. Transparency: Let users access data or services from anywhere without worrying
about where they are physically stored.
8. Handle Growth: Add more computers or upgrade them to handle more users or
bigger workloads easily.
9. Fault Tolerance: Stay operational even if some computers or parts fail, so users
don’t face interruptions.
10. Share Resources: Allow multiple people to share data, storage, or processing
power without issues.
11.Work Faster: Split work across multiple computers to finish tasks quickly and
respond to users faster.
12. Flexible: Let the system grow, change, or update parts without affecting the rest
of it.
14. Security: Protect data and communication from hackers, and allow only
authorized people to access it.
16. Support Variety: Work with different types of computers, operating systems,
and networks to ensure everything connects and works together.
Physical Model
The physical model explains the hardware parts of a distributed system. It includes
computers, devices, and their connections. This model helps in designing, managing,
and checking the system’s performance.
1. Client-Server Model
This model is centralized. It has clients that request services and servers that
respond by providing those services. Communication happens through a
request-response process.
o Works using protocols like TCP/IP and HTTP.
o Common in web services, cloud computing, and database systems.
2. Peer-to-Peer (P2P) Model
This is a decentralized system where all devices (called peers) are equal in
capability. Peers can both request and provide services.
o Peers communicate directly with each other without a central server.
o The system is flexible as peers can join or leave easily.
o Example: BitTorrent for file sharing.
3. Layered Model
This model organizes the system into multiple layers. Each layer provides a
specific service and interacts only with its neighbouring layers using
predefined rules.
o Simplifies complexity by separating concerns between layers.
o Creates a clear structure for the system.
o Example: The OSI model for networking.
4. Microservices Model
This model splits a large application into smaller, independent services. Each
service focuses on one function and runs separately.
o Services are independently developed, deployed, and scaled.
o Makes the system easier to maintain and more scalable.
o Example: Online shopping platforms with separate services for
payments, orders, and user accounts.
3. Fundamental Model
The fundamental model in distributed computing is a basic framework that helps us
understand the key features of distributed systems. It focuses on the core components
needed to explain how distributed systems work. There are three main types of
fundamental models:
1. Interaction Model
This model explains how different processes in a distributed system communicate
and work together. Key components include:
• Message Passing:
2. Failure Model: Defines the types of failures that can occur in the system (e.g.,
network failures, node crashes, message loss) and how the system responds.
• Latency: Some tasks might take longer due to physical distance or network issues,
slowing down the system.
• Data Consistency: Ensuring all parts of the system have the same up-to-date
information can be challenging, especially when updates happen in different places.
• Fault Tolerance: Parts of the system may fail (e.g., a server crashes), so the system
needs a way to keep working or recover quickly.
• Scalability: As more computers or users join the system, it can become harder to
manage performance and resources efficiently.
• Security: More computers mean more points that can be vulnerable to attacks, so
securing the system is more complex.
• Synchronization: Keeping clocks or data synchronized across different machines
can be tough, as each machine may run at slightly different speeds.
Concurrency: Multiple tasks happening at the same time can cause issues like data
conflicts or resource competition.
Network Congestion
• The system’s performance can degrade when too many messages are sent over
the network, causing delays and reduced throughput.
Load Balancing
• Efficiently distributing workloads across nodes to prevent overloading certain
parts of the system while others remain idle.
Network Partitioning
• Network failures can split the system into isolated parts, making it difficult for
components to communicate, impacting system reliability.
Availability
• The system must remain available even during failures, meaning users should
be able to access the system, but this may conflict with consistency in some
cases.
Data Integrity
Ensuring that data remains correct and consistent across all distributed components
can be a challenge, especially during network failures.
A distributed application is a program that runs on more than one machine and
communicates through a network. It consists of separate parts that execute on
different nodes of the network and cooperate in order to achieve a common goal. It
uses Client-Server Model.
DCE Architecture
The highest privileges within a cell are assigned to a role called DCE
cell administrator which has control over all system services within the network,
remotely. It has privileges over all resources within a Distributed Computing
Environment cell.
Advantages of DCE:
• Security
• Lower Maintenance Cost
• Scalability and Availability
• Reduced Risks
• Fault Tolerance: Through replication and error handling, DCE ensures that
the system remains operational even when parts of it fail.
Key Characteristics:
o Direct: Messages are sent directly between processes, often using their
addresses or identifiers.
o Indirect: Messages are sent through an intermediary, such as a message
queue or broker.
3. Reliability:
Message passing describes the method by which nodes or processes interact and
share information in distributed systems. Message passing can be divided into two
main categories according to the sender and reciever’s timing and synchronization:
• Advantages:
o Ensures precise synchronization between communicating entities.
o Simplifies error handling as the sender knows when the message has
been successfully received or processed.
• Disadvantages:
o May introduce latency if the receiver is busy or unavailable.
o Synchronous blocking can reduce overall system throughput if many
processes are waiting for responses.
• Advantages:
o Enhances system responsiveness and throughput by allowing processes
to execute concurrently.
o Allows for interactions that are loosely connected, allowing processes
to process messages at their own speed.
• Disadvantages:
o Requires additional mechanisms (like callbacks or event handlers) to
manage responses or coordinate actions.
o Handling out-of-order messages or ensuring message delivery
reliability can be more complex compared to synchronous
communication.
3. Unicast Messaging
Unicast messaging is a one-to-one communication where a message is sent from a
single sender to a specific receiver. The key characteristics include:
• Direct Communication: The message is targeted at a single, specific node or
endpoint.
• Efficiency for Point-to-Point: Since only one recipient receives the message,
resources are efficiently used for direct, point-to-point communication.
• Advantages:
o Optimized for targeted communication, as the message is only sent to
the intended recipient.
o Minimizes network load compared to group messaging, as it doesn’t
broadcast to unnecessary nodes.
• Disadvantages:
o Not scalable for group communications; sending multiple unicast
messages can strain the system in larger networks.
o Can increase the complexity of managing multiple unicast connections
in large-scale applications.
4. Multicast Messaging
Multicast messaging enables one-to-many communication, where a message is sent
from one sender to a specific group of receivers. The key characteristics include:
• Group-Based Communication: Messages are delivered to a subset of nodes
that have joined the multicast group.
• Efficient for Groups: Saves bandwidth by sending the message once to all
nodes in the group instead of individually.
• Advantages:
o Reduces network traffic by sending a single message to multiple
recipients, making it ideal for content distribution or group updates.
o Scales efficiently for applications where data needs to reach specific
groups, like video conferencing or online gaming.
• Disadvantages:
o Complex to implement as nodes need mechanisms to manage group
memberships and handle node join/leave requests.
o Not all network infrastructures support multicast natively, which can
limit its applicability.
5. Broadcast Messaging
Broadcast messaging involves sending a message from one sender to all nodes
within the network. The key characteristics include:
• Wide Coverage: The message is sent to every node, ensuring that all nodes
in the network receive it.
• Network-Wide Reach: Suitable for announcements, alerts, or updates
intended for all nodes without targeting specific ones.
• Advantages:
o Guarantees that every node in the network receives the message, which
is useful for critical notifications or status updates.
o Simplifies dissemination of information when all nodes need to be
aware of an event or data change.
• Disadvantages:
o Consumes significant network resources since every node, regardless
of relevance, receives the message.
o Can lead to unnecessary processing at nodes that don’t need the
message, potentially causing inefficiency.
Marshalling in a distributed system refers to the process of converting an object or data structure
into a format that can be transmitted over a network or stored for later use. It is a critical aspect of
remote communication, ensuring that data can be exchanged between processes running on
different machines.
In the context of distributed systems, marshalling is essential for sending complex data structures,
such as objects, lists, or dictionaries, between a client and a server using a communication protocol.
Marshalling Process:
1. Purpose of Marshalling:
o To enable data exchange between distributed systems.
o To ensure compatibility across different platforms and programming languages.
o To convert in-memory objects or data structures into a transferable format.
2. Steps in Marshalling:
o Serialization:
▪ The object or data structure is transformed into a sequence of bytes or a
network-compatible format.
▪ For example, in Java, an object is serialized into a byte stream using
interfaces like Serializable.
o Packaging:
▪ The serialized data is packaged with metadata, such as the type of data,
length, or encoding, to aid in deserialization.
o Transmission:
▪ The packaged data is transmitted across the network to the receiving end.
Steps in Marshalling:
3. Unmarshalling:
o This is the reverse process of marshalling.
o The serialized data is received, unpackaged, and converted back into the original
object or data structure.
o This ensures that the receiving system can reconstruct and understand the transmitted
data.
• Platform Independence: Different systems may have different ways of representing data.
Marshaling allows data to be standardized for transmission.
• Complex Data Handling: Marshaling enables complex data structures, like objects or
nested lists, to be transmitted easily between different systems.
• Network Communication: Data must be marshaled to send it as a network packet, ensuring
that both the sender and receiver understand the data format.
Challenges in Marshalling:
• Platform Heterogeneity:
o Different systems may have varied data formats type representations.
• Efficiency:
o Serialization can be computationally expensive and add overhead to the
communication process.
• Security:
o The serialized data may be vulnerable to tampering or injection attacks if not
properly secured.
• Complexity:
o Handling complex data structures like nested objects, arrays, or graphs can
complicate marshalling.
Example of Marshalling:
Let us consider a simple example of marshalling involving a client-server
architecture where client needs to send the request to server application to access
the user information.
Advantages of Marshalling:
• Interoperability: Enables communication across different systems and
platforms.
• State Preservation: Objects can be saved and restored later.
• Ease of Data Sharing: Simplifies the process of sending complex data
structures.
Disadvantages of Marshalling:
• Performance Overhead: Serialization and deserialization processes can be
slow.
• Compatibility Issues: Different systems may have issues understanding each
other's formats without a common standard.
• Security Risks: Exposed serialized data can be exploited by attackers.
4. JSON or XML:
o Common formats for text-based serialization, often used in RESTful
APIs.
5. Apache Thrift:
o A cross-language serialization library.
Applications:
• Remote Procedure Calls (RPC): Sending method arguments and receiving
results.
• Distributed Systems: Sharing data between nodes.
• Web APIs: REST and GraphQL use JSON/XML for marshalling requests
and responses.
Q3: Explain Remote Procedure Call (RPC) Model, with suitable example.
Key Concepts:
Example:
Imagine an online banking system where a client app on a user's device requests the
server to fetch the account balance.
1. Client-side:
o The user clicks "Check Balance" on their app. The app calls a
checkBalance() function.
o This call is intercepted by the client stub, which prepares a message
with the user ID and sends it to the server.
2. Server-side:
o The server stub receives the message, extracts the user ID, and calls the
actual checkBalance() function on the server.
o The server fetches the balance from the database.
3. Response:
o The server stub sends the balance back to the client stub.
o The client stub processes the response and displays the balance to the
user.
Advantages of RPC:
Disadvantages:
Working of a RPC
Steps in RPC Working:
o The client stub is a piece of code that acts as a placeholder for the
remote procedure. When the client calls the procedure, the client stub
intercepts the call.
o The client stub marshals (packs) the procedure arguments and prepares
them to be sent over the network to the server. Marshaling involves
converting the data into a format that can be transmitted (like
converting data into a byte stream).
o It also creates a network request and sends it over the network to the
server.
3. Network Communication
o The server stub receives the incoming network message and extracts
(unmarshals) the procedure parameters.
o The server stub then invokes the corresponding procedure on the
server, passing it the parameters from the client.
o The server executes the procedure with the given parameters, just like
any normal local procedure call.
o After execution, the server prepares the result (or any error message) to
send back to the client.
o The client application receives the results from the remote procedure
and continues its normal execution as if the function was executed
locally.
Q4: What are the main issues in designing a Transparent RPC mechanism?
Designing a transparent RPC mechanism (where the remote procedure call appears
to be a local function call) comes with several challenges. Here are the main issues
faced in creating such a system:
1. Network Latency
• Problem: When calling a remote function, there’s a delay because the data has
to travel over the network.
• Challenge: It’s hard to reduce this delay because network speed can vary.
• Solution: Use faster communication methods, cache data, and minimize the
number of remote calls.
• Problem: Remote calls can fail if there are network issues, server crashes, or
timeouts.
• Challenge: Making the system reliable so that it can handle these failures.
• Solution: Add retry mechanisms, timeouts, and error handling to recover from
issues.
3. Data Serialization/Deserialization
• Problem: Data has to be converted (serialized) into a format that can be sent
over the network, and then converted back (deserialized) on the other side.
• Challenge: Different computers may use different formats, so packing and
unpacking data can be tricky.
• Solution: Use common data formats like JSON or Protocol Buffers to make
sure the data can be read everywhere.
4. Heterogeneity
• Problem: The client and server might use different operating systems,
hardware, or software.
• Challenge: Ensuring the RPC system works across different types of systems.
• Solution: Make the system platform-independent and use standard protocols
and formats.
5. Security
• Problem: Since RPC involves sending data over the network, it could be
intercepted or tampered with.
• Challenge: Ensuring that data is secure and can’t be accessed by unauthorized
users.
• Solution: Use encryption (like TLS/SSL) and authentication methods (like
API keys) to secure the communication.
• Problem: RPC should make remote calls appear just like local ones, without
exposing the complexities of how they work.
• Challenge: Hiding all the technical details of remote communication while still
handling errors, delays, and retries.
• Solution: The system should handle communication and errors automatically,
so developers don’t have to worry about them.
• Problem: Remote calls take more time due to network, data conversion, and
processing.
• Challenge: Remote calls are slower than local ones, and this can affect
performance.
• Solution: Reduce the number of remote calls and optimize data transfer.
8. Scalability
• Problem: As the number of users or servers increases, it’s harder to keep the
RPC system efficient.
• Challenge: Ensuring the system can handle many requests at once without
slowing down.
• Solution: Use load balancing (distribute the work), and break the system into
smaller, manageable parts.
Each of these challenges needs careful planning and solutions to build an RPC system
that is fast, reliable, and transparent for users and developers.
Explicit Addressing
Implicit Addressing
1. Explicit Addressing
In explicit addressing, the program or instruction clearly tells the computer where to
find the data. The memory location (address) is directly mentioned in the
instruction.
Example:
If an instruction says "Add the value from address 500," it’s explicitly telling the
computer to go to memory location 500 to get the value.
Advantages:
• You know exactly where the data is, so you have full control over it.
• It’s clear and specific.
Disadvantages:
• It can be less flexible because you always need to specify a location.
• If you need to change the memory location, you may have to update multiple
instructions.
2. Implicit Addressing
In implicit addressing, the program doesn’t tell the computer where to find
the data. Instead, it assumes the data is in a specific place, like a register or a
default memory area (e.g., the stack).
Example:
If an instruction says "Add the value," it might be understood that the value is
already in a special place, like a register called "accumulator," without the need to
specify it.
Advantages:
• The instructions are simpler and shorter because you don’t need to mention
memory locations every time.
• It makes things faster and less complicated.
Disadvantages:
• You don’t have full control over where the data is, so it’s less flexible.
• It can be harder to manage if you have many data locations or complex tasks.
1. Physical Addressing
2. Logical Addressing
Logical addressing (also known as virtual addressing) refers to the address used
by a program in its code, which does not directly correspond to physical memory.
The operating system and hardware use a mechanism called paging or
segmentation to map these logical addresses to physical addresses.
How it works:
• Each process is given its own address space (logical addresses), which is
separate from the physical memory.
• A memory management unit (MMU) is used to convert logical addresses to
physical addresses through address translation.
Advantages:
• Isolation: Processes can’t directly access the memory of other processes,
enhancing security and stability.
• Virtual memory: Logical addressing allows the use of more memory than
physically available by swapping data in and out of physical memory.
• Flexibility: The operating system can manage memory more efficiently,
providing features like paging and memory protection.
Disadvantages:
• Overhead: The translation from logical to physical addresses introduces
additional computational overhead.
• Complexity: Requires more complex memory management systems like page
tables, which add system complexity.
3. Segmented Addressing
How it works:
• The address is divided into two parts: a segment number and an offset.
• The segment number points to a specific segment in memory, and the offset
tells you where the data is within that segment.
• The operating system and the hardware use a segment table to map segment
numbers to actual physical memory addresses.
Advantages:
• Modularity: Programs are split into logical segments like code, data, and
stack, making it easier to manage large programs.
• Protection: Each segment can have its own access permissions (read, write,
execute), increasing security.
• Efficiency: Segmented memory helps with better memory utilization, as you
can allocate memory based on the program's specific needs.
Disadvantages:
• Complexity: Segment management can be complex, as the system must
handle various segments and ensure the correct mapping of segments.
• Fragmentation: If segments are not managed well, it can lead to
fragmentation, which can waste memory.
Summary of Differences:
Mechanism Description Advantages Disadvantages
Direct access to
Physical No process isolation,
physical memory Simple and fast
Addressing limited flexibility.
addresses.
Uses virtual memory Process isolation,
Logical Translation overhead,
with address virtual memory,
Addressing complexity.
translation. flexibility
Memory is divided Modularity,
Segmented Complexity, potential
into segments (e.g., protection, efficient
Addressing fragmentation.
code, data). allocation
Each addressing mechanism has its own use cases depending on the system
requirements, such as speed, security, and memory management capabilities.
The RMI provides remote communication between the applications using two
objects stub and skeleton.
RMI uses stub and skeleton object for communication with the remote object.
A remote object is an object whose method can be invoked from another JVM. Let's
understand the stub and skeleton objects:
Key Points:
In this example, The client application need only two files, remote interface and
client application. In the rmi application, both client and server interacts with the
remote interface. The client application invokes methods on the proxy object, RMI
sends the request to the remote JVM. The return value is sent back to the proxy object
and then to the client application.
RMI Example
1. Easy to Use:
o RMI makes it simple to connect computers over a network. It hides the
complexity of sending data, so you don’t have to worry about the
technical details.
2. Object-Oriented:
o You can work with objects just like you would in regular Java programs.
This makes it easier to design distributed applications.
3. Automatic Data Handling:
o RMI automatically converts objects into a format that can be sent over
the network (serialization) and back again. You don’t need to manually
handle data conversions.
4. Built-in Security:
o RMI comes with security features that help protect your application,
such as making sure that only trusted clients can access the remote
services.
5. Scalable:
o You can easily add more servers as your application grows, without
changing the client code.
6. Cross-Platform (with Java):
o Since RMI works with Java, it can run on different operating systems,
like Windows and Linux, without any special changes.
Disadvantages of RMI:
It is a mechanism that manages memory across multiple nodes and makes inter-
process communications transparent to end-users. The applications will think that
they are running on shared memory.
DSM is a mechanism of allowing user processes to access shared data without using
inter-process communications. In DSM every node has its own memory and provides
memory read and write services and it provides consistency protocols.
The distributed shared memory (DSM) implements the shared memory model in
distributed systems but it doesn’t have physical shared memory. All the nodes share
the virtual address space provided by the shared memory model. The Data moves
between the main memories of different nodes.
Distributed Shared Memory (DSM) is like a shared notebook for computers that are
working together. Even though each computer (or node) has its own separate
memory, DSM makes it look like they are all writing and reading from the same
notebook. This helps the computers share information easily without worrying about
where the data is stored.
1. On-Chip Memory
• The data is present in the CPU portion of the chip.
• Memory is directly connected to address lines.
• On-Chip Memory DSM is expensive and complex.
2. Bus-Based Multiprocessors
• A set of parallel wires called a bus acts as a connection between CPU and
memory.
• Accessing of same memory simultaneously by multiple CPUs is prevented by
using some algorithms.
• Cache memory is used to reduce network traffic.
3. Ring-Based Multiprocessors
• There is no global centralized memory present in Ring-based DSM.
• All nodes are connected via a token passing ring.
• In ring-bases DSM a single address line is divided into the shared area.
1. Performance Overhead:
o Consistency maintenance and synchronization protocols can slow down
the system compared to local memory access.
2. Complexity in Consistency Models:
o Ensuring consistency across nodes is challenging and may lead to
increased latency.
3. Network Latency:
o Accessing remote memory can be significantly slower than accessing
local memory, leading to potential bottlenecks.
4. Limited Scalability in Some Systems:
o Performance might degrade as the number of nodes increases, especially
if the consistency protocol is not efficient.
5. Debugging Difficulties:
o Distributed nature makes debugging harder since issues can arise from
network delays or consistency problems.
6. Higher Development Costs for Some Applications:
o While DSM simplifies certain aspects, applications requiring fine-tuned
performance might need additional optimizations.
Q2: What are the three main approaches for designing a DSM
system?
Here’s a simplified explanation of the three main approaches to designing a
Distributed Shared Memory (DSM) system:
1. Hardware-Based DSM
• What it is: The system's hardware (like the processor or memory controller)
manages shared memory.
• How it works: Uses hardware rules to make sure all connected computers see
the same memory data.
• Pros:
o Super fast and efficient.
o Easy for programmers since the hardware handles everything.
• Cons:
o Very expensive to build.
o Hard to make changes or adapt.
• Best for: Systems needing high speed and performance, like powerful servers
or supercomputers.
2. Software-Based DSM
3. Hybrid DSM
• What it is: A mix of hardware and software to get the best of both worlds.
• How it works: Hardware does basic tasks quickly, and software manages
higher-level memory sharing.
• Pros:
o Balances speed, cost, and flexibility.
o Makes good use of both hardware and software strengths.
• Cons:
o More complicated to design.
o The system's performance depends on how well the hardware and
software work together.
• Best for: Systems needing a balance of performance and affordability.
In short, hardware-based DSM is fast but costly, software-based DSM is flexible but
slower, and hybrid DSM is a middle ground that combines the two.
Q3: Describe the process migration features.
It’s the ability to move a running program (called a process) from one computer to
another in a network of connected computers, while keeping it running smoothly and
ensuring its data remains correct.
• The process typically involves saving the current state of the process, including
its memory and execution context, transferring this state to the target node, and
then resuming execution on the new node.
Why is it Important?
1. Balance the load: Prevent one computer from being overloaded while others
are idle.
2. Handle failures: Move programs away from computers that are about to fail.
3. Use resources efficiently: Distribute programs across computers to improve
performance.
Key Features
Challenges
1. Overhead: Transferring program data can take time and slow things down.
2. Synchronization: Making sure the program’s data and state are always up-to-
date.
3. Latency: Delays during migration can affect time-sensitive tasks.
4. Security: Protecting program data during the move.
• Static Migration:
o Definition: The entire process is moved to a new node, and
it starts execution from the point where it was suspended.
o Pros: Simple to implement; the process state is saved and
restored in full.
o Cons: High overhead due to the transfer of the entire
process state; not ideal for processes with large memory
footprints.
• Dynamic Migration:
o Definition: The process migrates while it is still running,
often by migrating its active state incrementally.
o Pros: Reduces downtime and allows for more fluid load
balancing.
o Cons: More complex to manage; requires sophisticated
mechanisms to maintain consistency and manage
intermediate states.
• Preemptive Migration:
o Definition: The process is temporarily paused, its state is
saved, and it is then moved to a new node where it resumes
execution.
o Pros: Allows for planned migrations with minimal
disruption.
o Cons: The process experiences a temporary halt, which
may affect performance.
• Non-Preemptive Migration:
o Definition: The process continues execution until it reaches
a natural stopping point or checkpoint before migration
occurs.
o Pros: Avoids disruption during migration; can be more
efficient for long-running processes.
o Cons: Requires processes to reach suitable stopping points,
which may not always align with optimal migration times.
• Incremental Migration:
o Definition: The process state is migrated incrementally, in
stages, rather than all at once.
o Pros: Can reduce the impact of migration on system
performance and allows for smoother transitions.
o Cons: More complex to implement; requires careful
coordination to maintain process state consistency.
1. Memory Consistency
• Issue: Making sure all nodes see the same data in shared memory.
2. Memory Coherence
• Issue: Managing how memory blocks are shared when multiple nodes use the
same data.
• Methods:
o Write-Invalidate: Deletes other copies when one node writes to the
data.
o Write-Update: Updates all copies whenever one node writes.
• Challenge: Choosing a method that reduces communication between nodes.
4. Synchronization
• Issue: Coordinating access to shared data to prevent errors.
• Methods: Using locks or barriers to control which node can update data.
• Challenge: Making synchronization fast and scalable for many nodes.
5. Communication Overhead
• Issue: DSM systems rely on sending messages between nodes to share data or
updates.
• Challenge: Reducing the number and size of these messages to improve
performance.
6. Granularity
7. Scalability
• Issue: Ensuring DSM works well even as more nodes are added.
• Challenge: Designing protocols that handle many nodes without slowing
down.
8. Fault Tolerance
9. Heterogeneity
• Issue: DSM must work across nodes with different hardware or operating
systems.
• Challenge: Making the system flexible enough to handle various
configurations.
10. Security
11. Transparency
• Issue: Making the memory appear as one big shared space, hiding the
complexity of distribution.
• Challenge: Keeping this illusion while ensuring efficient operation.
• Issue: When unrelated data in the same memory block is updated, causing
unnecessary synchronization.
• Challenge: Reducing such cases to improve performance.
Sequential consistency is a consistency model that ensures that the order in which
operations are executed by different processes in the system appears to be consistent
with a global order of execution. It ensures that the result of any execution of a
distributive system is the same as if the operations of all the processes in the system
were executed in some sequential order, one after the other.
• It means that all the processes or threads in a system see memory operations
(reads and writes) in the same order.
• Imagine everyone in a room watching a play. Even if the play happens in a
random order, everyone agrees on the sequence of events.
How it Works
1. Program Order: Each thread follows the order of operations written in its
program. For example, if Thread A writes X = 1 and then reads Y, it will
always do these actions in this order.
2. Global Agreement: All threads agree on the order in which everyone's
operations happened, even if the actual order is random.
Example
Say there are two threads, A and B, and two shared variables, X and Y, both starting
at 0:
• Thread A:
1. Write X = 1
2. Read Y
• Thread B:
1. Write Y = 1
2. Read X
Why is it Useful?
Drawbacks
• Slower Performance: Ensuring a global order can slow down the system,
especially with many threads or processes.
• Not Always Practical: Modern systems often use weaker consistency models
for better speed and scalability.
In short, sequential consistency makes memory behavior simple and predictable but
can come at the cost of performance.
1. Strict Consistency
2. Sequential Consistency
3. Causal Consistency
4. Eventual Consistency
5. Monotonic Read Consistency
6. Monotonic Write Consistency
7. Strong Consistency
8. Weak Consistency
9. Release Consistency
RELEASE CONSISTENCY
Simple Example:
Between the time P1 acquires the data and releases it, P2 might see old data. But once
P2 acquires the data after the release, it gets the updated version.
• Sequential Consistency: Every process sees operations in the same order. It’s
stricter than release consistency.
• Eventual Consistency: Even more relaxed than release consistency, where all
replicas of data will eventually become the same, but not immediately.