Posts

Transaction State Diagram

Image
Transaction State Diagram Let us understand all the states in terms of stages in detail: Stage-1: Once a transaction becomes active it starts its execution and goes to active state . It chooses read or write operations in this stage and stays here till the transaction is executed. Stage-2: Once the read and write operation completes successfully, the transaction then goes to partially committed state, where all the read and write operations are performed on the local memory instead of actual database. The reason for having this state is that, the transaction may fail during execution, and may lead actual database instead of local memory, in an inconsistent state in case of failure. So having this state can help us rollback the changes made to the database in case of execution failure. Stage-3: Then, it is responsibility of recovery protocol, to ensure that a system failure will not disable permanent changes to the database. It any failure occurs either ...

Transaction Properties

Transaction / Acid Properties The ACID property is elaborated as mentioned below: A   - Atomicity The execution of entire transaction should take place at once or not at all. •       Either the entire transaction takes place at once or doesn’t happen at all, i.e. the transaction never occurs partially.  •       Each transaction is considered as one unit and either runs to completion or is not executed at all. It involves the following two operations: •       - Abort: If a transaction aborts, changes made to database are not visible. - Commit: If a transaction commits, changes made are visible. •       Atomicity is also known as the ‘All or nothing rule’. C  - Consistency The database must remain consistent before and after the execution of transaction. •       The database must remain in a consistent state after any tr...

Introduction to transaction

What is transaction? A transaction is a set of instructions which performs a logical unit of transactions on the database, which might modify the contents of the database. Every transaction should be atomic in nature, i.e. necessarily all the instructions within that transaction must be executed fully or none of them must be executed. The database must remain in consistent state, always. A successful transaction can change the database from one consistent state to another.

Normalization – 1NF, 2NF, 3NF, BCNF and 4NF

Normalization Normalization is the process of organizing the data. Normalization is used to minimize and eliminate the redundancy from a relation or set of relations. It is also used to eliminate the undesirable characteristics like Insertion, Updation and Deletion anomalies. It divides the larger table into the smaller table and links them using relationship. Anomalies in Database Update Anomalies: When several instances of the same data are scattered across the database without a proper relationship, it could cause inconsistency where few of the instances will get updated with new values while some of them will remain with old values. This might lead to an inconsistent state of database. Deletion Anomalies: Incomplete deletion of a particular data section which leaves some residual instances of that data. The database creator remains unaware of such unwanted data as it is present at a different location. The del...