multiuser databases Flashcards
concurrency
Interleaving the execution of the operations allowing multiple operations to run concurrently
interleaving
breaking down the operations into smaller steps and alternating between them
what does a transaction look like int eh view of the dbsm
a sequence of reads and writes performed as a single logical unit of work
schedule
a list of actions from a set of transactions
well formed schedule
where the actions of a transaction are in the same order that they happen in the transaction
complete schedule
a schedule contains an abort or commit action for every transaction that occurs in the schedule
serial schedule
a schedule where the actions of different transactions are not interleaved
conflicting operations
two operations that belong to different transactions, operate on the same data item and at least one of them is a write operation
how do we avoid conflicts (ACID)
atomicity
consistency
isolation
durability
atomicity of transactions
a transaction should always execute all of its actions in one step or shouldn’t execute them at all
so it should commit after completing all its actions or abort after executing some of them
consistency of transactions
any transaction should take the database from one consistent state to another
isolation of transactions
even though transactions may be interleaved, the net effect is identical to executing the transactions serially
durability of transactions
if the system crashed before changes made by a complete transaction are written to disk, the log issued to remember and restore these changes when the system is restarted
equivalent schedules
schedules involving the same set of operations on the same set of data objects and leave the database in the same state after being executed
serializable schedule
a schedule equivalent to some serial execution of the transactions
log
record of all operations performed during a transactions so the db can be recovered in a case of a crash or a failure
commit
reflected in the db
abort
not visible in the dbsm
prev changes in the transaction have been removed