1.Infer code migration
Code migration in distributed systems is the process of transferring software code
from one machine to another within the system, typically to achieve goals such
as load balancing, fault tolerance, and dynamic reconfiguration. The process
involves identifying the need for migration, identifying the code to be migrated,
creating a migration plan, preparing the target system, migrating the code,
updating the system configuration, and testing the migrated code. Code migration
can be achieved using a variety of techniques, including remote procedure calls,
message passing, and code mobility.
2.Differentiate logical clock and physical clock
In a distributed system, logical and physical clocks are used to order events and
ensure consistency.
A physical clock is a clock that measures the time using physical phenomena
such as oscillations in a quartz crystal. Physical clocks are used to measure the
absolute time and are synchronized to a standard time source such as a GPS
satellite.
A logical clock, on the other hand, is a clock that is used to order events in a
distributed system. Logical clocks are not synchronized to a standard time source
and do not measure absolute time. Instead, they assign timestamps to events based
on the order in which they occur.
In a distributed system, it is often not possible to synchronize physical clocks
across all machines due to network latency and other factors. Logical clocks
provide a way to order events in a consistent manner even in the absence of
physical clock synchronization.
In summary, physical clocks measure absolute time using physical phenomena,
while logical clocks are used to order events in a distributed system based on their
relative occurrence. Logical clocks are not synchronized to a standard time source
and are often used in situations where physical clock synchronization is not
possible.
3.Interpret distributed deadlock system models
A distributed deadlock system model in distributed systems is a model that
describes a situation where multiple processes in a distributed system are
deadlocked, meaning that each process is waiting for a resource that is currently
held by another process in the system.
In a distributed deadlock system model, processes may be located on different
machines or nodes in the system, and each process may be holding resources that
are needed by other processes in the system. If the processes are unable to release
the resources they hold, a deadlock can occur.
a distributed deadlock system model in distributed systems describes a situation
where multiple processes are deadlocked, and detecting and resolving deadlocks
requires specialized algorithms and protocols. To prevent deadlocks, techniques
such as resource allocation algorithms and distributed lock management protocols
can be used.
4.Contrast Happened Before Relationship with an example
The "happened before" relationship is a concept used in distributed systems to
define a partial ordering of events that occur in the system. It helps to establish a
causal relationship between events and can be used to reason about consistency
and concurrency control in distributed systems.
The happened before relationship is defined as follows: Event A happened before
Event B if either Event A is a direct cause of Event B or if Event A and Event B
are concurrent but Event A is observed before Event B by some process in the
system.
For example, consider a distributed system with two processes, Process A and
Process B. If Process A sends a message to Process B, we can say that the sending
of the message by Process A happened before the receipt of the message by
Process B. Similarly, if Process A modifies a shared data item, and then Process
B reads the modified data, we can say that the modification by Process A
happened before the read by Process B.
5.Give the importance of election algorithm with proper example
Election algorithms are important in distributed systems because they help to
establish a leader or coordinator among a set of processes, which is essential for
achieving coordination and maintaining consistency in the system. An example
of the importance of election algorithms can be seen in a distributed database
system, where multiple nodes may be responsible for storing and processing data.
For example, consider a distributed database system where multiple nodes are
responsible for processing user requests and storing data. If a user sends a request
to update a piece of data, it is important to ensure that the update is propagated
correctly throughout the system and that all nodes have a consistent view of the
data.
An election algorithm can be used to select a leader node that is responsible for
coordinating access to the database and ensuring that updates are applied
consistently. The leader node can maintain a centralized view of the database and
can be responsible for resolving conflicts and ensuring that updates are applied
in a consistent and coordinated manner.
6.List out the strategies to handle deadlocks
Deadlocks can occur in distributed systems when multiple processes compete for
resources and are unable to proceed because each process is waiting for a resource
that is held by another process. There are several strategies that can be used to
handle deadlocks in distributed systems, including:
1. Deadlock avoidance.
2. Deadlock detection.
3. Deadlock prevention.
4. Deadlock recovery.
5. Timeouts.
7.Compare communication and resource deadlock.
Communication deadlock and resource deadlock are two types of deadlocks that
can occur in distributed systems. While both types of deadlocks can cause system
failure and disruption, there are some key differences between them.
Communication deadlock occurs when two or more processes are waiting for
messages from each other that will never arrive.
Resource deadlock, on the other hand, occurs when two or more processes are
waiting for resources that are held by other processes, and those processes are
themselves waiting for resources that are held by the first set of processes.
8.Draw the classification of mutual exclusion algorithms
Contention-based algorithms: In contention-based algorithms, processes
compete for access to a shared resource. These algorithms include:
Centralized algorithms: A single process acts as a centralized server and
coordinates access to the shared resource.
Distributed algorithms: Multiple processes collaborate to determine which
process can access the shared resource.
Token-based algorithms: In token-based algorithms, a token is passed
between processes to grant access to the shared resource. These algorithms
include:
Token ring algorithms: Processes are organized in a logical ring, and a token is
passed around the ring to grant access to the shared resource.
Token passing algorithms: Atoken is passed directly between processes to grant
access to the shared resource.
9.Mention the importance of synchronization in distributed systems.
Synchronization is essential in distributed systems to ensure that processes and
resources are properly coordinated, and that the system operates correctly and
efficiently. Here are some reasons why synchronization is important in distributed
systems:
Preventing conflicts: Distributed systems often involve multiple processes
accessing shared resources. Without proper synchronization, conflicts can occur
where two or more processes attempt to access the same resource simultaneously,
leading to data corruption or other errors.
Maintaining consistency: In a distributed system, data may be replicated across
multiple nodes to improve performance or provide fault tolerance.
Synchronization is necessary to ensure that these replicas remain consistent with
each other.
Achieving mutual exclusion: Mutual exclusion is a fundamental concept in
distributed systems, and synchronization is required to enforce it. Mutual
exclusion ensures that only one process at a time can access a shared resource,
preventing conflicts and maintaining consistency.
Enforcing ordering: Distributed systems often involve events occurring at
different times on different nodes. Synchronization is necessary to enforce
ordering constraints, ensuring that events occur in the correct sequence.
Facilitating communication: Synchronization can also help facilitate
communication between processes in a distributed system. For example, a
synchronization mechanism can be used to ensure that a sender process waits
until a receiver process is ready before sending a message.
In summary, synchronization is a critical aspect of distributed systems, enabling
processes and resources to be properly coordinated and ensuring the correct and
efficient operation of the system.

Distributed systems_important 2marks.docx

  • 1.
    1.Infer code migration Codemigration in distributed systems is the process of transferring software code from one machine to another within the system, typically to achieve goals such as load balancing, fault tolerance, and dynamic reconfiguration. The process involves identifying the need for migration, identifying the code to be migrated, creating a migration plan, preparing the target system, migrating the code, updating the system configuration, and testing the migrated code. Code migration can be achieved using a variety of techniques, including remote procedure calls, message passing, and code mobility. 2.Differentiate logical clock and physical clock In a distributed system, logical and physical clocks are used to order events and ensure consistency. A physical clock is a clock that measures the time using physical phenomena such as oscillations in a quartz crystal. Physical clocks are used to measure the absolute time and are synchronized to a standard time source such as a GPS satellite. A logical clock, on the other hand, is a clock that is used to order events in a distributed system. Logical clocks are not synchronized to a standard time source and do not measure absolute time. Instead, they assign timestamps to events based on the order in which they occur. In a distributed system, it is often not possible to synchronize physical clocks across all machines due to network latency and other factors. Logical clocks provide a way to order events in a consistent manner even in the absence of physical clock synchronization.
  • 2.
    In summary, physicalclocks measure absolute time using physical phenomena, while logical clocks are used to order events in a distributed system based on their relative occurrence. Logical clocks are not synchronized to a standard time source and are often used in situations where physical clock synchronization is not possible. 3.Interpret distributed deadlock system models A distributed deadlock system model in distributed systems is a model that describes a situation where multiple processes in a distributed system are deadlocked, meaning that each process is waiting for a resource that is currently held by another process in the system. In a distributed deadlock system model, processes may be located on different machines or nodes in the system, and each process may be holding resources that are needed by other processes in the system. If the processes are unable to release the resources they hold, a deadlock can occur. a distributed deadlock system model in distributed systems describes a situation where multiple processes are deadlocked, and detecting and resolving deadlocks requires specialized algorithms and protocols. To prevent deadlocks, techniques such as resource allocation algorithms and distributed lock management protocols can be used. 4.Contrast Happened Before Relationship with an example The "happened before" relationship is a concept used in distributed systems to define a partial ordering of events that occur in the system. It helps to establish a causal relationship between events and can be used to reason about consistency and concurrency control in distributed systems.
  • 3.
    The happened beforerelationship is defined as follows: Event A happened before Event B if either Event A is a direct cause of Event B or if Event A and Event B are concurrent but Event A is observed before Event B by some process in the system. For example, consider a distributed system with two processes, Process A and Process B. If Process A sends a message to Process B, we can say that the sending of the message by Process A happened before the receipt of the message by Process B. Similarly, if Process A modifies a shared data item, and then Process B reads the modified data, we can say that the modification by Process A happened before the read by Process B. 5.Give the importance of election algorithm with proper example Election algorithms are important in distributed systems because they help to establish a leader or coordinator among a set of processes, which is essential for achieving coordination and maintaining consistency in the system. An example of the importance of election algorithms can be seen in a distributed database system, where multiple nodes may be responsible for storing and processing data. For example, consider a distributed database system where multiple nodes are responsible for processing user requests and storing data. If a user sends a request to update a piece of data, it is important to ensure that the update is propagated correctly throughout the system and that all nodes have a consistent view of the data. An election algorithm can be used to select a leader node that is responsible for coordinating access to the database and ensuring that updates are applied consistently. The leader node can maintain a centralized view of the database and
  • 4.
    can be responsiblefor resolving conflicts and ensuring that updates are applied in a consistent and coordinated manner. 6.List out the strategies to handle deadlocks Deadlocks can occur in distributed systems when multiple processes compete for resources and are unable to proceed because each process is waiting for a resource that is held by another process. There are several strategies that can be used to handle deadlocks in distributed systems, including: 1. Deadlock avoidance. 2. Deadlock detection. 3. Deadlock prevention. 4. Deadlock recovery. 5. Timeouts. 7.Compare communication and resource deadlock. Communication deadlock and resource deadlock are two types of deadlocks that can occur in distributed systems. While both types of deadlocks can cause system failure and disruption, there are some key differences between them. Communication deadlock occurs when two or more processes are waiting for messages from each other that will never arrive. Resource deadlock, on the other hand, occurs when two or more processes are waiting for resources that are held by other processes, and those processes are themselves waiting for resources that are held by the first set of processes. 8.Draw the classification of mutual exclusion algorithms
  • 5.
    Contention-based algorithms: Incontention-based algorithms, processes compete for access to a shared resource. These algorithms include: Centralized algorithms: A single process acts as a centralized server and coordinates access to the shared resource. Distributed algorithms: Multiple processes collaborate to determine which process can access the shared resource. Token-based algorithms: In token-based algorithms, a token is passed between processes to grant access to the shared resource. These algorithms include: Token ring algorithms: Processes are organized in a logical ring, and a token is passed around the ring to grant access to the shared resource. Token passing algorithms: Atoken is passed directly between processes to grant access to the shared resource. 9.Mention the importance of synchronization in distributed systems. Synchronization is essential in distributed systems to ensure that processes and resources are properly coordinated, and that the system operates correctly and efficiently. Here are some reasons why synchronization is important in distributed systems: Preventing conflicts: Distributed systems often involve multiple processes accessing shared resources. Without proper synchronization, conflicts can occur where two or more processes attempt to access the same resource simultaneously, leading to data corruption or other errors.
  • 6.
    Maintaining consistency: Ina distributed system, data may be replicated across multiple nodes to improve performance or provide fault tolerance. Synchronization is necessary to ensure that these replicas remain consistent with each other. Achieving mutual exclusion: Mutual exclusion is a fundamental concept in distributed systems, and synchronization is required to enforce it. Mutual exclusion ensures that only one process at a time can access a shared resource, preventing conflicts and maintaining consistency. Enforcing ordering: Distributed systems often involve events occurring at different times on different nodes. Synchronization is necessary to enforce ordering constraints, ensuring that events occur in the correct sequence. Facilitating communication: Synchronization can also help facilitate communication between processes in a distributed system. For example, a synchronization mechanism can be used to ensure that a sender process waits until a receiver process is ready before sending a message. In summary, synchronization is a critical aspect of distributed systems, enabling processes and resources to be properly coordinated and ensuring the correct and efficient operation of the system.