1.3.2 A2 Referential Integrity Flashcards
Referential Integrity
The process of ensuring that changes remain consistent. If a record is removed, all references to it are removed.
Transaction
A single operation executed on data. (a collection of operations can also sometimes be considered a transaction).
What does ACID stand for?
Atomicity, Consistency, Isolation, Durability
Atomicity
A transaction must be processed in its entirety or not at all
Consistency
A transaction must maintain the referential integrity rules between linked tables
Isolation
Simultaneous executions of transactions should lead to the same result as if they were executed one after the other
Durability
Once a transaction has been executed, it will remain so regardless of the circumstances surrounding it, such as in the event of a power cut.
Record Locking
Preventing simultaneous access to records in a database.
What problems does record locking prevent?
Inconsistencies, or a loss of updates.
How would record locking work?
While one user is editing a record, the record is locked so it cant be accessed by others.
What is the biggest problem with record locking?
Deadlock.
Explain dead lock through an example
User 1 accesses Customer 1’s record, which locks it.
User 2 accesses Customer 2’s record, which locks it.
User 1 tries to access Customer 2’s record. User 2 tries to access Customer 1’s record.
User 1 waits for Customer 2’s record to be free. User 2 waits for Customer 1’s record to be free.
There is no progress, causing a deadlock.
What is redundancy? (the good version)
Having one or more copies of data in physically different locations.
What is good about redundancy?
If there is damage to one copy of data, the other copies are unaffected and can be recovered.
What is redundancy? (the bad version)
The unnecessary repitition of a field in multiple tables.