For Persistence (and Performance)
For Persistence (and Performance)
For Persistence (and Performance)
For Persistence (and Performance)
For Persistence (and Performance)
持久数据的 “持久”
如果我们的数据 “就地消失”
即刻挂科/退学?
For Persistence (and Performance)
持久数据的 “持久” (cont'd)
如果我们的数据 “就地消失”
存款/贷款清零?
For Persistence (and Performance)
没有 “一个” 绝对可靠的存储设备
临时失效
Kernel panic (bug); 断电
部分失效
ECC 纠错失败; fail slow
永久失效
小概率事件:硬盘物理损坏 (大量重复 = 必然发生)
极小概率事件:战争爆发/三体人进攻地球/世界毁灭
For Persistence (and Performance)
RAID: 存储设备的虚拟化
性能和可靠性,我们能不能全都要呢?
Redundant Array of Inexpensive (
Independent
) Disks (RAID)
把多个 (不可靠的) 磁盘虚拟成一块
非常可靠且性能极高
的虚拟磁盘
A case for redundant arrays of inexpensive disks (RAID)
(SIGMOD'88)
一个 “反向” 的虚拟化
类比:进程/虚存/文件把 “一个设备” 虚拟成多份
For Persistence (and Performance)
计算机系统的黄金时代
凑几块盘,掀翻整个产业链!
“Single Large Expensive Disks” (IBM 3380), v.s.
“Redundant Array of Inexpensive Disks”
For Persistence (and Performance)
RAID: Design Space
RAID (虚拟化) =
虚拟块号到 (磁盘, 块号) 的 “映射”
虚拟磁盘块可以存储在任何物理磁盘上
物理磁盘读写可以
并行
;存储
>
1
>1
>
1
份即可实现
容错
RAID-0:更大的容量、更快的速度
读速度 x 2;写速度 x 2
Quiz: 交错排列还是一分为二?
RAID-1:镜像 (容错)
保持两块盘完全一样
读速度 x 2;写速度保持一致
For Persistence (and Performance)
容错的代价
浪费了一块盘的容量……
如果我们有 100 块盘
但假设不会有两块盘同时 fail-stop?
能不能只用 1-bit 的冗余,恢复出一个丢失的 bit?
x
=
a
⊕
b
⊕
c
x = a \oplus b \oplus c
x
=
a
⊕
b
⊕
c
a
=
x
⊕
b
⊕
c
a = x \oplus b \oplus c
a
=
x
⊕
b
⊕
c
b
=
a
⊕
x
⊕
c
b = a \oplus x \oplus c
b
=
a
⊕
x
⊕
c
c
=
a
⊕
b
⊕
x
c = a \oplus b \oplus x
c
=
a
⊕
b
⊕
x
100 块盘里,99 块盘都是数据!
Caveat: random write 性能
For Persistence (and Performance)
RAID-5: Rotating Parity
使 Parity 均匀分布在各个磁盘
For Persistence (and Performance)
RAID: 讨论
更快、更可靠、近乎免费的大容量磁盘
从此再无 “高可靠性磁盘”
For Persistence (and Performance)
RAID: 自身的可靠性
磁盘 Fail-stop
软件可以感知
自动启用备盘并复制数据
期间性能下降
RAID 物理磁盘不能完美同步
断电 → 数据不一致
如何解决?
For Persistence (and Performance)
计算机系统的又一个黄金时代
“三驾马车” 开启 “大数据” 时代
GFS (Google file system)
(SOSP'03),
MapReduce
(OSDI'04),
BigTable
(OSDI'06)
(这是一个分布式的 RAID)
For Persistence (and Performance)
数据中心存储:一个 “分布式的 RAID”
Everything is Virtual
阿里云 Elastic Block Storage (
EBS
, FAST'24
)
现在理解为什么云厂商能躺着挣
了
算上 3X replica,amplification 还
<
1
<1
<
1
For Persistence (and Performance)
数据中心存储的挑战
Data corruption
磁盘看起来正常,但
一部分数据坏了
Fail-slow
Firmware bug; device error; wear-out; configuration; environment; ... 磁盘上的 “
性能问题
”
我亲历过 fail-slow 的 HDD!
For Persistence (and Performance)
计算机系统的下一个黄金时代?