Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
简介与概述
|
17
据库发展受限的情况可能发生改变。NVM 存储减少甚至完全消除了(取决于某个确切的
技术)读和写的延迟之间的不对称,进一步提高了读写性能,并允许字节可寻址(byte-
addressable)访问。
基于内存存储的持久性
内存数据库系统在磁盘上维护备份,以提供持久性并防止易失性数据的丢失。有些数据
库只在内存中存储数据,没有任何持久性保证,但在本书的范围内我们不讨论它们。
数据库在认定操作完成之前,必须先将其结果写入一个顺序日志文件。我们将在 5.2 节
中更详细地讨论预写日志。为了避免在启动过程中或崩溃后重放完整的日志内容,内存
数据库维护了一个
备份副本
,该备份副本使用一个基于磁盘且已排序的数据结构,并且
对该结构的修改通常是异步(与客户端请求解耦)且分批处理的,这样可以减少 I/O 操
作的数量。在恢复过程中,数据库可以从备份和日志中还原数据库内容。
日志数据通常用于批量备份。在处理该批日志数据之后,备份将持有截止到这一特
定时间点的数据库
快照
,因此可以丢弃之前的日志内容。这个过程称为
生成检查点
(checkpointing)。它会更新磁盘上的数据库快照使其更接近最新的日志条目,从而缩短
恢复时间,且备份过程不会阻塞客户端请求。
一些说法认为内存数据库相当于一个具有巨大页缓存的磁盘数据库,这是不公
平 的 (见 5.1 节)。即使页
缓存
在内存里,序列化格式和数据布局也会使磁盘
数据库产生额外的开销,而不会达到与内存数据库相同的优化程度。
磁盘数据库使用专门的存储结构,针对磁盘访问进行了优化 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787111655169