Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Simon Knott
2019-05-12 10:49:54 +02:00
12 changed files with 91 additions and 91 deletions

View File

@@ -218,7 +218,7 @@ lang: zh-Hans
* **短期** - 以系统设计主题的**广度**为目标。通过解决**一些**面试题来练习。
* **中期** - 以系统设计主题的**广度**和**初级深度**为目标。通过解决**很多**面试题来练习。
* **长期** - 以系统设计主题的**广度**和**高级深度**为目标。通过解决**大部分**面试题来联系
* **长期** - 以系统设计主题的**广度**和**高级深度**为目标。通过解决**大部分**面试题来练习
| | 短期 | 中期 | 长期 |
| ---------------------------------------- | ---- | ---- | ---- |
@@ -269,20 +269,20 @@ lang: zh-Hans
* 数据库查找
* API 和面向对象设计
### 第四步:度量设计
### 第四步:扩展设计
确认和处理瓶颈以及一些限制。举例来说就是你需要下面的这些来完成展性的议题吗?
确认和处理瓶颈以及一些限制。举例来说就是你需要下面的这些来完成展性的议题吗?
* 负载均衡
* 水平
* 水平
* 缓存
* 数据库分片
论述可能的解决办法和代价。每件事情需要取舍。可以使用[展系统的设计原则](#系统设计主题的索引)来处理瓶颈。
论述可能的解决办法和代价。每件事情需要取舍。可以使用[展系统的设计原则](#系统设计主题的索引)来处理瓶颈。
### 预估计算量
你或许会被要求通过手算进行一些估算。涉及到的[附录](#附录)涉及到的是下面的这些资源:
你或许会被要求通过手算进行一些估算。[附录](#附录)涉及到的是下面的这些资源:
* [使用预估计算量](http://highscalability.com/blog/2011/1/26/google-pro-tip-use-back-of-the-envelope-calculations-to-choo.html)
* [2 的次方表](#2-的次方表)
@@ -402,7 +402,7 @@ lang: zh-Hans
### 第二步:回顾可扩展性文章
[可扩展性](http://www.lecloud.net/tagged/scalability)
[可扩展性](http://www.lecloud.net/tagged/scalability/chrono)
* 主题涵盖:
* [Clones](http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones)
@@ -1187,7 +1187,7 @@ Redis 有下列附加功能:
- 将查找到的结果存储到缓存中
- 返回所需内容
```
```python
def get_user(self, user_id):
user = cache.get("user.{0}", user_id)
if user is None:
@@ -1230,7 +1230,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)
@@ -1579,7 +1579,7 @@ Latency Comparison Numbers
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 100 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 10,000 ns 10 us
Send 1 KB bytes over 1 Gbps network 10,000 ns 10 us
@@ -1628,7 +1628,7 @@ Notes
| 设计类似于 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) |
| 设计类似 Redis 的值存储 | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) |
| 设计类似 Memcached 的缓存系统 | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) |
| 设计类似亚马逊的推荐系统 | [hulu.com](http://tech.hulu.com/blog/2011/09/19/recommendation-system.html)<br/>[ijcai13.org](http://ijcai13.org/files/tutorial_slides/td3.pdf) |
| 设计类似 Bitly 的短链接系统 | [n00tc0d3r.blogspot.com](http://n00tc0d3r.blogspot.com/) |