# Transaction Definition
+ A transaction is a collection of operations performed on a database and is an inseparable basic unit of data change.
  + `atomicity` , or indivisibility
  + `consistency` 
  + `isolation` , also known as independence
  + `durability` 

------------------------------------------------------------
transaction definition

What is a transaction

A transaction is a collection of operations performed on the database, and is an inseparable basic unit of data change. We want this set of operations to be executed correctly. If any step in this set of operations fails, then you need to roll back the previously completed operations. That is, all operations in the same transaction are either performed correctly or none of them are performed.

Four characteristics of transaction
- Atomicity (or indivisibility)
  - A transaction is an inseparable unit of execution, and all operations in a transaction are performed either all or none.
- consistency
  - consistency requires that the integrity constraints of the database are not broken before the transaction starts and after it ends.
- Isolation (also known as isolation)
  - The execution of transactions is independent of each other, they do not interfere with each other, and one transaction does not see the data of another transaction in the running process.
- Persistence (persistence)
  - Persistence requires that after a transaction is completed, the execution result of the transaction must be persistent. Even if the database crashes, the results of the transaction commit will not be lost after the database is recover.
The durability solves the security problem of data; the ease of use and efficiency of application development solved by atomicity and consistency; and the isolation solves the security and concurrency between transaction;
