Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Database Management Systems: Concurrency Control and Recovery, Slides of Database Management Systems (DBMS)

An excerpt from the book 'database management systems' by ramakrishnan and gehrke. It discusses the concepts of concurrency control and recovery in database management systems. Transactions are abstract views of user programs, and concurrency is achieved by interleaving actions of various transactions. Atomicity of transactions ensures that they are treated as a single unit of work. The document also covers scheduling transactions, anomalies with interleaved execution, and lock-based concurrency control.

Typology: Slides

2011/2012

Uploaded on 02/15/2012

arien
arien 🇺🇸

4.8

(23)

64 documents

1 / 5

Toggle sidebar

Related documents


Partial preview of the text

Download Database Management Systems: Concurrency Control and Recovery and more Slides Database Management Systems (DBMS) in PDF only on Docsity! Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Transaction Management Overview Chapter 16 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 2 Transactions Concurrent execution of user programs is essential for good DBMS performance.  Because disk accesses are frequent, and relatively slow, it is important to keep the cpu humming by working on several user programs concurrently. A user’s program may carry out many operations on the data retrieved from the database, but the DBMS is only concerned about what data is read/written from/to the database. A transaction is the DBMS’s abstract view of a user program: a sequence of reads and writes. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 3 Concurrency in a DBMS Users submit transactions, and can think of each transaction as executing by itself.  Concurrency is achieved by the DBMS, which interleaves actions (reads/writes of DB objects) of various transactions.  Each transaction must leave the database in a consistent state if the DB is consistent when the transaction begins. • DBMS will enforce some ICs, depending on the ICs declared in CREATE TABLE statements. • Beyond this, the DBMS does not really understand the semantics of the data. (e.g., it does not understand how the interest on a bank account is computed). Issues: Effect of interleaving transactions, and crashes. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 4 Atomicity of Transactions A transaction might commit after completing all its actions, or it could abort (or be aborted by the DBMS) after executing some actions. A very important property guaranteed by the DBMS for all transactions is that they are atomic. That is, a user can think of a Xact as always executing all its actions in one step, or not executing any actions at all.  DBMS logs all actions so that it can undo the actions of aborted transactions. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 5 Example Consider two transactions (Xacts): T1: BEGIN A=A+100, B=B-100 END T2: BEGIN A=1.06*A, B=1.06*B END Intuitively, the first transaction is transferring $100 from B’s account to A’s account. The second is crediting both accounts with a 6% interest payment. There is no guarantee that T1 will execute before T2 or vice-versa, if both are submitted together. However, the net effect must be equivalent to these two transactions running serially in some order. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 6 Example (Contd.) Consider a possible interleaving (schedule): T1: A=A+100, B=B-100 T2: A=1.06*A, B=1.06*B This is OK. But what about: T1: A=A+100, B=B-100 T2: A=1.06*A, B=1.06*B The DBMS’s view of the second schedule: T1: R(A), W(A), R(B), W(B) T2: R(A), W(A), R(B), W(B)
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved