Chapter 7 Transactions Part 1 Basics Definitions Properties and Read Committed Isolation
Chapter 7 Transactions Part 1 Basics Definitions Properties and Read Committed Isolation
Transactions
What can go wrong in data systems?
• Database software or hardware may fail at any time.
• Application can crash at any time.
• Interruptions in the network.
• Concurrent clients.
• Data partially updated
• Race conditions can cause bugs.
ACID
• Atomicity :
Describes what happens if a fault occurs after some of the writes have been processed. Then those writes are
grouped together into an atomic transaction and the transaction cannot be completed due to a fault, then the
transaction is aborted and database must discard or undo any writes it has made so far in the transaction.
• Consistency :
Application specific notion of database being in a good state.
• Isolation :
Concurrently executing transactions are isolated from each other, which means that each transaction can pretend
that it is the only transaction running in the entire database.
• Durability :
Promise that once transaction has been committed successfully, any data it has written will not be forgotten, even
if there is a hardware fault or the database crashes.
Single-Object and Multi-Object
operations
• Atomicity
• Isolation
• BEGIN TRANSACTION and COMMIT statement.
Single-object writes
Atomicity :
Isolation : Using lock
Implemented using a
on each object
log for crash recovery
• In relational data model, a row in one table
has a foreign key reference to a row in
another table. It ensures that these
Multi-object writes
Dirty reads
Dirty writes
Thank You!