A transaction in DBMS is a sequence of operations performed as a single logical unit of work. When multiple transactions run simultaneously, their operations may interleave.
To maintain correctness, DBMS uses schedules and checks their serializability.
A schedule is an order in which operations (read/write) of concurrent transactions are executed.
Schedules ensure the DBMS can allow concurrency while still keeping the database consistent.
Only one transaction executes at a time.
No interleaving of operations.
Always consistent and correct.
T1: R(A), W(A), R(B), W(B)
T2: R(A), W(A)
Execution:
T1 → T2 or T2 → T1
✔ Always safe
❌ Low concurrency
Operations of transactions are interleaved.
Provides higher concurrency.
May or may not be correct → so we test for serializability.
T1: R(A) W(A)
T2: R(B) W(B)
Interleaving allowed.
A non-serial schedule is serializable if its result is equivalent to a serial schedule.
It ensures that concurrent transaction execution is correct and consistent.
There are two main types:
A schedule is conflict serializable if it can be transformed into a serial schedule by swapping non-conflicting operations.
Two operations conflict if:
They belong to different transactions
They access the same data item
At least one is a write
Conflicts:
R–W
W–R
W–W
Non-conflicts:
R–R
Steps:
Nodes = Transactions
Draw edge Ti → Tj if Ti’s operation conflicts and occurs before Tj
If the graph has no cycle → Conflict Serializable
If cycle exists → NOT serializable
A schedule is view serializable if it is view equivalent to a serial schedule.
View equivalence checks:
Read-from rule – both schedules read initial or same transaction-written value
Final write rule – same transaction does final write
Update rule – same dependencies
✔ More general than conflict serializability
✔ Every conflict-serializable schedule is view-serializable
❌ But reverse is not always true
A schedule is recoverable if:
A transaction Tj reads a value written by Ti
Tj commits only after Ti commits
Ensures no cascading errors.
A transaction can read a data item only if the writing transaction has committed.
Prevents cascading rollbacks.
A data item written by a transaction cannot be read or written by another transaction until after commit.
✔ Strictest
✔ Ensures highest safety
✔ Used in most modern DBMS (Strict 2PL)
Ensures correctness of concurrent transactions
Prevents anomalies like:
Lost updates
Dirty read
Inconsistent retrieval
Maintains ACID properties
Ensures database consistency
Transaction schedules define the order of execution of concurrent transactions in DBMS. To ensure correctness, DBMS checks if a non-serial schedule is equivalent to a serial schedule using serializability tests like conflict serializability and view serializability. Schedules may also be evaluated based on safety properties such as recoverable, cascadeless, and strict schedules. These mechanisms help achieve high concurrency while preserving data integrity and consistency.
Take quizzes related to this topic and see where you stand!
Start Quiz Now