当前位置:网站首页>[database] must know and be able at the end of the term ----- Chapter 11 concurrency control
[database] must know and be able at the end of the term ----- Chapter 11 concurrency control
2022-07-19 04:08:00 【Lambs can't fly】
Chapter 11 concurrency control
1、 The concept of transaction and ACID nature
Concept : Is a user-defined sequence of database operations , All or nothing of these operations , It is an indivisible work unit
ACID The nature of :
A(Atomicity): Atomicity , Either do it all or don't do it at all
C(Consistency): Uniformity , Only the results of successful transaction submission , That is, only when it is successfully completed can it be submitted , You won't submit half done
I(Isolation): Isolation, , One transaction cannot be disturbed by other transactions
D(Durability): Continuity , Once the transaction is committed , Its change is permanent
2、 Data inconsistency caused by concurrent operations
1) Lost data
2) read “ dirty ” data
3) It can't be read repeatedly
3、 Common blocking techniques for concurrency control
1) Exclusive lock ==>X lock ==> Write lock : Readable and modifiable
2) Shared lock ==>S lock ==> Read the lock : Readable but not modifiable
4、 The meaning of blockade 、 Basic blocking types ( Exclusive lock 、 Shared lock ) And its compatibility
meaning : Business T Before operating on an object , Send a request to the system first , Lock it
type : Exclusive lock 、 Shared lock
Compatibility :
1) added X After the lock , Transactions cannot lock them
2) added S After the lock , Transactions can only add S lock
5、 The granularity of the blockade
meaning : The size of the blocked object is called “ Blocking granularity ”
characteristic :
1) The larger the particle size , That is, the larger a single object , Then the smaller the data unit that can be blocked , The number of concurrency decreases , Less overhead
2) The smaller the particle size , That is, the smaller a single object , Then the more data units that can be blocked , The number of concurrent increases , Spending more
6、 Know the cause and prevention of deadlock
reason : Two or more transactions send requests to block mutually blocked resources at the same time , Form a dead wait
Ways to prevent deadlocks :
1) One time blockade : It is to lock all the data to be used at one time , Otherwise, do not execute
2) Sequential blockade : Specify a blocking order for data objects , Everything is blocked in this order
边栏推荐
猜你喜欢

【RuoYi-Vue-Plus】学习笔记 30 - Redisson(六) 有界阻塞队列 Bounded Blocking Queue(Redisson 源码 + Lua 脚本)

Mathematical modeling learning (67): detailed introduction to xgboost classification model case tutorial

Kubernetes learning persistent storage storageclass (4)

Chapter 1 performance platform godeye source code analysis - overall architecture

Chapter 2 - create and maintain MySQL database

Small program completion work wechat online education video on demand learning small program graduation design (2) small program function

Hcip day 6 notes

小程序毕设作品之微信电子书阅读小程序毕业设计(8)毕业设计论文模板

学术分享 | 基于OpenVINO的多染色病理图像信息评估系统设计与开发

Record a troubleshooting when overseas pictures cannot be loaded
随机推荐
Chapter 3 performance platform godeye source code analysis - memory module
Use flink1.14 to operate iceberg0.13
[database] must know and be able at the end of the term ----- Chapter 1 database overview
Chapter 1 performance platform godeye source code analysis - overall architecture
How to use Google Earth client and KML Download
Graphic verification code verification
PAC十年:见证HPC从CPU时代走向XPU纪元
[MySQL] install and configure MySQL on the ECS and connect with idea
The software supply chain security risk that makes enterprise digitalization and it executives bear the brunt of the cauldron points to the north
Tutorial: Adaptive Replication and Partitioning in Data Systems
How does the enterprise post office set up SPF records?
How to filter viruses / spam more effectively!
Timeline components
图形验证码验证
XDC 2022 Intel 技术专场:英特尔软硬件技术构筑云计算架构基石
Common functions of JMeter - parametric introduction
Some problems after xcode11 new project
小程序毕设作品之微信电子书阅读小程序毕业设计(6)开题答辩PPT
Chapter 0 performance platform godeye source code analysis - Course Introduction
Idea configures SFTP and SSH, which is very convenient to deploy and locate error logs