Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
Types of Schedules Based on Recoverability in DBMS
Next article icon

Types of Schedules Based on Recoverability in DBMS

Last Updated : 05 Feb, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

In a Database Management System (DBMS), multiple transactions often run at the same time, and their execution order is called a schedule. It is important to ensure that these schedules do not cause data loss or inconsistencies, especially if a failure occurs.

A recoverable schedule allows the system to undo changes safely if needed, while some schedules may lead to unwanted rollbacks, causing issues like cascading failures. To prevent such problems, schedules are categorized based on their recoverability, such as recoverable schedules, cascaded schedules, cascade-less schedules and strict schedules.

Schedules Based on Recoverability

schedules_types

Recoverable Schedule

A recoverable schedule ensures that the database can return to a consistent state after a transaction failure.

In this type of schedule:

  1. A transaction cannot use (read) data updated by another transaction until that transaction commits.
  2. If a transaction fails before committing, all its changes must be rolled back, and any other transactions that have used its uncommitted data must also be rolled back.

Recoverable Schedule prevents data inconsistencies and ensures that no transaction commits based on unverified changes, making recovery easier and safer.

Example:

S1: R1(x), W1(x), R2(x), R1(y), R2(y), W2(x), W1(y), C1, C2; 

The given schedule follows the order of Ti->Tj => C1->C2. Transaction T1 is executed before T2 hence there is no chance of conflict occurring. R1(x) appears before W1(x) and transaction T1 is committed before T2 i.e. completion of the first transaction performed the first update on data item x, hence given schedule is recoverable. 

Let us see an example of an unrecoverable schedule to clear the concept more.

S2: R1(x), R2(x), R1(z), R3(x), R3(y), W1(x), W3(y), R2(y), W2(z), W2(y), C1, C2, C3; 

Ti->Tj => C2->C3 but W3(y) executed before W2(y) which leads to conflicts thus it must be committed before the T2 transaction. So given schedule is unrecoverable. if Ti->Tj => C3->C2 is given in the schedule then it will become a recoverable schedule. 

Example:

Dirty Read Problem
Dirty Read Problem

Note: A committed transaction should never be rollback. It means that reading value from uncommitted transaction and commit it will enter the current transaction into inconsistent or unrecoverable state this is called Dirty Read problem. 

Cascadeless Schedule

A cascade-less schedule ensures that if one transaction fails, it does not cause multiple other transactions to roll back.
In this type of schedule, a transaction is not allowed to use (read) uncommitted data from another transaction until that transaction is fully committed. This prevents cascading rollbacks, where a failure in one transaction forces many others to undo their changes. If a transaction fails before committing, only its own changes are undone, but other transactions that have read its data do not need to roll back, making the recovery process simpler and more efficient.

Example:

S3: R1(x), R2(z), R3(x), R1(z), R2(y), R3(y), W1(x), C1, W2(z), W3(y), W2(y), C3, C2; 

In this schedule W3(y) and W2(y) overwrite conflicts and there is no read, therefore given schedule is cascade less schedule. 

Special Case: A committed transaction desired to abort. As given below all the transactions are reading committed data hence it's cascadeless schedule. 

Cascadeless Schedule
Cascadeless Schedule

Strict Schedule

A schedule is strict if it is both recoverable and cascadeless.

A strict schedule ensures strong data consistency by following two key rules:

  1. A transaction cannot use (read) uncommitted data from another transaction until that transaction commits.
  2. A transaction cannot update (write) the same data modified by another transaction until the first one commits.

This means that if a transaction fails before committing, all its changes must be undone (rolled back), and any other transactions that used its uncommitted data must also be rolled back.

Strict schedule helps in maintaining a reliable and consistent database by preventing data conflicts and minimizing errors.

Example:

S4: R1(x), R2(x), R1(z), R3(x), R3(y), W1(x), C1, W3(y), C3, R2(y), W2(z), W2(y), C2; 

In this schedule, no read-write or write-write conflict arises before committing hence its strict schedule: 

Strict Schedule
Strict Schedule

Cascading Abort: Cascading Abort can also be rollback. If transaction T1 aborts as T2 read data that is written by T1 it is not committed. Hence its cascading rollback. 

Example: 

Cascading Abort
Cascading Abort

Relation Between Strict, Cascadeless and Recoverable schedules

Below is the picture showing the correlation between Strict Schedules, Cascadeless Schedules, and Recoverable Schedules.

Schedules
Schedules

 From the above figure, we can conclude that:

  1. Strict schedules are all recoverable and cascade schedules.
  2. All cascade-less schedules are recoverable.

In Database Management Systems (DBMS), the schedules can be categorized based on their recoverability. Recoverability refers to the ability to recover the database to a consistent state after a transaction failure. 


Next Article
Types of Schedules Based on Recoverability in DBMS

P

Pradip_Sawatkar
Improve
Article Tags :
  • Misc
  • DBMS
  • GATE CS
  • DBMS-Transactions and Concurrency Control
Practice Tags :
  • Misc

Similar Reads

    Types of Schedules in DBMS
    Schedule, as the name suggests, is a process of lining the transactions and executing them one by one. When there are multiple transactions that are running in a concurrent manner and the order of operation is needed to be set so that the operations do not overlap each other, Scheduling is brought i
    7 min read
    Database Recovery Techniques in DBMS
    Database Systems like any other computer system, are subject to failures but the data stored in them must be available as and when required. When a database fails it must possess the facilities for fast recovery. It must also have atomicity i.e. either transactions are completed successfully and com
    11 min read
    Log based Recovery in DBMS
    Log-based recovery in DBMS ensures data can be maintained or restored in the event of a system failure. The DBMS records every transaction on stable storage, allowing for easy data recovery when a failure occurs. For each operation performed on the database, a log file is created. Transactions are l
    10 min read
    Recoverability in DBMS
    Recoverability is a critical feature of database systems. It ensures that after a failure, the database returns to a consistent state by permanently saving committed transactions and rolling back uncommitted ones. It relies on transaction logs to undo or redo changes as needed. This is crucial in mu
    6 min read
    Purpose of Database System in DBMS
    Nowadays organizations are data-dependent. efficient management and retrieval of information play a crucial role in their success. A database is a collection of data that is organized, which is also called structured data. It can be accessed or stored in a computer system. It can be managed through
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences