当前位置:网站首页>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
边栏推荐
- Exception when introducing redistemplate: noclassdeffounderror: com/fasterxml/jackson/core/jsonprocessingexception
- pytorch 搭建神经网络最简版
- 从小数据量分库分表 MySQL 合并迁移数据到 TiDB
- Sorry, this user does not exist!
- [teacher Zhao Yuqiang] kubernetes' probe
- Life is a process of continuous learning
- 伯努利分布,二项分布和泊松分布以及最大似然之间的关系(未完成)
- It is said that the operation and maintenance of shell scripts are paid tens of thousands of yuan a month!!!
- Phpstudy setting items can be accessed by other computers on the LAN
- Why is the website slow to open?
猜你喜欢
CKA certification notes - CKA certification experience post
Maximum likelihood estimation, divergence, cross entropy
pytorch DataLoader实现miniBatch(未完成)
GPS坐标转百度地图坐标的方法
Svn branch management
[Zhao Yuqiang] deploy kubernetes cluster with binary package
Alibaba cloud OOS file upload
Oauth2.0 - Introduction and use and explanation of authorization code mode
最大似然估计,散度,交叉熵
[teacher Zhao Yuqiang] Alibaba cloud big data ACP certified Alibaba big data product system
随机推荐
Kubernetes notes (I) kubernetes cluster architecture
[teacher Zhao Yuqiang] the most detailed introduction to PostgreSQL architecture in history
ThreadLocal的简单理解
[trivia of two-dimensional array application] | [simple version] [detailed steps + code]
Method of converting GPS coordinates to Baidu map coordinates
[teacher Zhao Yuqiang] Cassandra foundation of NoSQL database
Detailed explanation of contextclassloader
Using the ethtool command by example
[teacher Zhao Yuqiang] use Oracle's tracking file
Migrate data from Amazon aurora to tidb
[teacher Zhao Yuqiang] index in mongodb (Part 1)
智牛股项目--04
Apt update and apt upgrade commands - what is the difference?
The server data is all gone! Thinking caused by a RAID5 crash
What's the difference between using the Service Worker Cache API and regular browser cache?
Kubernetes notes (IV) kubernetes network
How to create your own repository for software packages on Debian
Code generator - single table query crud - generator
Installation of CAD plug-ins and automatic loading of DLL and ARX
Jedis source code analysis (I): jedis introduction, jedis module source code analysis