While a transaction executes these invariants may be violated, but no other transaction will have access to view these inconsistencies, and all such inconsistencies will have been eliminated by the time the transaction ends. It is the role of the DBMS and application developers to ensure consistency. 2. Isolation: Transaction runs on a database independently of each other. Meaning the partial effects of transactions that are incomplete should be invisible to other transactions.
It is the role of the concurrency control subsystem to ensure isolation. 3. Atomicity: A transaction allows grouping of one or more changes to tables and rows in the database to form an atomic operation. This means either all of the changes are performed or not performed at all. If for any reasons the transaction cannot be completed, everything the transaction changed can be restored back to the way it was before the start of the transaction via a rollback operation. Ensuring atomicity is the responsibility of the recovery subsystem of the DBMS.
4. Durability: When a transaction is committed, it is permanently stored on the database even in the event of subsequent system failure. The recovery subsystem has the responsibility to ensure durability. 5. Database Recovery: This is the process of returning the database to its correct state when a failure occurs. There are a lot of different failures that can have an effect on the database processing. Some of these failures may affect the main memory, while others are involved in non-volatile storage.
In a database system, transaction is the main unit of recovery. Having a recovery manager, so that the system can return the system to a consistent state after a failure. There are a few recovery techniques that can be used. Deferred technique, using this type of protocol, all updates are not written to the database until after a transaction has arrived at its commit point. Immediate update unlike deferred technique, updates are written to the database without having to wait to arrive at the commit point.
The recovery manager is the one that is responsible for guaranteeing that two of the four ACID properties of transaction, atomicity and durability are used, when failure occurs. The DBMS should provide certain facilities to cater for recovery, like the following: 6. Providing a backup mechanism, this makes periodic backup copies of the database. Logging facilities, that keeps track of the current state of transactions and database changes. Checking-point facilities, which make it possible for updates to the database to happen while in the progress of making it permanent.