Timedora
Free Online Flashcard Deck

Database Transactions, Concurrency, and Recovery Free Online Flashcards

Study Database Transactions, Concurrency, and Recovery with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What do PRIMARY KEY and FOREIGN KEY constraints enforce?

Back

A PRIMARY KEY uniquely identifies each row and must be unique and non-null; a FOREIGN KEY enforces a relationship to a key in another table.

02
Front

What is a lost update?

Back

A lost update occurs when two transactions modify a value based on the same old value and one change overwrites the other.

03
Front

What practices can reduce the chance of deadlocks?

Back

Access records in a consistent order and keep transactions short. These practices can reduce deadlock risk but cannot guarantee deadlocks will not occur.

04
Front

How can backups and archived logs support database recovery?

Back

Test that backups can be restored. Where supported, archived transaction logs can enable recovery to a selected point in time.

05
Front

How does atomicity protect a two-account money transfer?

Back

Atomicity means all operations in a transaction take effect or none do. A transfer should update both accounts in the same transaction.

06
Front

How do locks and MVCC coordinate concurrent database access?

Back

Locks can make conflicting operations wait. MVCC keeps row versions so readers can often use a consistent earlier view while other transactions make changes.

07
Front

What does SERIALIZABLE aim to guarantee, and what may an aborted transaction require?

Back

SERIALIZABLE aims to make concurrent transactions behave as if they ran one at a time. If a conflict aborts a transaction, some systems require retrying the whole transaction when safe.

08
Front

What recovery capability can archived transaction logs provide?

Back

Where the system supports it, archived transaction logs can enable recovery to a selected point in time.

09
Front

What is a phantom read?

Back

A phantom read occurs when repeating a search returns a different set of rows because another transaction inserted or deleted matching rows.

10
Front

What trade-off can lower transaction isolation involve?

Back

An isolation level defines which effects of concurrent transactions are prevented. Lower isolation can allow more concurrency but expose more changes between reads.

11
Front

What are COMMIT and ROLLBACK used for?

Back

A transaction groups database operations into one logical unit; COMMIT completes it, while ROLLBACK undoes it.

12
Front

What makes a database deadlock a cycle?

Back

A deadlock is a cycle of transactions waiting on one another, each holding a lock needed by another. A database may break the cycle by aborting a transaction.