diff --git a/.gitignore b/.gitignore index 200a617..5ca2fa2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Byte-compiled / optimized / DLL files +*.epub __pycache__/ *.py[cod] diff --git a/README-ja.md b/README-ja.md index 2ace259..077df6e 100644 --- a/README-ja.md +++ b/README-ja.md @@ -3,7 +3,7 @@ # システム設計入門

- +

@@ -44,7 +44,7 @@ ## 暗記カード

- +

@@ -61,7 +61,7 @@ コード技術面接用の問題を探している場合は[**こちら**](https://github.com/donnemartin/interactive-coding-challenges)

- +

@@ -91,7 +91,7 @@ > それぞれのセクションはより学びを深めるような他の文献へのリンクが貼られています。

- +

@@ -436,7 +436,7 @@ ### CAP 理論

- +
Source: CAP theorem revisited

@@ -530,7 +530,7 @@ ## ドメインネームシステム

- +
Source: DNS security presentation

@@ -568,7 +568,7 @@ DNSは少数のオーソライズされたサーバーが上位に位置する ## コンテンツデリバリーネットワーク(Content delivery network)

- +
Source: Why use a CDN

@@ -609,7 +609,7 @@ CDNを用いてコンテンツを配信することで以下の二つの理由 ## ロードバランサー

- +
Source: Scalable system design patterns

@@ -679,7 +679,7 @@ Layer 7 ロードバランサーは [アプリケーションレイヤー](#通 ## リバースプロキシ(webサーバー)

- +
Source: Wikipedia
@@ -722,7 +722,7 @@ Layer 7 ロードバランサーは [アプリケーションレイヤー](#通 ## アプリケーション層

- +
Source: Intro to architecting systems for scale

@@ -759,7 +759,7 @@ Layer 7 ロードバランサーは [アプリケーションレイヤー](#通 ## データベース

- +
Source: Scaling up to your first 10 million users

@@ -782,7 +782,7 @@ SQLなどのリレーショナルデータベースはテーブルに整理さ マスターデータベースが読み取りと書き込みを処理し、書き込みを一つ以上のスレーブデータベースに複製します。スレーブデータベースは読み取りのみを処理します。スレーブデータベースは木構造のように追加のスレーブにデータを複製することもできます。マスターデータベースがオフラインになった場合には、いずれかのスレーブがマスターに昇格するか、新しいマスターデータベースが追加されるまでは読み取り専用モードで稼働します。

- +
Source: Scalability, availability, stability, patterns

@@ -797,7 +797,7 @@ SQLなどのリレーショナルデータベースはテーブルに整理さ いずれのマスターも読み取り書き込みの両方に対応する。書き込みに関してはそれぞれ協調する。いずれかのマスターが落ちても、システム全体としては読み書き両方に対応したまま運用できる。

- +
Source: Scalability, availability, stability, patterns

@@ -825,7 +825,7 @@ SQLなどのリレーショナルデータベースはテーブルに整理さ #### Federation

- +
Source: Scaling up to your first 10 million users

@@ -846,7 +846,7 @@ SQLなどのリレーショナルデータベースはテーブルに整理さ #### シャーディング

- +
Source: Scalability, availability, stability, patterns

@@ -990,7 +990,7 @@ NoSQL は **key-value store**、 **document-store**、 **wide column store**、 #### ワイドカラムストア

- +
Source: SQL & NoSQL, a brief history

@@ -1013,7 +1013,7 @@ Googleは[Bigtable](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/cha #### グラフデータベース

- +
Source: Graph database

@@ -1041,7 +1041,7 @@ Googleは[Bigtable](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/cha ### SQLか?NoSQLか?

- +
Source: Transitioning from RDBMS to NoSQL

@@ -1083,7 +1083,7 @@ NoSQLに適するサンプルデータ: ## キャッシュ

- +
Source: Scalable system design patterns

@@ -1154,7 +1154,7 @@ Redisはさらに以下のような機能を備えています: #### キャッシュアサイド

- +
Source: From cache to in-memory data grid

@@ -1190,7 +1190,7 @@ def get_user(self, user_id): #### ライトスルー

- +
Source: Scalability, availability, stability, patterns

@@ -1225,7 +1225,7 @@ def set_user(user_id, values): #### ライトビハインド (ライトバック)

- +
Source: Scalability, availability, stability, patterns

@@ -1243,7 +1243,7 @@ def set_user(user_id, values): #### リフレッシュアヘッド

- +
Source: From cache to in-memory data grid

@@ -1275,7 +1275,7 @@ def set_user(user_id, values): ## 非同期処理

- +
Source: Intro to architecting systems for scale

@@ -1321,7 +1321,7 @@ def set_user(user_id, values): ## 通信

- +
Source: OSI 7 layer model

@@ -1353,7 +1353,7 @@ HTTPは**TCP** や **UDP** などの低級プロトコルに依存している ### 伝送制御プロトコル (TCP)

- +
Source: How to make a multiplayer game

@@ -1377,7 +1377,7 @@ TCPは高い依存性を要し、時間制約が厳しくないものに適し ### ユーザデータグラムプロトコル (UDP)

- +
Source: How to make a multiplayer game

@@ -1406,7 +1406,7 @@ TCPよりもUDPを使うのは: ### 遠隔手続呼出 (RPC)

- +
Source: Crack the system design interview

@@ -1602,7 +1602,7 @@ Notes | 質問 | 解答 | |---|---| | Dropboxのようなファイル同期サービスを設計する | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) | -| Googleのような検索エンジンの設計 | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | +| Googleのような検索エンジンの設計 | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | | Googleのようなスケーラブルなwebクローラーの設計 | [quora.com](https://www.quora.com/How-can-I-build-a-web-crawler-from-scratch) | | Google docsの設計 | [code.google.com](https://code.google.com/p/google-mobwrite/)
[neil.fraser.name](https://neil.fraser.name/writing/sync/) | | Redisのようなキーバリューストアの設計 | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | @@ -1629,7 +1629,7 @@ Notes > 世の中のシステムがどのように設計されているかについての記事

- +
Source: Twitter timelines at scale

diff --git a/README-zh-Hans.md b/README-zh-Hans.md index c8847c3..b71b053 100644 --- a/README-zh-Hans.md +++ b/README-zh-Hans.md @@ -6,7 +6,7 @@ # 系统设计入门

- +

@@ -55,7 +55,7 @@ ## 抽认卡

- +

@@ -72,7 +72,7 @@ 你正在寻找资源以准备[**编程面试**](https://github.com/donnemartin/interactive-coding-challenges)吗?

- +

@@ -102,7 +102,7 @@

- +

@@ -446,7 +446,7 @@ ### CAP 理论

- +
来源:再看 CAP 理论

@@ -541,7 +541,7 @@ DNS 和 email 等系统使用的是此种方式。最终一致性在高可用性 ## 域名系统

- +
来源:DNS 安全介绍

@@ -579,7 +579,7 @@ DNS 和 email 等系统使用的是此种方式。最终一致性在高可用性 ## 内容分发网络(CDN)

- +
来源:为什么使用 CDN

@@ -618,7 +618,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 ## 负载均衡器

- +
来源:可扩展的系统设计模式

@@ -687,7 +687,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 ## 反向代理(web 服务器)

- +
资料来源:维基百科
@@ -731,7 +731,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 ## 应用层

- +
资料来源:可缩放系统构架介绍

@@ -769,7 +769,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 ## 数据库

- +
资料来源:扩展你的用户数到第一个一千万

@@ -790,7 +790,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 关系型数据库扩展包括许多技术:**主从复制**、**主主复制**、**联合**、**分片**、**非规范化**和 **SQL调优**。

- +
资料来源:可扩展性、可用性、稳定性、模式

@@ -805,7 +805,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 - 参考[不利之处:复制](#不利之处复制)中,主从复制和主主复制**共同**的问题。

- +
资料来源:可扩展性、可用性、稳定性、模式

@@ -840,7 +840,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 #### 联合

- +
资料来源:扩展你的用户数到第一个一千万

@@ -862,7 +862,7 @@ CDN 拉取是当第一个用户请求该资源时,从服务器上拉取资源 #### 分片

- +
资料来源:可扩展性、可用性、稳定性、模式

@@ -1006,7 +1006,7 @@ MongoDB 和 CouchDB 等一些文档类型存储还提供了类似 SQL 语言的 #### 列型存储

- +
资料来源: SQL 和 NoSQL,一个简短的历史

@@ -1029,9 +1029,9 @@ Google 发布了第一个列型存储数据库 [Bigtable](http://www.read.seas.h #### 图数据库

- +
- 资料来源:图数据库 + 资料来源:图数据库

> 抽象模型: 图 @@ -1056,7 +1056,7 @@ Google 发布了第一个列型存储数据库 [Bigtable](http://www.read.seas.h ### SQL 还是 NoSQL

- +
资料来源:从 RDBMS 转换到 NoSQL

@@ -1097,7 +1097,7 @@ Google 发布了第一个列型存储数据库 [Bigtable](http://www.read.seas.h ## 缓存

- +
资料来源:可扩展的系统设计模式

@@ -1168,7 +1168,7 @@ Redis 有下列附加功能: #### 缓存模式

- +
资料来源:从缓存到内存数据网格

@@ -1204,7 +1204,7 @@ def get_user(self, user_id): #### 直写模式

- +
资料来源:可扩展性、可用性、稳定性、模式

@@ -1239,7 +1239,7 @@ def set_user(user_id, values): #### 回写模式

- +
资料来源:可扩展性、可用性、稳定性、模式

@@ -1257,7 +1257,7 @@ def set_user(user_id, values): #### 刷新

- +
资料来源:从缓存到内存数据网格

@@ -1289,7 +1289,7 @@ def set_user(user_id, values): ## 异步

- +
资料来源:可缩放系统构架介绍

@@ -1335,7 +1335,7 @@ def set_user(user_id, values): ## 通讯

- +
资料来源:OSI 7层模型

@@ -1370,7 +1370,7 @@ HTTP 是依赖于较低级协议(如 **TCP** 和 **UDP**)的应用层协议 ### 传输控制协议(TCP)

- +
资料来源:如何制作多人游戏

@@ -1394,7 +1394,7 @@ TCP 对于需要高可靠性但时间紧迫的应用程序很有用。比如包 ### 用户数据报协议(UDP)

- +
资料来源:如何制作多人游戏

@@ -1423,7 +1423,7 @@ UDP 可靠性更低但适合用在网络电话、视频聊天,流媒体和实 ### 远程过程调用协议(RPC)

- +
Source: Crack the system design interview

@@ -1618,7 +1618,7 @@ Notes | 问题 | 引用 | | ----------------------- | ---------------------------------------- | | 设计类似于 Dropbox 的文件同步服务 | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) | -| 设计类似于 Google 的搜索引擎 | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | +| 设计类似于 Google 的搜索引擎 | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[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/)
[neil.fraser.name](https://neil.fraser.name/writing/sync/) | | 设计类似 Redis 的键值存储 | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | @@ -1645,7 +1645,7 @@ Notes > 关于现实中真实的系统是怎么设计的文章。

- +
Source: Twitter timelines at scale

diff --git a/README-zh-TW.md b/README-zh-TW.md index 3c18f93..e0b6c7b 100644 --- a/README-zh-TW.md +++ b/README-zh-TW.md @@ -3,7 +3,7 @@ # 系統設計入門

- +

@@ -44,7 +44,7 @@ ## 學習單字卡

- +

@@ -61,7 +61,7 @@ 你正在尋找資源來面對[**程式語言面試**](https://github.com/donnemartin/interactive-coding-challenges)嗎?

- +

@@ -91,7 +91,7 @@ > 每一章節都包含更深入資源的連結。

- +

@@ -435,7 +435,7 @@ ### CAP 理論

- +
來源:再看 CAP 理論

@@ -529,7 +529,7 @@ DNS 或是電子郵件系統使用的就是這種方式,最終一致性在高 ## 域名系統

- +
資料來源:DNS 安全介紹

@@ -567,7 +567,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 ## 內容傳遞網路(CDN)

- +
來源:為什麼要使用 CDN

@@ -608,7 +608,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 ## 負載平衡器

- +
來源:可擴展的系統設計模式

@@ -678,7 +678,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 ## 反向代理(網頁伺服器)

- +
來源:維基百科
@@ -721,7 +721,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 ## 應用層

- +
資料來源:可縮放式系統架構介紹

@@ -758,7 +758,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 ## 資料庫

- +
來源:擴展你的使用者數量到第一個一千萬量級

@@ -781,7 +781,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 主資料庫負責讀和寫,並且將寫入的資料複寫至一或多個從屬資料庫中,從屬資料庫只負責讀取。而從屬資料庫可以再將寫入複製到更多以樹狀結構的其他資料庫中。如果主資料庫離線了,系統可以以只讀模式運行,直到某個從屬資料庫被提升為主資料庫,或有新的主資料庫出現。

- +
來源: 可擴展性、可用性、穩定性及其模式

@@ -796,7 +796,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 兩個主要的資料庫都負責讀取和寫入,並且兩者互相協調。如果其中一個主要資料庫離線,系統可以繼續運作。

- +
來源: 可擴展性、可用性、穩定性及其模式

@@ -824,7 +824,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 #### 聯邦式資料庫

- +
來源:擴展你的使用者數量到第一個一千萬量級

@@ -845,7 +845,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢 #### 分片

- +
來源: 可擴展性、可用性、穩定性及其模式

@@ -991,7 +991,7 @@ NoSQL 指的是 **鍵-值對的資料庫**、**文件類型資料庫**、**列 #### 列儲存型資料庫

- +
來源:SQL 和 NoSQL,簡短的歷史介紹

@@ -1014,7 +1014,7 @@ Google 發表了第一個列儲存型資料庫 [Bigtable](http://www.read.seas.h #### 圖形資料庫

- +
來源: 圖形化資料庫

@@ -1042,7 +1042,7 @@ Google 發表了第一個列儲存型資料庫 [Bigtable](http://www.read.seas.h ### SQL 或 NoSQL

- +
來源:從 RDBMS 轉換到 NoSQL

@@ -1084,7 +1084,7 @@ Google 發表了第一個列儲存型資料庫 [Bigtable](http://www.read.seas.h ## 快取

- +
來源:可擴展的系統設計模式

@@ -1155,7 +1155,7 @@ Redis 還有以下額外的功能: #### 快取模式

- +
資料來源:從快取到記憶體資料網格

@@ -1191,7 +1191,7 @@ def get_user(self, user_id): #### 寫入模式

- +
資料來源:可獲展性、可用性、穩定性與模式

@@ -1226,7 +1226,7 @@ def set_user(user_id, values): #### 事後寫入(回寫)

- +
資料來源:可獲展性、可用性、穩定性與模式

@@ -1244,7 +1244,7 @@ def set_user(user_id, values): #### 更新式快取

- +
來源:從快取到記憶體資料網格技術

@@ -1276,7 +1276,7 @@ def set_user(user_id, values): ## 非同步機制

- +
資料來源:可縮放性系統架構介紹

@@ -1322,7 +1322,7 @@ def set_user(user_id, values): ## 通訊

- +
來源:OSI 七層模型

@@ -1354,7 +1354,7 @@ HTTP 是依賴於較底層的協議(例如:**TCP** 和 **UDP**) 的應用層 ### 傳輸控制通訊協定(TCP)

- +
來源:如何開發多人遊戲

@@ -1378,7 +1378,7 @@ TCP 對於需要高可靠、低時間急迫性的應用來說很有用,比如 ### 使用者資料流通訊協定 (UDP)

- +
資料來源:如何製作多人遊戲

@@ -1407,7 +1407,7 @@ UDP 的可靠性較低,但適合用在像是網路電話、視訊聊天、串 ### 遠端程式呼叫 (RPC)

- +
資料來源:破解系統設計面試

@@ -1630,7 +1630,7 @@ Notes > 底下是關於真實世界的系統架構是如何設計的文章

- +
資料來源:可擴展式的 Twitter 時間軸設計

diff --git a/README.md b/README.md index 9982658..54edffa 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # The System Design Primer

- +

@@ -44,7 +44,7 @@ Additional topics for interview prep: ## Anki flashcards

- +

@@ -61,7 +61,7 @@ Great for use while on-the-go. Looking for resources to help you prep for the [**Coding Interview**](https://github.com/donnemartin/interactive-coding-challenges)?

- +

@@ -91,7 +91,7 @@ Review the [Contributing Guidelines](CONTRIBUTING.md). > Each section contains links to more in-depth resources.

- +

@@ -436,7 +436,7 @@ Generally, you should aim for **maximal throughput** with **acceptable latency** ### CAP theorem

- +
Source: CAP theorem revisited

@@ -530,7 +530,7 @@ This topic is further discussed in the [Database](#database) section: ## Domain name system

- +
Source: DNS security presentation

@@ -568,7 +568,7 @@ Services such as [CloudFlare](https://www.cloudflare.com/dns/) and [Route 53](ht ## Content delivery network

- +
Source: Why use a CDN

@@ -609,7 +609,7 @@ Sites with heavy traffic work well with pull CDNs, as traffic is spread out more ## Load balancer

- +
Source: Scalable system design patterns

@@ -679,7 +679,7 @@ Load balancers can also help with horizontal scaling, improving performance and ## Reverse proxy (web server)

- +
Source: Wikipedia
@@ -722,7 +722,7 @@ Additional benefits include: ## Application layer

- +
Source: Intro to architecting systems for scale

@@ -757,7 +757,7 @@ Systems such as [Consul](https://www.consul.io/docs/index.html), [Etcd](https:// ## Database

- +
Source: Scaling up to your first 10 million users

@@ -780,7 +780,7 @@ There are many techniques to scale a relational database: **master-slave replica The master serves reads and writes, replicating writes to one or more slaves, which serve only reads. Slaves can also replicate to additional slaves in a tree-like fashion. If the master goes offline, the system can continue to operate in read-only mode until a slave is promoted to a master or a new master is provisioned.

- +
Source: Scalability, availability, stability, patterns

@@ -795,7 +795,7 @@ The master serves reads and writes, replicating writes to one or more slaves, wh Both masters serve reads and writes and coordinate with each other on writes. If either master goes down, the system can continue to operate with both reads and writes.

- +
Source: Scalability, availability, stability, patterns

@@ -823,7 +823,7 @@ Both masters serve reads and writes and coordinate with each other on writes. I #### Federation

- +
Source: Scaling up to your first 10 million users

@@ -844,7 +844,7 @@ Federation (or functional partitioning) splits up databases by function. For ex #### Sharding

- +
Source: Scalability, availability, stability, patterns

@@ -988,7 +988,7 @@ Document stores provide high flexibility and are often used for working with occ #### Wide column store

- +
Source: SQL & NoSQL, a brief history

@@ -1011,7 +1011,7 @@ Wide column stores offer high availability and high scalability. They are often #### Graph database

- +
Source: Graph database

@@ -1039,7 +1039,7 @@ Graphs databases offer high performance for data models with complex relationshi ### SQL or NoSQL

- +
Source: Transitioning from RDBMS to NoSQL

@@ -1081,7 +1081,7 @@ Sample data well-suited for NoSQL: ## Cache

- +
Source: Scalable system design patterns

@@ -1152,7 +1152,7 @@ Since you can only store a limited amount of data in cache, you'll need to deter #### Cache-aside

- +
Source: From cache to in-memory data grid

@@ -1188,7 +1188,7 @@ Subsequent reads of data added to cache are fast. Cache-aside is also referred #### Write-through

- +
Source: Scalability, availability, stability, patterns

@@ -1223,7 +1223,7 @@ Write-through is a slow overall operation due to the write operation, but subseq #### Write-behind (write-back)

- +
Source: Scalability, availability, stability, patterns

@@ -1241,7 +1241,7 @@ In write-behind, the application does the following: #### Refresh-ahead

- +
Source: From cache to in-memory data grid

@@ -1273,7 +1273,7 @@ Refresh-ahead can result in reduced latency vs read-through if the cache can acc ## Asynchronism

- +
Source: Intro to architecting systems for scale

@@ -1319,7 +1319,7 @@ If queues start to grow significantly, the queue size can become larger than mem ## Communication

- +
Source: OSI 7 layer model

@@ -1351,7 +1351,7 @@ HTTP is an application layer protocol relying on lower-level protocols such as * ### Transmission control protocol (TCP)

- +
Source: How to make a multiplayer game

@@ -1375,7 +1375,7 @@ Use TCP over UDP when: ### User datagram protocol (UDP)

- +
Source: How to make a multiplayer game

@@ -1404,7 +1404,7 @@ Use UDP over TCP when: ### Remote procedure call (RPC)

- +
Source: Crack the system design interview

@@ -1600,7 +1600,7 @@ Handy metrics based on numbers above: | Question | Reference(s) | |---|---| | Design a file sync service like Dropbox | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) | -| Design a search engine like Google | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | +| Design a search engine like Google | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)
[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)
[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)
[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) | | Design a scalable web crawler like Google | [quora.com](https://www.quora.com/How-can-I-build-a-web-crawler-from-scratch) | | Design Google docs | [code.google.com](https://code.google.com/p/google-mobwrite/)
[neil.fraser.name](https://neil.fraser.name/writing/sync/) | | Design a key-value store like Redis | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) | @@ -1628,7 +1628,7 @@ Handy metrics based on numbers above: > Articles on how real world systems are designed.

- +
Source: Twitter timelines at scale

diff --git a/epub-metadata.yaml b/epub-metadata.yaml new file mode 100644 index 0000000..f4b296b --- /dev/null +++ b/epub-metadata.yaml @@ -0,0 +1,3 @@ +title: System Design Primer +creator: Donne Martin +date: 2018 \ No newline at end of file diff --git a/generate-epub.sh b/generate-epub.sh new file mode 100755 index 0000000..d7c2124 --- /dev/null +++ b/generate-epub.sh @@ -0,0 +1,40 @@ +#! /usr/bin/env sh + +generate_from_stdin() { + outfile=$1 + language=$2 + + echo "Generating '$language' ..." + + pandoc --metadata-file=epub-metadata.yaml --metadata=lang:$2 --from=markdown -o $1 <&0 + + echo "Done! You can find the '$language' book at ./$outfile" +} + +generate_with_solutions () { + tmpfile=$(mktemp /tmp/sytem-design-primer-epub-generator.XXX) + + cat ./README.md >> $tmpfile + + for dir in ./solutions/system_design/*; do + case $dir in *template*) continue;; esac + case $dir in *__init__.py*) continue;; esac + : [[ -d "$dir" ]] && ( cd "$dir" && cat ./README.md >> $tmpfile && echo "" >> $tmpfile ) + done + + cat $tmpfile | generate_from_stdin 'README.epub' 'en' + + rm "$tmpfile" +} + +generate () { + name=$1 + language=$2 + + cat $name.md | generate_from_stdin $name.epub $language +} + +generate_with_solutions +generate README-ja ja +generate README-zh-Hans zh-Hans +generate README-zh-TW zh-TW