当前位置:网站首页>Aurora system model of learning database
Aurora system model of learning database
2022-07-06 13:23:00 【Li Suqing】
overview
Aurora yes AWS Provided Relational Database Service One of , oriented OLTP Business scenario .
The core idea
The performance bottleneck of data processing has shifted from storage and computing to the network .
Solution
take RedoLog Push down from the kernel to Aurora Multi tenant scalable storage services .
Introduce
Deposit is separate
In modern distributed cloud services , elastic and Extensibility Mostly through Deposit is separate Realization , The upper layer is stateless , Lower level shared distributed storage .
The introduction of distributed storage makes IO Operations can be executed concurrently , But there are advantages and disadvantages , Because of the local IO To the network IO The transformation of , The system performance will be limited by the network environment .
besides , Traditional database architecture 2PC、3PC Distributed transaction protocol , Due to the high requirements for the network environment , Will no longer apply to shared distributed storage architectures .
Kernel disassembly
Aurora The same is to use the storage and accounting separation architecture , In order to solve the above problems , take RedoLog Push down to the storage tier , The upper layer only needs to write to the storage layer RedoLog, Reduce network IO, also RedoLog Relevant functions of, such as fault recovery 、 Backup restore , Handled asynchronously by the storage layer .
WAL Benefits of falling into the storage tier ?
- Better fault tolerance .
- IOPS A lower .
- Asynchronous replication and recovery .
Persistence of large-scale systems
Aurora use Quorum Realize the persistence of storage layer , Set the total number of nodes to T, Every time you write N Nodes , Each read M Nodes , Yes Quorum Constraints ,N+M>T
establish , And because each write needs to be aware of the last write , therefore N>T/2
establish .
Think about ,Quorum It ensures that the written data will be read .
Area and availability area
The computer rooms of cloud computing companies are generally divided into several regions (Region), For example, a computer room in North China , A machine room in East China . Each region is divided into several isolated availability areas such as power and network (AZ), identical Region Of AZ It can be interconnected through intranet .
Nodes are deployed in the same AZ in , Lower network latency ; Deploy in different AZ in , Better disaster tolerance . stay Auraro in , Use 3 individual AZ, Every AZ hold 2 Copies , Write 4 read 3 The plan .
Segmented storage
If an error occurs , And another error occurred before the error was fixed , that Quorum It is likely to be broken , Breaking can be reduced by reducing the time to fix errors Quorom Probability ,Aurora Solve this problem by segmented storage .
Split the database volume into several 10GB Data segment size , Each paragraph has 6 Copies , Call this 6 Copies are one Protection Group, Average distribution in 3 individual ZA On . After segmentation, the space of each segment is smaller , Data recovery is also faster .
The log is the database
As mentioned above Quorum+Group Model ,IO Will be copied and enlarged , At the same time a lot of IO There will be synchronous waiting , Even with chain copying , We also have to face the problem of synchronization delay .
Traditional database writing will modify the data page first , Then record WAL, And in the Aurora in , Data pages will not be changed at the database level , Only records WAL, The log application will be applied asynchronously in the background WAL Generate data pages .
In the structure above , The primary instance logs to the storage layer , wait for 6 One copy of 4 Responses succeeded , The copy is responsible for applying the log to the data page . Although this is the same 6 Times magnified the write operation , But it greatly reduces the network load .
Principle of consistency
Because of the log , So there's no need for 2PC Let's do consistency , Instead, state consistency can be maintained asynchronously . stay Aurora in , Each copy maintains two values :VCL and CPL, Respectively represents the maximum applied log serial number , And the agreed maximum log serial number . And when recovering, it is more than VDL( Less than or equal to VCL One of the biggest CPL) Log is truncated .
I can't help thinking of Raft, This discord lastCommitted and lastApplied What is the same ?
About whether the latest data can't be read by the read operation ,Auraro Also associated with a read operation LSN( Log serial number ), Ensure that the read data pages are up-to-date through the sequential application of logs .
End
This article mainly talks about share disk、6 copy 、WAL These things , Not very detailed , It's mainly because I'm afraid of writing more and making more mistakes , For more details, please see the original . Non professional articles , If there is any mistake, please point it out .
边栏推荐
- 西安电子科技大学22学年上学期《射频电路基础》试题及答案
- Tyut Taiyuan University of technology 2022 introduction to software engineering summary
- (超详细二)onenet数据可视化详解,如何用截取数据流绘图
- Introduction and use of redis
- 初识C语言(上)
- Counter attack of flour dregs: redis series 52 questions, 30000 words + 80 pictures in detail.
- TYUT太原理工大学2022数据库大题之数据库操作
- Inheritance and polymorphism (Part 2)
- TYUT太原理工大学2022“mao gai”必背
- Edit distance (multi-source BFS)
猜你喜欢
系统设计学习(二)Design a key-value cache to save the results of the most recent web server queries
String类
阿里云微服务(三)Sentinel开源流控熔断降级组件
Alibaba cloud microservices (IV) service mesh overview and instance istio
面试必备:聊聊分布式锁的多种实现!
Common method signatures and meanings of Iterable, collection and list
Arduino+ds18b20 temperature sensor (buzzer alarm) +lcd1602 display (IIC drive)
2022 National Games RE1 baby_ tree
MySQL 30000 word essence summary + 100 interview questions, hanging the interviewer is more than enough (Collection Series
Questions and answers of "basic experiment" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
随机推荐
4.30动态内存分配笔记
阿里云微服务(一)服务注册中心Nacos以及REST Template和Feign Client
Shortest Hamilton path (pressure DP)
Design a key value cache to save the results of the most recent Web server queries
View UI Plus 发布 1.1.0 版本,支持 SSR、支持 Nuxt、增加 TS 声明文件
如何保障 MySQL 和 Redis 的数据一致性?
Alibaba cloud microservices (I) service registry Nacos, rest template and feign client
FileInputStream和BufferedInputStream的比较
TYUT太原理工大学2022数据库大题之分解关系模式
TYUT太原理工大学2022数据库考试题型大纲
ROS machine voice
Common method signatures and meanings of Iterable, collection and list
架构师怎样绘制系统架构蓝图?
There is always one of the eight computer operations that you can't learn programming
IPv6 experiment
View UI plus released version 1.3.1 to enhance the experience of typescript
(超详细onenet TCP协议接入)arduino+esp8266-01s接入物联网平台,上传实时采集数据/TCP透传(以及lua脚本如何获取和编写)
Dark chain lock (lca+ difference on tree)
十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
一文搞定 UDP 和 TCP 高频面试题!