unit 7: distributed concurrency control Flashcards
define transaction
A transaction can be defined as a unit or a part of program at the time of its execution,
that forms logical unit of database processing…
hamare pas bohot sari lines of cod e/ program hota he, usme se ham at a time kisi ek line ko hi to execute karenge to uss part ko ham transaction kahenge
can transaction includes one or more access operation on database
Yes, transaction can include one or more access operations on a database like, insertion, deletion, modification or retrieval operation
why understanding transaction’s is important
all things are related to transactions in this subject
thats why understanding transactions is very important
what are some basic database access operations
- read_item( x )
- write_item( x )
Is there any similarity between Transaction or Process ?
In DBMS, part or unit of program is known as Transaction
In OS, part or unit of program is known as Process
Why ACID properties are used?
To maintain the integrity of program we use ACID properties.
For ensuring integrity of data, database system maintain the ACID properties.
what is schedule?
whenever multiple transactions are operating, each and every transaction has to done certain set of actions, so at which instant of time, which action, under which transaction is going to get executed, that will be mapped along with time instant and that is known as schedule.
example
there are two transaction T1 and T2 in schedule
this transaction has to do 4 tasks/actions
some read write operation, it is being guided by begin_tran and commit, in this brackets this transaction is carried out
for T2 there are also some transaction
what is serial schedule
a schedule where the operations of each transaction are executed consecutively without any interleaved operations from other transaction
non-serial schedule
a schedule the operations from a set of concurrent transactions are interleaved
testing of serializabilty
concurrency control definition / understanding
In real life situations (applications) multiple transactions will be executed in parallel or concurrently
what will happen if there is no concurrency control
those transaction execution will leave behind database, in some inconsistent state
Proper definition of concurrency control
the concurrency control is a process of managing simultaneous operations on the database without having them interfere with one another. It enhances overall CPU utilization.
there are 3 potential problems of concurrency
- lost update problem
- uncommitted dependency (or dirty read) problem
- inconsistent analysis problem
what are other words use for concurrency
parallelly / simultaneously / at same time
what / explain granularity of locks
[first concept in lock based protocols]
the level and type of information that the lock protects is called locking granularity
OR
in other words, the size of data item that the data manager locks is called locking granularity
Lost update problem Explain
update operation of one user is overwritten by another user
OR
If any transaction Tj updates any variable A at time t, without knowing the value of A at time t , then this may leads to lost update problem
example of lost update problem
example of lost update problem
user one initiated T1
user two initiated T2
T2 is older, because it got initiated at t1
T2 is younger, initiated at t2
so the updates done on balX are overwritten by T2
That is our lost update problem
Explain uncommitted dependency / dirty read problem
when a transaction uses result of partially completed transaction
OR
Reading the data value of a variable before committing may lead to ‘Dirty Read Problem’
OR
ek transaction kisi variable par kam kar raha tha, hi transaction commit honachya pahile, dusrya transaction ne hya variable cha data read kela
explain inconsistent analysis problem
when a transaction reads several values from the database but a second transaction updates some of them during the execution of the first