Distributed Systems for Fun and Profit Notes

Distributed programming is the art of solving the same problem that you can solve on a single computer using multiple computers.

Basic

  • Scalability
  • Performance (and latency):performance 和 latency 之间有 tradeoff,你可以把更多的数据汇总一起处理,这样更快,但是 latency 就高了。
  • Availability
    $$
    Availability = uptime / (uptime + downtime)
    $$
Availability %How much downtime is allowed per year?
90% (“one nine”)More than a month
99% (“two nines”)Less than 4 days
99.9% (“three nines”)Less than 9 hours
99.99% (“four nines”)Less than an hour
99.999% (“five nines”)~ 5 minutes
99.9999% (“six nines”)~ 31 seconds

What Prevents us from achieving good thinds?

物理方面因素:

  • 节点的数量
  • 节点之间的距离

制约条件:

  • 随着节点数量的增加,增加了系统出现故障的概率
  • 随着节点数量的增加,增加了节点之间的 communication cost
  • 地理距离的增加,增加了系统之间通信的 minimum latency

Abstractions and models

  • System model (asynchronous / synchronous)
  • Failure model (crash-fail, partitions, Byzantine)
  • Consistency model (strong, eventual)

Design techniques: partition and replicate

partition 和 replicate 是解决分布式问题的两个绝招,可以理解为分而治之。

Partition:

把一份大的数据集分为很多小份:

  • Partitioning improves performance by limiting the amount of data to be examined and by locating related data in the same partition
  • Partitioning improves availability by allowing partitions to fail independently, increasing the number of nodes that need to fail before availability is sacrificed

Replication:

  • Replication improves performance by making additional computing power and bandwidth applicable to a new copy of the data
  • Replication improves availability by creating additional copies of the data, increasing the number of nodes that need to fail before availability is sacrificed

虽然 replication 好用,但是也会带来一致性副本的问题。
Only one consistency model for replication – strong consistency – allows you to program as-if the underlying data was not replicated. Other consistency models expose some internals of the replication to the programmer. However, weaker consistency models can provide lower latency and higher availability – and are not necessarily harder to understand, just different.

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇