<> What is business

* Transaction is one of the important characteristics of database system which is different from all other file systems
* Transactions are a set of atomic SQL sentence , Or a separate unit of work
Transactions need to meet the following characteristics :

Atomicity (ATOMICITY), definition :
A transaction must be regarded as an indivisible minimum unit of work , Either all operations in the whole transaction are committed successfully , Or they all fail , For a transaction , It is not possible to perform only part of it

uniformity (CONSISTENCY), definition :
Consistency refers to the transition of database from one consistency state to another , The integrity of database data is not destroyed before and after the transaction begins and ends

Isolation (ISOLATION), definition :
Isolation requires a transaction to modify the data in the database , It is not visible to other transactions until the commit completes

SQL Four isolation levels defined in the standard

* Uncommitted read (READ UNCOMMITED) , Dirty reading
* Read committed (READ COMMITED), Default in most databases ,mysql Out of column
* Repeatable (REPEATABLE READ)
*
Serializable (SERIALIZABLE), Each row of data read is locked , Can cause a large number of lock timeouts , The problem of lock expropriation , This isolation level is rarely used in real business , Unless data consistency is strictly required , It is acceptable to consider using this isolation boundary without concurrency
persistence (DURABILITY), definition :
Once the transaction is committed , Its changes are permanently saved to the database . Even if the system crashes , The submitted modification data will not be lost

What is big business
definition : It takes a long time to run , Transactions with more data to operate on
risk :

* Locking too much data , Cause a lot of blocking and lock timeout
* It takes a long time to roll back
* Long execution time , It is easy to cause master-slave delay
How to deal with big business

* Avoid processing too much data at a time
* Remove unnecessary SELECT operation

Technology