Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
简介与概述
|
153
即使我们解决了并发访问的问题,我们依然无法保证所有进程都是同步的。
为了访问数据库,进程需要通过通信介质发送和接受消息,以查询或修改状态。但是,
如果一个进程很久都没有从数据库得到响应会如何?为了回答这个问题,我们首先要定
义什么是
很久
。为此,必须从
同步性
的角度来描述系统:通信是否是全异步的?是否存
在某些时序假设?如果存在的话,这些时序假设将允许我们引入操作超时和重试机制。
我们无从知晓数据库没有响应是因为过载、不可用、响应太慢还是网络问题。这描述了
崩溃的
本质
—
进程可能以各种方式崩溃:可能因某种原因无法继续执行后面的算法步
骤;可能遇到了临时性的故障;也可能是消息丢失。我们需要定义一个
故障模型
并描述
故障可能发生的方式,然后再决定如何处理它们。
如果系统在故障发生时仍然能继续正常运行,我们将这样的特性称为
容错性
。故障是不
可避免的,所以我们需要构建出具有可靠组件的系统。消除单点故障,比如前文提到的
单节点数据库,可能是我们朝此方向迈出的第一步。我们可以引入一些
冗余
,增设备份
数据库。然而这就引出了另一个问题:如何使共享状态的
多个副本
保持同步?
到目前为止,在我们这个简单系统中引入共享状态所带来的问题比答案还多。现在我们
知道,共享状态不像引入数据库那样简单,还必须采取更细化的方法,即基于消息传递
来描述各个独立进程之间的交互。
8.2
分布式计算的误区
理想情况下,当两台计算机在网络上通信时,一切都能正常工作:进程开启一个连接、
发送数据、收到响应,每个人都很开心。但是假设所有操作总会成功并且没有任何错误 ...
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