0% found this document useful (0 votes)
6 views18 pages

Data Management

The document discusses the importance of data management and security in modern systems, emphasizing transaction processing, concurrency control, and recovery mechanisms. It outlines the ACID properties that ensure data integrity, various concurrency control techniques, and security measures to protect sensitive information. Overall, it highlights how these components work together to create reliable and efficient data systems for applications like banking and e-commerce.

Uploaded by

randomkapoor990
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)
6 views18 pages

Data Management

The document discusses the importance of data management and security in modern systems, emphasizing transaction processing, concurrency control, and recovery mechanisms. It outlines the ACID properties that ensure data integrity, various concurrency control techniques, and security measures to protect sensitive information. Overall, it highlights how these components work together to create reliable and efficient data systems for applications like banking and e-commerce.

Uploaded by

randomkapoor990
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

Data Management and Security in System Design:

Basics of Transaction Processing, Conflict Serializability


and Recoverability, Concurrency Control Techniques, Data
Recovery Mechanisms, Data Security

Class Group: G8
Team No. T5

1
Introduction

Modern systems handle large amounts of data and often allow multiple users to
access or update the data at the same time. To ensure that the system works
correctly and efficiently, proper data management and security mechanisms are
required.

Data management helps maintain consistency of data, ensuring that the information
stored in the system remains accurate and reliable. It also enables safe concurrent
access, allowing multiple users or transactions to work with the database
simultaneously without causing conflicts.

In addition, systems must be able to recover from failures such as system crashes
or power outages so that data is not lost or corrupted. Data security is equally
important, as it protects sensitive information from unauthorized access or misuse.
These mechanisms are essential in many real-world applications, including banking
systems, e-commerce platforms, databases, and distributed systems.
Basics Of Transaction Processing
A transaction represents a logical unit of work that must be
completed entirely or not executed at all. Consider a banking
transfer: moving money from one account to another requires
multiple steps that must succeed together.

Example: Bank Transfer


1. Read current balance from Account A
2. Verify sufficient funds exist
3. Deduct ₹100 from Account A
4. Read current balance from Account B
5. Add ₹100 to Account B
6. Update both accounts in database

If any step fails, all changes must be rolled back to maintain


3

consistency.
The ACID Properties
Transactions follow four essential properties that guarantee
reliability and data integrity in database systems.

Atomicity
A transaction is completed entirely or not executed at all. No partial updates
are allowed—either all operations succeed, or the entire transaction is rolled
back.
Consistency
The database moves from one valid state to another. All constraints, triggers, and rules
must be satisfied before and after transaction execution.

Isolation
Concurrent transactions do not interfere with each other. Each transaction
appears to execute in isolation, even when running simultaneously.

Durability
Once a transaction commits, its changes remain permanent even
4
after system
failure. Data is safely stored in persistent storage.
Transaction States and
Lifecycle
Every transaction transitions through distinct states as it executes,
commits, or rolls back. Understanding these states helps diagnose issues
and optimize performance.

1. Start
Transaction begins execution

2. Active
Operations are executing

3. Partially Committed
Last statement completed

4. Committed
Changes permanently saved

Failure Path: If an error occurs during execution, the transaction moves from
Active to Failed state, then to Aborted state where all changes are rolled back.
Conflict Serializability

Conflict serializability ensures that concurrent transactions


produce the same result as if they executed sequentially, one
after another. This is crucial for maintaining data consistency
in multi-user environments.

When Do Operations Conflict?


 They access the same data item
 At least one operation is a write
 Operations belong to different transactions

Examples: Read(X) followed by Write(X), Write(X) followed by


6
Read(X), or Write(X) followed by Write(X)
Conflict Serializability: The
Precedence Graph
A Precedence Graph (also called Serialization Graph) is a powerful tool
used to check whether a schedule of concurrent transactions is conflict
serializable. This graph-based approach helps maintain the correct logical
order of transaction execution.
Create a node for each transaction
 Represent every transaction in the schedule
as a vertex in the graph
Add directed edges for conflicts
 Draw an arrow from Ti to Tj if Ti conflicts
with Tj and Ti executes first
Analyze for cycles
 If the graph contains no cycles, the
schedule is conflict serializable 7

Determine serializability
Recoverability in Transactions

Recoverability ensures databases remain consistent even after failures.


Different schedule types provide varying levels of protection against
transaction failures.
Recoverable Schedule
A transaction commits only after all transactions it depends on have
committed. Prevents dirty reads from uncommitted data.

Cascading Rollback
Failure of one transaction causes a chain reaction, forcing other transactions
to rollback. Can lead to significant work loss.

Cascadeless Schedule
Prevents cascading rollback by blocking reads from uncommitted data.
Transactions wait until dependencies commit.

Strict Schedule
8
Ensures safe recovery with no dirty reads. Most restrictive but provides
strongest consistency guarantees.
Concurrency Control
Concurrency Control
 Concurrency control is a mechanism used in database systems to
manage multiple transactions that occur at the same time.
 Its main goal is to ensure that simultaneous transactions do not cause
data inconsistency or conflicts.
 It maintains the isolation property of transactions, so that the
execution of one transaction does not interfere with another.
 Concurrency control also prevents common problems such as lost
updates, dirty reads, and inconsistent data.

Why Concurrency Control Matters


 Concurrency control manages simultaneous execution of transactions
without causing inconsistency or data corruption. It maintains isolation
between transactions while preventing data conflicts and improving
overall system performance. 9

 Without proper concurrency control, multiple transactions accessing the


Concurrency Control
Techniques
Managing simultaneous transactions without causing
inconsistency requires sophisticated techniques. Each
approach balances performance, complexity, and safety.

Lock-Based Timestamp Optimistic MVCC


Protocols Ordering Concurrency

Uses shared and Assigns unique Assumes conflicts Maintains multiple


exclusive locks to timestamps to are rare. data versions.
control access. transactions. Transactions Readers access old
Two-Phase Locking Older transactions execute without versions while
ensures get priority, locks, validated writers create
serializability preventing before commit. new ones,
through growing deadlocks with Best for low- eliminating read-
and shrinking simple conflict scenarios. write conflicts.
phases. implementation. 10
Lock-Based Concurrency Control
Locking mechanisms ensure exclusive access to data items, preventing
concurrent transactions from interfering with each other. This approach is
fundamental to maintaining data consistency in multi-user database
environments.
Shared Lock (S) Exclusive Lock (X)

Also called read lock, allows multiple Also called write lock, allows only one
transactions to read a data item transaction to both read and write a
simultaneously but prevents data item. When an exclusive lock is
modifications. Multiple transactions can held, no other transaction can acquire
hold shared locks on the same data. any lock on that data.

Two-Phase Locking (2PL)

Growing Phase
 Transactions acquire all required locks but cannot release
11 any locks.
This phase continues until the transaction has obtained all locks needed
Timestamp-Based Ordering
How It Works
 Each transaction is assigned a unique timestamp when it begins. The
system ensures that all operations follow the timestamp order, giving
older transactions priority over newer ones.
 This approach eliminates the possibility of deadlocks since transactions
never wait for each other. Instead, conflicting operations are rejected
and the transaction is aborted and restarted.
Unique Timestamps Priority by Age No Deadlocks

Every transaction Older transactions have Transactions never


receives a globally higher priority and can wait, eliminating
unique timestamp, proceed while younger deadlock possibility
typically based on ones may be rejected through abort and
system clock or counter restart mechanism

12

Timestamp ordering is widely used in high-performance database systems where


deadlock avoidance is critical and transaction restart overhead is acceptable
Data Recovery Mechanisms
Recovery mechanisms restore databases to consistent states after failures,
minimizing data loss and downtime.

Common Failure Causes


 System crashes
 Hardware failures
 Power outages
 Software bugs
 Human errors
Log-Based Recovery Checkpointing
Mazor Techniques
Maintains transactionUsed:
log recording Saves database state periodically.
all operations. Uses redo to apply Reduces recovery time by limiting log
committed changes and undo to scanning to recent transactions after
rollback incomplete transactions. last checkpoint.

Shadow Paging Backup and Restore


13
Maintains copy of data pages. On Periodic full backups combined with
commit, switches pointer to new incremental changes. Last line of
Log-Based Recovery in
Transaction Log Structure
The system maintains a sequential log file that records every change made by
Detail
transactions. This log is the foundation of most modern recovery mechanisms.
 Transaction Start: Records when a transaction begins
 Data Updates: Logs old and new values before changes
 Commit/Abort: Marks transaction completion or rollback

Recovery Options:
1. Redo Operation
 Re-applies committed changes to ensure durability. Used when the system crashes
after a commit but before changes are written to disk. The log replay ensures
committed transactions survive failures.
2. Undo Operation
 Rolls back incomplete transactions to maintain atomicity. When a transaction fails
or aborts, undo operations restore the database to the state before the
transaction started, preventing partial updates.

14
DataData
securitySecurity Fundamentals
protects databases from unauthorized access,
misuse, corruption, and theft. As data becomes increasingly
valuable, robust security mechanisms are essential for
financial systems, healthcare databases, and enterprise
applications handling sensitive information.

15
Security Techniques and
Authentication Authorization
Verifies user identity through passwords, biometrics, or Controls access rights by defining who can perform

Best Practices
multi-factor authentication before granting access to
database systems
specific operations on database objects through role-
based or attribute-based access control

Encryption Auditing
Protects sensitive data at rest and in transit using strong Tracks user activities and system events to detect
cryptographic algorithms to prevent unauthorized suspicious behavior, ensure compliance, and provide
reading even if data is intercepted forensic analysis capabilities

Backup Patch Management


Creates redundant copies of data to prevent permanent Regularly updates database software to fix security
loss and enable quick recovery from security breaches or vulnerabilities and protect against newly discovered
system failures exploits and attack vectors

Key Takeaways
Data management and security are critical components of modern database systems.
Transactions maintain database consistency through ACID properties. Concurrency control
enables safe parallel execution without conflicts. Recovery mechanisms protect against
failures and ensure data durability. Security techniques protect sensitive information
from unauthorized access and corruption. Together, these mechanisms ensure reliable,
secure, and efficient data systems that form the foundation of modern applications.

16
Conclusion
 Data management and security are essential components of
modern information systems. They ensure that data is handled
efficiently, accurately, and securely in environments where
many users and processes access the system simultaneously.
 Transactions help maintain database consistency by ensuring
that operations are completed correctly. Concurrency control
allows multiple transactions to run in parallel without causing
conflicts or inconsistencies. Recovery mechanisms protect the
system by restoring data after failures such as crashes or power
outages. In addition, security techniques safeguard sensitive
information from unauthorized access and misuse.
 Together, these mechanisms help build data systems that are
reliable, secure, and efficient for real-world applications.
17
Thank you

18

You might also like