ACID Properties
The properties that ensure the consistency, reliability, and correctness of transactions in a database system are known as the ACID properties. ACID stands for:
1. Atomicity
Ensures that a transaction is treated as a single unit of work, meaning that either all operations succeed or none do.
If any part of the transaction fails, the entire transaction is rolled back, returning the database to its original state.
2. Consistency
Ensures that the database remains in a consistent state before and after the execution of a transaction.
All constraints and rules defined on the database schema must be enforced throughout the transaction.
3. Isolation
Ensures that transactions execute independently of one another.
Each transaction operates as if it were the only transaction executing, even when multiple transactions are running concurrently.
4. Durability
Ensures that the effects of a committed transaction are permanent, even in the event of system failures.
Once committed, the transaction’s changes are saved to the database permanently.
Schedules in DBMS
A schedule is the sequential order in which operations of multiple transactions are executed.
It represents the timeline of operations and helps manage concurrent transactions effectively.
1. Serial Schedule
- Transactions execute one after another, in sequence.
- Only one transaction executes at any given time.
- Guarantees:
- Consistency
- Recoverability
- Cascadelessness
- Strictness
2. Non-Serial Schedule
- Multiple transactions execute simultaneously.
- Operations from different transactions are interleaved.
- Allows for parallel execution but may not guarantee consistency, recoverability, cascadelessness, and strictness.