DBMS Flashcards
(5 cards)
What are the ACID properties and what do they mean?
Atomicity - Each transaction is a single unit. The entire statement is executed or none of it is.
Consistency - Transactions only make changes to tables in predefined, predictable ways.
Isolation - When multple users are reading and writing from the same table all at once, isolation ensures concurrent transactions don’t interfere with or affect one another.
Durability - ensures that changes to your data made by successfully executed transactions will be saved, even in the event of system failure
What are the 5 transaction states?
Active - Currently Executing
Partially Commited - Execution is complete but is still stored on memory and not disc
Failed - A hardware or software issue has occurred
Aborted - Transaction was rolled back and the database has been returned to the state it was at before the transaction occurred
Commited - Successfully executed all instructions and has gone to the commited state
How does One-phase Commit work?
Control site waits for slave sites to finish their transactions locally, send a DONE notification to the control site and waits for a commit or abort message
Explain Two-phase Commit.
Two-phase Commit - Phase Transaction T happens at Site(s) S coordinated by coordinator C. C logs <prepare> in a stable location and notifies S it needs T. S decides whether to commit its share of T</prepare>
Explain Three-phase Commit.