1 / 16

分布式存储

分布式存储. Distributed storage. 分布式存储引擎. 用户. 控制分类主机. Distributed storage-engine. 将用户分成三类,直接访问存储该类用户数据的数据库主机. 很难扩容 数据可靠性无法保证 单点问题. 存在的问题. 增加主机. Problems. 恢复工作. 主服务器宕机. Dynamo. Amazon 公司 分布式存储引擎 基于 key/value 存储模式. outline. 系统架构. Architecture. A. 哈希分布 ( 1-20 ). 扩容问题.

Download Presentation

分布式存储

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 分布式存储 Distributed storage

  2. 分布式存储引擎 用户 控制分类主机 Distributed storage-engine 将用户分成三类,直接访问存储该类用户数据的数据库主机

  3. 很难扩容 • 数据可靠性无法保证 • 单点问题 存在的问题 增加主机 Problems 恢复工作 主服务器宕机

  4. Dynamo • Amazon公司 • 分布式存储引擎 • 基于key/value • 存储模式 outline

  5. 系统架构 Architecture

  6. A • 哈希分布 • ( 1-20 ) 扩容问题 (1, 4, 7, 10, 13, 16, 19) ( 1, 5, 9, 13, 17) B (2, 5, 8, 11, 14, 17, 20) ( 2, 6, 10, 14, 18) Capacity Expansion C 消耗性能 (3, 6, 9, 12, 15, 18) ( 3, 7, 11, 15, 19) D consistenthashing ( 4, 8, 12, 15, 20)

  7. A B C D Key K Consistent Hashing Algorithm definition 能力相同 虚节点

  8. A B C E D Key K 虚节点 Abstract Node Q / S Q >> S

  9. A B C B C A.bak A A B D • 主机不可用是常态 • 备份节点 • 双机热备 • 备份数改为3 • 节点离开系统 • 节点加入系统 数据可靠性 Data Reliability

  10. 异步备份 • 同步备份 B C A A B C 数据备份 Write Data Backup ACID NWR模型 Read (old data)

  11. 参数 • N: 数据对象将被复制到N台主机 • R: 一次成功的读取操作中最小 • 参与节点数量 • W: 一次成功的写操作中最小参与节点数量 • R + W > N • 高可写:(N, R, W) = (3, 3, 1) • 高读效率: W = N, R = 1 NWR模型 NWR Model R > N - W

  12. Server C A • X: Write key= 3 Y: Read key • X: key++ && Y: key++ • key = 4 ? (实际上为5) • 设版本值 • N = 3, W = 1 数据版本控制 Y (4, v1) (4, v1) (3, v1) X (3, v1) (4, v1) Version Control v1 v2 W = N X Key vector clock (3, v1) (4, v1)

  13. A B C W=1, N = R = 3 Vector Clock • D1(A, 1) • D2(A, 2) Algorithm Definition W = N • D2(A, 2) • D2(A, 2) • D3(A, 2; B, 1) • D4(A, 2; C, 1) peer to peer 对数据D的一次读操作,包括D2,D3,D4,版本冲突交由客户端解决 客户端合并D3,D4,产生(A, 2; B, 1; C, 1) 由B重新写入:D5(A, 2; B, 2; C, 1)

  14. 单点故障 • 完全分布式 • 不存在一个核心 • 每个节点承担所有功能 Single-node

  15. Summary • 分布式存储 • 随着分布式计算的日趋流行, • 分布式存储也越来越受大家 • 关注 • 关键问题 • 扩容问题 • 单点性能瓶颈 • 数据一致性和可靠性

  16. 谢谢! thank you • Q & A

More Related