ACID Transactions Properties
- Basic DBMS Tables structure
- Introduction to SQL
Introduction
Database Management System me jo transaction execute hote hain, unka safe aur consistent rehna sabse basic condition hai. ACID Properties database transaction reliability ensure karti hain, taaki power failure, crash, ya concurrency errors ke time data corrupt na ho.
Real-Life Analogy
💡 Bank Account Transfer Analogy
Transferring money from Account A to Account B
| Concept Term | Real-life Analogy Mapping |
|---|---|
| Atomicity | Amount deducts from A AND adds to B. Aise nahi ho sakta ki A se kat gaya par B me nahi aaya. Either full, or nothing. |
| Consistency | Dono accounts ka total amount transaction se pehle aur transaction ke baad SAME rehna chahiye. |
| Isolation | Agar multiple transfers ho rahe hain, toh wo ek dusre se isolate hone chahiye, taaki temporary balance values leak na hon. |
| Durability | Transaction confirm/commit hone ke baad agar bank database systems crash bhi ho jayein, toh apka transfer data lost nahi hoga. |
Detailed Concept Explanation
ACID stand details: 1. **Atomicity**: Transaction ek single atomic unit ki tarah execute hoga. (All or Nothing). 2. **Consistency**: Database state consistent parameters me rahegi constraint violation free. 3. **Isolation**: Concurrency me processes isolate rehne chahiye (via concurrency control techniques like 2-Phase Locking). 4. **Durability**: System failures ke baad database dynamic states recover kar sake. (Logged changes to Disk).
Visual Diagram
- Atomicity and Durability is ensured by the Recovery Manager (via log files).
- Consistency is the responsibility of the application programmer and database constraints checks.
- Isolation is controlled by the Concurrency Control Manager.
A-C-I-D (Acid like battery chemical)
Atomicity, Consistency, Isolation, Durability
Practice Mini Quiz
Revision Summary (One-Page Notes)
- •Transactions are logical units of work.
- •ACID properties guarantee robustness.
- •Atomicity (All/None), Consistency (Validity), Isolation (Independent), Durability (Persistent).