Merge branch 'master' into gitter-badge-1

This commit is contained in:
Donne Martin
2019-05-17 22:41:18 -04:00
committed by GitHub
14 changed files with 168 additions and 122 deletions

View File

@@ -3,10 +3,12 @@
> * 译者:[XatMassacrE](https://github.com/XatMassacrE)、[L9m](https://github.com/L9m)、[Airmacho](https://github.com/Airmacho)、[xiaoyusilen](https://github.com/xiaoyusilen)、[jifaxu](https://github.com/jifaxu)
> * 这个 [链接](https://github.com/xitu/system-design-primer/compare/master...donnemartin:master) 用来查看本翻译与英文版是否有差别(如果你没有看到 README.md 发生变化,那就意味着这份翻译文档是最新的)。
*[English](README.md) ∙ [日本語](README-ja.md) ∙ [简体中文](README-zh-Hans.md) ∙ [繁體中文](README-zh-TW.md) | [العَرَبِيَّة‎](https://github.com/donnemartin/system-design-primer/issues/170) ∙ [বাংলা](https://github.com/donnemartin/system-design-primer/issues/220) ∙ [Português do Brasil](https://github.com/donnemartin/system-design-primer/issues/40) ∙ [Deutsch](https://github.com/donnemartin/system-design-primer/issues/186) ∙ [ελληνικά](https://github.com/donnemartin/system-design-primer/issues/130) ∙ [Italiano](https://github.com/donnemartin/system-design-primer/issues/104) ∙ [韓國語](https://github.com/donnemartin/system-design-primer/issues/102) ∙ [فارسی](https://github.com/donnemartin/system-design-primer/issues/110) ∙ [Polski](https://github.com/donnemartin/system-design-primer/issues/68) ∙ [русский язык](https://github.com/donnemartin/system-design-primer/issues/87) ∙ [Español](https://github.com/donnemartin/system-design-primer/issues/136) ∙ [ภาษาไทย](https://github.com/donnemartin/system-design-primer/issues/187) ∙ [Türkçe](https://github.com/donnemartin/system-design-primer/issues/39) ∙ [tiếng Việt](https://github.com/donnemartin/system-design-primer/issues/127) ∙ [Français](https://github.com/donnemartin/system-design-primer/issues/250) | [Add Translation](https://github.com/donnemartin/system-design-primer/issues/28)*
# 系统设计入门
<p align="center">
<img src="http://i.imgur.com/jj3A5N8.png">
<img src="http://i.imgur.com/jj3A5N8.png"/>
<br/>
</p>
@@ -56,7 +58,7 @@
## 抽认卡
<p align="center">
<img src="http://i.imgur.com/zdCAkB3.png">
<img src="http://i.imgur.com/zdCAkB3.png"/>
<br/>
</p>
@@ -73,7 +75,7 @@
你正在寻找资源以准备[**编程面试**](https://github.com/donnemartin/interactive-coding-challenges)吗?
<p align="center">
<img src="http://i.imgur.com/b4YtAEN.png">
<img src="http://i.imgur.com/b4YtAEN.png"/>
<br/>
</p>
@@ -103,7 +105,7 @@
<p align="center">
<img src="http://i.imgur.com/jrUBAF7.png">
<img src="http://i.imgur.com/jrUBAF7.png"/>
<br/>
</p>
@@ -447,7 +449,7 @@
### CAP 理论
<p align="center">
<img src="http://i.imgur.com/bgLMI2u.png">
<img src="http://i.imgur.com/bgLMI2u.png"/>
<br/>
<strong><a href="http://robertgreiner.com/2014/08/cap-theorem-revisited">来源:再看 CAP 理论</a></strong>
</p>
@@ -542,7 +544,7 @@ DNS 和 email 等系统使用的是此种方式。最终一致性在高可用性
## 域名系统
<p align="center">
<img src="http://i.imgur.com/IOyLj4i.jpg">
<img src="http://i.imgur.com/IOyLj4i.jpg"/>
<br/>
<strong><a href="http://www.slideshare.net/srikrupa5/dns-security-presentation-issa">来源DNS 安全介绍</a></strong>
</p>
@@ -580,7 +582,7 @@ DNS 和 email 等系统使用的是此种方式。最终一致性在高可用性
## 内容分发网络CDN
<p align="center">
<img src="http://i.imgur.com/h9TAuGI.jpg">
<img src="http://i.imgur.com/h9TAuGI.jpg"/>
<br/>
<strong><a href="https://www.creative-artworks.eu/why-use-a-content-delivery-network-cdn/">来源:为什么使用 CDN</a></strong>
</p>
@@ -619,7 +621,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
## 负载均衡器
<p align="center">
<img src="http://i.imgur.com/h81n9iK.png">
<img src="http://i.imgur.com/h81n9iK.png"/>
<br/>
<strong><a href="http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.html">来源:可扩展的系统设计模式</a></strong>
</p>
@@ -688,7 +690,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
## 反向代理web 服务器)
<p align="center">
<img src="http://i.imgur.com/n41Azff.png">
<img src="http://i.imgur.com/n41Azff.png"/>
<br/>
<strong><a href="https://upload.wikimedia.org/wikipedia/commons/6/67/Reverse_proxy_h2g2bob.svg">资料来源:维基百科</a></strong>
<br/>
@@ -732,7 +734,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
## 应用层
<p align="center">
<img src="http://i.imgur.com/yB5SYwm.png">
<img src="http://i.imgur.com/yB5SYwm.png"/>
<br/>
<strong><a href="http://lethain.com/introduction-to-architecting-systems-for-scale/#platform_layer">资料来源:可缩放系统构架介绍</a></strong>
</p>
@@ -770,7 +772,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
## 数据库
<p align="center">
<img src="http://i.imgur.com/Xkm5CXz.png">
<img src="http://i.imgur.com/Xkm5CXz.png"/>
<br/>
<strong><a href="https://www.youtube.com/watch?v=w95murBkYmU">资料来源:扩展你的用户数到第一个一千万</a></strong>
</p>
@@ -791,7 +793,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
关系型数据库扩展包括许多技术:**主从复制**、**主主复制**、**联合**、**分片**、**非规范化**和 **SQL调优**
<p align="center">
<img src="http://i.imgur.com/C9ioGtn.png">
<img src="http://i.imgur.com/C9ioGtn.png"/>
<br/>
<strong><a href="http://www.slideshare.net/jboner/scalability-availability-stability-patterns/">资料来源:可扩展性、可用性、稳定性、模式</a></strong>
</p>
@@ -806,7 +808,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
- 参考[不利之处:复制](#不利之处复制)中,主从复制和主主复制**共同**的问题。
<p align="center">
<img src="http://i.imgur.com/krAHLGg.png">
<img src="http://i.imgur.com/krAHLGg.png"/>
<br/>
<strong><a href="http://www.slideshare.net/jboner/scalability-availability-stability-patterns/">资料来源:可扩展性、可用性、稳定性、模式</a></strong>
</p>
@@ -841,7 +843,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
#### 联合
<p align="center">
<img src="http://i.imgur.com/U3qV33e.png">
<img src="http://i.imgur.com/U3qV33e.png"/>
<br/>
<strong><a href="https://www.youtube.com/watch?v=w95murBkYmU">资料来源:扩展你的用户数到第一个一千万</a></strong>
</p>
@@ -863,7 +865,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源
#### 分片
<p align="center">
<img src="http://i.imgur.com/wU8x5Id.png">
<img src="http://i.imgur.com/wU8x5Id.png"/>
<br/>
<strong><a href="http://www.slideshare.net/jboner/scalability-availability-stability-patterns/">资料来源:可扩展性、可用性、稳定性、模式</a></strong>
</p>
@@ -1007,7 +1009,7 @@ MongoDB 和 CouchDB 等一些文档类型存储还提供了类似 SQL 语言的
#### 列型存储
<p align="center">
<img src="http://i.imgur.com/n16iOGk.png">
<img src="http://i.imgur.com/n16iOGk.png"/>
<br/>
<strong><a href="http://blog.grio.com/2015/11/sql-nosql-a-brief-history.html">资料来源: SQL 和 NoSQL一个简短的历史</a></strong>
</p>
@@ -1030,9 +1032,9 @@ Google 发布了第一个列型存储数据库 [Bigtable](http://www.read.seas.h
#### 图数据库
<p align="center">
<img src="http://i.imgur.com/fNcl65g.png">
<img src="http://i.imgur.com/fNcl65g.png"/>
<br/>
<strong><a href="https://en.wikipedia.org/wiki/File:GraphDatabase_PropertyGraph.png">资料来源:图数据库</a></strong>
<strong><a href="https://en.wikipedia.org/wiki/File:GraphDatabase_PropertyGraph.png"/>资料来源:图数据库</a></strong>
</p>
> 抽象模型: 图
@@ -1057,7 +1059,7 @@ Google 发布了第一个列型存储数据库 [Bigtable](http://www.read.seas.h
### SQL 还是 NoSQL
<p align="center">
<img src="http://i.imgur.com/wXGqG5f.png">
<img src="http://i.imgur.com/wXGqG5f.png"/>
<br/>
<strong><a href="https://www.infoq.com/articles/Transition-RDBMS-NoSQL/">资料来源:从 RDBMS 转换到 NoSQL</a></strong>
</p>
@@ -1098,7 +1100,7 @@ Google 发布了第一个列型存储数据库 [Bigtable](http://www.read.seas.h
## 缓存
<p align="center">
<img src="http://i.imgur.com/Q6z24La.png">
<img src="http://i.imgur.com/Q6z24La.png"/>
<br/>
<strong><a href="http://horicky.blogspot.com/2010/10/scalable-system-design-patterns.html">资料来源:可扩展的系统设计模式</a></strong>
</p>
@@ -1169,7 +1171,7 @@ Redis 有下列附加功能:
#### 缓存模式
<p align="center">
<img src="http://i.imgur.com/ONjORqk.png">
<img src="http://i.imgur.com/ONjORqk.png"/>
<br/>
<strong><a href="http://www.slideshare.net/tmatyashovsky/from-cache-to-in-memory-data-grid-introduction-to-hazelcast">资料来源:从缓存到内存数据网格</a></strong>
</p>
@@ -1181,7 +1183,7 @@ Redis 有下列附加功能:
- 将查找到的结果存储到缓存中
- 返回所需内容
```
```python
def get_user(self, user_id):
user = cache.get("user.{0}", user_id)
if user is None:
@@ -1205,7 +1207,7 @@ def get_user(self, user_id):
#### 直写模式
<p align="center">
<img src="http://i.imgur.com/0vBc0hN.png">
<img src="http://i.imgur.com/0vBc0hN.png"/>
<br/>
<strong><a href="http://www.slideshare.net/jboner/scalability-availability-stability-patterns/">资料来源:可扩展性、可用性、稳定性、模式</a></strong>
</p>
@@ -1224,7 +1226,7 @@ set_user(12345, {"foo":"bar"})
缓存代码:
```
```python
def set_user(user_id, values):
user = db.query("UPDATE Users WHERE id = {0}", user_id, values)
cache.set(user_id, user)
@@ -1240,7 +1242,7 @@ def set_user(user_id, values):
#### 回写模式
<p align="center">
<img src="http://i.imgur.com/rgSrvjG.png">
<img src="http://i.imgur.com/rgSrvjG.png"/>
<br/>
<strong><a href="http://www.slideshare.net/jboner/scalability-availability-stability-patterns/">资料来源:可扩展性、可用性、稳定性、模式</a></strong>
</p>
@@ -1258,7 +1260,7 @@ def set_user(user_id, values):
#### 刷新
<p align="center">
<img src="http://i.imgur.com/kxtjqgE.png">
<img src="http://i.imgur.com/kxtjqgE.png"/>
<br/>
<strong><a href=http://www.slideshare.net/tmatyashovsky/from-cache-to-in-memory-data-grid-introduction-to-hazelcast>资料来源:从缓存到内存数据网格</a></strong>
</p>
@@ -1290,7 +1292,7 @@ def set_user(user_id, values):
## 异步
<p align="center">
<img src="http://i.imgur.com/54GYsSx.png">
<img src="http://i.imgur.com/54GYsSx.png"/>
<br/>
<strong><a href=http://lethain.com/introduction-to-architecting-systems-for-scale/#platform_layer>资料来源:可缩放系统构架介绍</a></strong>
</p>
@@ -1336,7 +1338,7 @@ def set_user(user_id, values):
## 通讯
<p align="center">
<img src="http://i.imgur.com/5KeocQs.jpg">
<img src="http://i.imgur.com/5KeocQs.jpg"/>
<br/>
<strong><a href=http://www.escotal.com/osilayer.html>资料来源OSI 7层模型</a></strong>
</p>
@@ -1371,7 +1373,7 @@ HTTP 是依赖于较低级协议(如 **TCP** 和 **UDP**)的应用层协议
### 传输控制协议TCP
<p align="center">
<img src="http://i.imgur.com/JdAsdvG.jpg">
<img src="http://i.imgur.com/JdAsdvG.jpg"/>
<br/>
<strong><a href="http://www.wildbunny.co.uk/blog/2012/10/09/how-to-make-a-multi-player-game-part-1/">资料来源:如何制作多人游戏</a></strong>
</p>
@@ -1395,7 +1397,7 @@ TCP 对于需要高可靠性但时间紧迫的应用程序很有用。比如包
### 用户数据报协议UDP
<p align="center">
<img src="http://i.imgur.com/yzDrJtA.jpg">
<img src="http://i.imgur.com/yzDrJtA.jpg"/>
<br/>
<strong><a href="http://www.wildbunny.co.uk/blog/2012/10/09/how-to-make-a-multi-player-game-part-1">资料来源:如何制作多人游戏</a></strong>
</p>
@@ -1424,7 +1426,7 @@ UDP 可靠性更低但适合用在网络电话、视频聊天,流媒体和实
### 远程过程调用协议RPC
<p align="center">
<img src="http://i.imgur.com/iF4Mkb5.png">
<img src="http://i.imgur.com/iF4Mkb5.png"/>
<br/>
<strong><a href="http://www.puncsky.com/blog/2016/02/14/crack-the-system-design-interview">Source: Crack the system design interview</a></strong>
</p>
@@ -1619,7 +1621,7 @@ Notes
| 问题 | 引用 |
| ----------------------- | ---------------------------------------- |
| 设计类似于 Dropbox 的文件同步服务 | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) |
| 设计类似于 Google 的搜索引擎 | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)<br/>[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)<br/>[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)<br>[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) |
| 设计类似于 Google 的搜索引擎 | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)<br/>[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)<br/>[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)<br/>[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) |
| 设计类似于 Google 的可扩展网络爬虫 | [quora.com](https://www.quora.com/How-can-I-build-a-web-crawler-from-scratch) |
| 设计 Google 文档 | [code.google.com](https://code.google.com/p/google-mobwrite/)<br/>[neil.fraser.name](https://neil.fraser.name/writing/sync/) |
| 设计类似 Redis 的键值存储 | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) |
@@ -1646,7 +1648,7 @@ Notes
> 关于现实中真实的系统是怎么设计的文章。
<p align="center">
<img src="http://i.imgur.com/TcUo2fw.png">
<img src="http://i.imgur.com/TcUo2fw.png"/>
<br/>
<strong><a href="https://www.infoq.com/presentations/Twitter-Timeline-Scalability">Source: Twitter timelines at scale</a></strong>
</p>