Intro to DBMS

Schedule In DBMS

When multiple transactions are running and their order of execution is needed then schedule in dbms comes into the picture. So that operations do not overlap with each other.

In simple words, the schedule in DBMS defines the order of the execution for each transaction.

Schedule types in DBMS

There are two main categories of schedule in the DBMS. One is the serial and the other is the non-serial schedule. The following diagram explains all the types of schedules in detail 

Schedule In DBMS

1. Serial Schedule in DBMS

Schedules in which no transaction can start until a running transaction is ended are called serial schedules.

Example of serial Schedule

Consider the following schedules (A and B), each holding two transactions, T1 and T2. In the Serial schedule, two transactions are executed separately. They cannot execute at the same time as given below

Serial Schedule in in dbms

This is a serial schedule since the transactions perform serially in the order T1 —> T2  OR T2 —> T1

Advantage of Serial Schedule

The main benefit of a serial schedule is that there is no concurrency problem.

Concurrency Problem:

This problem occurs when two transactions are accessing the same data in such a way that the execution of one transaction will affect the other transaction.

Disadvantage of Serial Schedule

 It is a time-wasting approach because if T1, T2, and T3 arrive at the same time, then T2, and T3 have to wait until T1 is completed.

In further lectures, we will deal with parallel scheduling, not serial scheduling, because time is the money.

2. Non-Serial (Parallel) Schedule

In the non-serial schedule, the other transaction proceeds without waiting for the previous transaction to complete. Non-serial schedules can be of two types.

  • Serializable
  • Non-Serializable Schedule.

Example of Non-serial Schedule

The following schedules are non-serial, where T1 and T2 are running concurrently.

  • The operations of T1 and T2 are interleaved.
  • So, the following schedules are examples of a non-serial schedule.

Parallel Schedule in dbms

Our Need is parallel transactions because of time saving but parallel cause the Concurrency problem and Read write Conflict problem.

Real Life Example – Explain

  • If there exists one ATM machine then only one person can withdraw the money at a time other persons have to wait. It is a serial schedule.
  • By using an online application of any bank, thousands of people can send and receive money at a time. It is a parallel schedule

Difference Between Serial & Parallel Schedule

Serial Parallel
Only one transaction is executed at a time More than one transaction executed at a time
Less Throughput High Throughput
Low performance High Performance
No concurrency problem Concurrency problems in some cases