Distributed 52
Distributed 52
FLAT TRANSACTIONS :
A flat transaction has a single initiating point(Begin) and a single end point(Commit or
abort). They are usually very simple and are generally used for short activities rather than
larger ones.
A client makes requests to multiple servers in a flat transaction. Transaction T, for
example, is a flat transaction that performs operations on objects in servers X, Y, and Z.
Before moving on to the next request, a flat client transaction completes the previous one.
As a result, each transaction visits the server object in order.
A transaction can only wait for one object at a time when servers utilize locking.
Flat Transaction
Nested Transaction
Whenever the Basic TO algorithm detects two conflicting operations that occur in an
incorrect order, it rejects the latter of the two operations by aborting the Transaction that
issued it. Schedules produced by Basic TO are guaranteed to be conflict serializable.
Already discussed that using Timestamp can ensure that our schedule will be deadlock
free.
One drawback of the Basic TO protocol is that Cascading Rollback is still possible.
Suppose we have a Transaction T 1 and T2 has used a value written by T 1. If T1 is aborted
and resubmitted to the system then, T 2 must also be aborted and rolled back. So the
problem of Cascading aborts still prevails. Let’s gist the Advantages and Disadvantages of
Basic TO protocol:
Timestamp Ordering protocol ensures serializability since the precedence graph will be
of the form:
Unicast Communication
Multicast communication involves sending a single message from one sender to multiple
receivers simultaneously within a network. It is particularly useful in distributed systems
where broadcasting information to a group of nodes is necessary:
Multicast lets a sender share a message with a specific group of people who want it.
This way, the sender can reach many people at once, which is more efficient than
sending separate messages.
This approach is often used to send updates to subscribers or in collaborative
applications where real-time sharing of changes is needed.
By sending data just once to a group, multicast saves bandwidth, simplifies
communication, and can easily handle a larger number of recipients.
Managing group membership is necessary to ensure reliable message delivery, and
multicast can run into issues if there are network problems that affect everyone in the
group.
3. Broadcast Communication
Broadcast communication involves sending a message from one sender to all nodes in
the network, ensuring that every node receives the message:
Broadcast Communication
Broadcast is when a sender sends a message to every node in the network without
targeting specific recipients.
Messages are delivered to all nodes at once using a special address designed for this
purpose.
It’s often used for network management tasks, like sending status updates, or for
emergency alerts that need to reach everyone quickly.
Broadcast ensures that every node receives the message without needing to specify
who the recipients are, making it efficient for sharing information widely.
It can cause network congestion in larger networks and raises security concerns since
anyone on the network can access the broadcast message, which might lead to
unauthorized access.
Reliable Multicast Protocols for Group Communication
Messages sent from a sender to multiple recipients should be delivered reliably,
consistently, and in a specified order. Types of Reliable Multicast Protocols include:
FIFO Ordering:
o Ensures that messages are delivered to all group members in the order they
were sent by the sender.
o Achieved by sequencing messages and delivering them sequentially to
maintain the correct order.
Causal Ordering:
o Preserves the causal relationships between messages based on their
dependencies.
o Ensures that messages are delivered in an order that respects the causal
dependencies observed by the sender.
Total Order and Atomicity:
o Guarantees that all group members receive messages in the same global
order.
o Ensures that operations based on the multicast messages (like updates to
shared data) appear atomic or indivisible to all recipients.
Scalability for Group Communication
Scalability and performance are vital for effective group communication in distributed
systems. It’s essential for the system to handle more nodes, messages, and participants
while still operating efficiently. Here’s a closer look at these important aspects:
1. Scalability
Scalability refers to the system’s ability to grow without losing efficiency. This includes:
Managing an increasing number of nodes or participants while keeping communication
smooth.
Handling more messages exchanged among group members, ensuring timely and
responsive communication.
Supporting connections across distant nodes or networks, which can introduce latency
and bandwidth issues.
2. Challenges in Scalability
As the group size grows, several challenges arise:
The management of group membership and message routing becomes more complex,
adding overhead.
The network must have enough bandwidth to support the higher traffic from a larger
group to avoid congestion.
Keeping distributed nodes consistent and synchronized gets more complicated as the
system scales.
3. Strategies for Scalability
To tackle these challenges, various strategies can be employed:
Partitioning and Sharding: Breaking the system into smaller parts can make
communication and management more manageable.
Load Balancing: Evenly distributing the workload across nodes helps prevent
bottlenecks and optimizes resource use.
Replication and Caching: Duplicating data or messages across nodes can lower
access times and enhance fault tolerance, aiding scalability.
Performance for Group Communication
Performance in group communication is crucial for optimizing message speed, resource
utilization, and addressing challenges like message ordering and concurrent access,
ensuring efficient collaboration in distributed systems.
1. Performance
In group communication, performance focuses on a few key areas:
It’s crucial to minimize the time it takes for messages to reach their intended recipients.
We want to enhance the rate at which messages are handled and sent out.
Efficient use of bandwidth, CPU, and memory helps keep communication fast and
effective.
2. Challenges in Performance
There are challenges that come with achieving high performance:
Making sure messages arrive in the right order can be tough, especially with strict
protocols.
Handling multiple users trying to access shared resources at the same time can lead to
slowdowns.
Communication needs to adjust based on changing conditions, like slow bandwidth or
lost packets.
3. Strategies for Improvement
To boost performance, consider these strategies:
Smart Routing: Using efficient routing methods can reduce delays by cutting down on
the number of hops messages take.
Asynchronous Communication: This allows senders and receivers to work
independently, improving responsiveness.
Pre-storing Data: Keeping frequently accessed messages or data ready can help
lower delays and speed up responses.
Challenges of Group Communication in Distributed Systems
Group communication in distributed systems comes with several challenges due to the
need to coordinate multiple nodes that may be spread out or connected through unreliable
networks. Key challenges include:
Reliability: Messages must reach all intended recipients, even during network failures
or node crashes, which can be complicated when nodes frequently join or leave.
Scalability: As the number of participants grows, managing communication effectively
becomes harder, leading to issues with bandwidth usage and processing delays.
Concurrency and Consistency: Keeping shared data consistent while allowing
simultaneous updates is tricky, requiring strong synchronization to avoid conflicts.
Fault Tolerance: The system must handle node failures and communication issues
without losing reliability. This means having mechanisms to detect failures and manage
changes in group membership.
FAQs for Group Communication in Distributed Systems
Locks restrict access to a resource (such as a database record or table) until the transaction
that holds the lock completes, ensuring atomicity, consistency, isolation, and
durability (ACID) properties.
Types of Locks and Their Purposes
1. Shared Lock (S Lock)
Purpose: Allows multiple transactions to read a resource concurrently but prevents any of
them from writing to it.
Scenario: If Transaction A holds a shared lock on a record, other transactions can also
obtain shared locks on the same record for reading, but no transaction can modify it until all
shared locks are released.
Example: Reading a product inventory without modifying it.
3. Intent Locks
Purpose: Used in hierarchical locking schemes to indicate a transaction’s intention to lock a
lower-level resource (e.g., a row in a table).
Types:
Intent Shared (IS): Indicates intent to acquire shared locks at a finer level.
Intent Exclusive (IX): Indicates intent to acquire exclusive locks at a finer level.
Scenario: Before locking a specific row in a table, an intent lock on the table prevents
conflicting actions by other transactions at a higher level.
4. Read Lock (Compatible with Shared Lock)
Purpose: A variant of the shared lock, explicitly designed for read operations.
Scenario: Ensures that multiple transactions can read a resource concurrently but prevents
writing.