Home >> MySql >> What is transaction in MySql

What is transaction in MySql

A transaction is defined as a logical unit of work which happen in its entirity or not at all.

ACID Property

1-Atomicity-Either all or none.there is no partial result.an event either happens and is commited or fails and rollback.

2-Consistency-Transaction must bring the database from one consistent state to another consistent state.

3-Isolation-Each transaction should feel that it is the only which is executing in the system but in realting some others also may execute.

4-Durability-The changes made by a transaction is permanent in nature unless another transaction makes the charge to the database.

Execution of transaction-

1-Serial execution

2-Concurrent execution

1-Serial execution-All the operation of a transaction complete then operation of other transaction will start.no intermixing / interleaving of operations of transaction.



n=2 transaction

T1     T2

T2     T1

n=3 transaction

T1      T2      T3

T1      T3      T2

T2      T1      T3

T2      T3      T1

T3      T1      T2

T3      T2      T1

if n is number of transaction in a system  then-

Total number of serial execution=n!

2-Concurrent execution-Interleaving of operations of different transactions.it leads to more resourse utilization and thoughtput, reduced waiting time.if operationare not interleaved properly then it causes some problems also.

Post Your Comment

Next Questions
What is normalization and types of normalization
What is First Normal Form(1NF)
What is Second Normal Form(2NF)
What is Third Normal Form(3NF)
What is Boyce Codd Normal Form(BCNF)
What is Fourth Normal Form(4NF)
What is Fifth Normal Form(5NF)
What is Index and why use indexing
What is clustered index
What is non clustered index
What is primary key index
What is unique key index
What is normal index
What is full text index
What are advantage and disadvantage of indexing
Create database
Drop database
Select database
Create table
Drop table
Truncate table
Insert query
Select table
Where clause
AND Clause

Copyright ©2022 coderraj.com. All Rights Reserved.