当前位置:网站首页>Characteristics and isolation level of database
Characteristics and isolation level of database
2022-07-03 06:07:00 【vincentwc】
About the transaction characteristics and isolation level of the database , Always confused and forgotten , I'm going to write an article today to record
One 、 The nature of transactions :ACID
ACID: - Atomicity (Atomicity): A transaction or all execution , Or none of them - Uniformity (Consistency): The integrity of the data before and after the transaction must be consistent - Isolation, (Isolation): Transactions do not interfere with each other - persistence (Durability): Once the transaction is committed , Changes to the database are permanent Two 、 Transaction isolation :
- Dirty reading : It refers to reading the data in another uncommitted transaction during one transaction 【 Read the data of another transaction that has not been committed 】 - It can't be read repeatedly 【 modify 】: For a data in the database , Multiple queries within a transaction range return different data values 【 This is due to the query interval , Modified and committed by another transaction 】 - Fantasy reading / Virtual reading 【 newly added 】: Unreal reading is a phenomenon that occurs when a transaction is not executed independently 【 Such as transaction T1 A data item is removed from all rows in a table “1” It is amended as follows “2” The operation of , When the transaction T2 A row of data items is inserted into the table , And this term is still going to be zero “1” And submit it to the database . And operating transactions T1 If the user views the data that has just been modified , You'll notice that there's still one line that hasn't changed , Actually this row is from the transaction T2 Added in , It's like hallucinating , This is where the phantom reading occurs .】 【 Both phantom and unrepeatable reads read another committed transaction ( This is where the dirty reading is different ), The difference is that the unrepeatable read queries all have the same data item , Phantom reading, on the other hand, targets a whole set of data ( Like the number of Numbers )】
3、 ... and 、 Database isolation level :
- Read uncommitted 【Read uncommitted】: The lowest level , There are no guarantees - Read submitted 【Read committed】: Avoid dirty reading (oracle Default level ) - Repeatable 【Repeatable read 】: Avoid dirty reading , It can't be read repeatedly (mysql Default level ) - Serialization 【Serializable】: Avoid dirty reading 、 It can't be read repeatedly 、 The occurrence of unreal reading Higher isolation level , The less efficient the execution
边栏推荐
- CAD插件的安裝和自動加載dll、arx
- Why is the website slow to open?
- [teacher Zhao Yuqiang] redis's slow query log
- 深度学习,从一维特性输入到多维特征输入引发的思考
- Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
- QT read write excel -- qxlsx insert chart 5
- 88. Merge two ordered arrays
- How to create and configure ZABBIX
- Kubernetes notes (VI) kubernetes storage
- 70 shell script interview questions and answers
猜你喜欢

智牛股项目--04

轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷

Solve the problem of automatic disconnection of SecureCRT timeout connection

Kubernetes notes (IV) kubernetes network

深入解析kubernetes controller-runtime

Kubernetes notes (VI) kubernetes storage

Kubernetes notes (IX) kubernetes application encapsulation and expansion

Apt update and apt upgrade commands - what is the difference?

理解 YOLOV1 第一篇 预测阶段

How does win7 solve the problem that telnet is not an internal or external command
随机推荐
MySQL 5.7.32-winx64 installation tutorial (support installing multiple MySQL services on one host)
PMP笔记记录
Installation du plug - in CAD et chargement automatique DLL, Arx
[teacher Zhao Yuqiang] redis's slow query log
Qt读写Excel--QXlsx插入图表5
Redhat7 system root user password cracking
88. 合并两个有序数组
[Zhao Yuqiang] deploy kubernetes cluster with binary package
Crontab command usage
[teacher Zhao Yuqiang] Flink's dataset operator
tabbar的设置
Phpstudy setting items can be accessed by other computers on the LAN
Deep learning, thinking from one dimensional input to multi-dimensional feature input
Sorry, this user does not exist!
[teacher Zhao Yuqiang] use the catalog database of Oracle
phpstudy设置项目可以由局域网的其他电脑可以访问
It is said that the operation and maintenance of shell scripts are paid tens of thousands of yuan a month!!!
理解 期望(均值/估计值)和方差
CAD插件的安裝和自動加載dll、arx
Code generator - single table query crud - generator