0% found this document useful (0 votes)
4 views17 pages

Week 10

Uploaded by

lalosamal666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views17 pages

Week 10

Uploaded by

lalosamal666
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Computer System Design

Ms. Sara A.Ahmed


Lecture 10
Overview
Suppose that you are trying to buy a toaster from an Internet store. You click on the
button that says “purchase”, but before you receive a response the power fails. You
would like to have some assurance that, despite the power failure, either the
purchase went through properly or that nothing happen at all. You don’t want to find
out later that your credit card was charged but the Internet store didn’t receive as it
was supposed to ship the toaster.

2
3
Introduction

Atomicity: is performing a sequence of steps, called actions, so that they appear to


be done as a single, indivisible step, known in operating system and architecture as
an atomic action and in database management as a transaction.

4
Cont.
• Atomic actions are a fundamental building block that is widely applicable in
computer system design and more generally in software engineering.

• Atomic actions are found in database management systems, in register


management for processors, in file systems, in control systems used for program
development.

• In many everyday applications such as word processors and calendar managers.

5
Atomicity Concepts
1. All-or-nothing atomicity: This concept is used in the context of database design
transactions.

• It refers to the idea that a transaction is treated as a single, indivisible unit of work.

• Either all the operations within the transaction are completed successfully, or none
of them are.

• If any part of the transaction fails, the entire transaction is rolled back, and the
system is left in its original state.
6
Cont.
2. Before-or-after atomicity: This concept deals with the ordering of operations in a
concurrent or distributed system.

• In a concurrent or distributed environment, multiple operations may be happening


concurrently, and it becomes essential to define their relative order.

• It doesn't mandate a specific order between the operations but provides a


guarantee that they won't be interleaved.

7
Locking Mechanism in Atomicity
1. Simple Locking: Simple locking contributes to achieving atomicity by ensuring
that a transaction can complete its operations on a resource without interference
from other transactions.

• If a transaction acquires a lock on a resource, it can perform its operations


atomically, and once it releases the lock, other transactions can access the
resource.

8
Cont.
2. Two-Phase Locking: provides a higher level of atomicity by ensuring that a
transaction acquires all the necessary locks before it begins to release any.

• This "two-phase" nature helps prevent certain types of conflicts and ensures a more
consistent state during the execution of transactions.

• The protocol is designed to avoid the possibility of a transaction releasing locks and
then later needing to acquire additional locks, which could lead to issues with
consistency.
9
Atomicity in Nested Transactions

Nested transactions refer to a transactional model where a higher-level or outer


transaction can encapsulate one or more lower-level or inner transactions.

• Each of these inner transactions operates as a separate unit of work within the
scope of the outer transaction.

• The concept of nested transactions introduces a hierarchical structure to the


traditional transactional model.

10
Challenges Associated with Nested
Transactions
1. Complexity:

• Implementing nested transactions introduces complexity to the system. The management of


the transaction hierarchy requires careful design and coding to handle various scenarios.

2. Isolation and Consistency:

• Ensuring proper isolation and consistency across nested transactions can be challenging.

• Intermediate states of nested transactions may need to be hidden from the rest of the
system until the outer transaction commits.
11
Cont.
3. Rollback Handling:

• Handling rollbacks becomes more intricate in nested transactions.

• If an inner transaction fails, the system needs to determine whether to roll back only that
transaction or the entire nested structure.

4. Concurrency Control:

• Coordinating concurrency control mechanisms, such as locks or timestamps, across nested


transactions requires careful consideration.

12
Cont.

5. Commit Dependencies (refer to the relationships between transactions that influence


when they can be committed or rolled back):

• Dependencies between inner and outer transactions can complicate the commit process.

• Deciding when to commit an inner transaction and whether the outer transaction should
wait for all inner transactions to complete introduces coordination challenges.

13
Failure and Recovery in Atomicity

• In computer systems, failure and recovery mechanisms are crucial for maintaining
the integrity and consistency of data.

• Atomicity, one of the ACID properties (Atomicity, Consistency, Isolation, Durability),


plays a significant role in ensuring reliable recovery from system failures.

• In the event of a system failure (e.g., hardware failure, software crash, power
outage), atomicity ensures that the system can recover to a consistent state.

14
Consistency and Atomicity
• Consistency and atomicity are closely related and often work together to ensure the
integrity of data in a system.

• While atomicity focuses on transactions being treated as indivisible units,


consistency ensures that the execution of those transactions doesn't violate the
defined rules of the system.

• Atomic transactions contribute to consistency by ensuring that the system moves


from one consistent state to another.
15
Security and Atomicity

• Transaction Auditing and Security Assurance: The auditing process associated with
atomicity contributes to security assurance.

• Consistency and Validation for Security Policies: enforcing security policies and
validation rules.

16
Any Questions

17

You might also like