DBMS
DBMS Part-1
- DBMS Introduction
- DBMS Architecture
- Database Approach vs Traditional File System
- Advantages of DBMS
- Data Models in DBMS
- Schemas in DBMS
- Instances in DBMS
- Data Independence in DBMS
- Database Languages in DBMS
- Interfaces in DBMS
- Structure of DBMS
- Functions of DBA and Designer
- Entities and Attributes in DBMS
- ER Diagram in DBMS
- Generalization, Specialization and Aggregation in DBMS
- Converting ER Diagram to Tables in DBMS
- Difference between Object Oriented, Network and Relational Data Models
DBMS Part-2
- Relational Data Model in DBMS
- Keys in DBMS
- SQL Introduction
- DDL(Data Definition Language)
- DML(Data Manipulation Language)
- Integrity Constraints in DBMS
- Complex SQL Queries
- Joins in DBMS
- Indexing in DBMS
- Triggers in DBMS
- Assertions in DBMS
- Relational Algebra in DBMS
- Tuple Relational Calculus in DBMS
- Domain Relational Calculus in DBMS
DBMS Part-3
- Introduction to Normalization in DBMS
- Normal Forms in DBMS
- Functional Dependency in DBMS
- Decomposition in DBMS
- Dependency Preserving Decomposition in DBMS
- Lossless Join Decomposition in DBMS
- Problems with Null Values and Dangling Tuples
- Multivalued Dependency in DBMS
- Query Optimization in DBMS
- Algorithms for Select, Project and Join Operations in DBMS
- Query Optimization Methods in DBMS
DBMS Part-4
- Transactions in DBMS
- Serializability in DBMS
- Recoverability in DBMS
- Recovery Techniques in DBMS
- Log Based Recovery in DBMS
- Checkpoint in DBMS
- Deadlock in DBMS
- Concurrency Control in DBMS
- Lock Based Protocol in DBMS
- Timestamp Based Protocol in DBMS
- Validation Based Protocol in DBMS
- Multiple Granularity in DBMS
- Multi-Version Concurrency Control(MVCC) in DBMS
- Recovery with Concurrent Transactions in DBMS
DBMS Part-5
Recoverability in DBMS
Recoverability kya hota hai?
Recoverability ka matlab hota hai ki agar system crash ho jaye ya koi transaction fail ho jaye, to hum database ko wapas ek sahi aur consistent state mein laa sakein.
Matlab — galat ya aadha data save na ho jaye!
Recoverability zaroori kyu hoti hai?
Socho ki ek student database mein marks update kar raha hai:
Agar update ke beech mein light chali gayi ya system crash ho gaya,
Toh system ko aise design kiya hona chahiye ki:
Koi aur transaction uspe depend na kare,
Aur galat ya aadha data na save ho jaye.
Isi concept ko recoverability bolte hain.
Transaction aur Dependency samjho
Transaction kya hota hai?
Ek Transaction ek set of operations hota hai jo ek saath chalna chahiye — ya to poora chale ya bilkul na chale.
Dependency?
Kabhi kabhi:
T2 transaction, T1 ke updated data ko read karta hai.
Agar baad mein T1 fail ho gaya, toh T2 bhi galat ho gaya!
Recoverability ensure karta hai ki aisa na ho.
Types of Recoverability:
1. Recoverable Schedule
Jab T2 ne T1 ke data ko read tab hi kiya jab T1 pehle commit kar chuka ho, toh schedule ko Recoverable bolte hain.
Example:
Time | Transaction T1 | Transaction T2 |
---|---|---|
t1 | Write(X) | |
t2 | Read(X) (from T1) | |
t3 | Commit | |
t4 | Commit |
Yahaan pehle T1 commit hua, fir T2 ne read kiya, toh ye schedule recoverable hai.
2. Non-Recoverable Schedule
Agar T2 ne T1 ka data read kar liya T1 ke commit hone se pehle, aur baad mein T1 fail ho gaya, toh database inconsistent ho jayega.
Example:
Time | Transaction T1 | Transaction T2 |
---|---|---|
t1 | Write(X) | |
t2 | Read(X) (from T1) | |
t3 | Commit | |
t4 | Rollback |
Yahaan T2 ne commit kar liya lekin T1 fail ho gaya, toh T2 galat data store kar chuka hai.
Isliye isse Non-Recoverable Schedule bolte hain.
3. Cascadeless Schedule
Ye recoverable se bhi safe hota hai.
Isme T2 tabhi T1 ka data read karta hai jab T1 pehle se commit ho chuka ho.
Isse cascading rollback ka risk khatam ho jata hai.
Summary Table
Schedule Type | T2 read karta hai after T1 commit? | Risk of Inconsistency | Safe hai? |
---|---|---|---|
Recoverable | Yes | Nahi | Haan |
Non-Recoverable | No | Haan | Nahi |
Cascadeless | Yes | Nahi | Haan |
Important Points:
Recoverability ensure karta hai ki agar koi transaction fail ho jaye, toh database safe rahe.
Non-recoverable schedules dangerous hote hain — data inconsistent ho sakta hai.
Cascadeless schedule safest hota hai — rollback bhi nahi lagta.