diff --git a/SUMMARY.md b/SUMMARY.md index 8653117..34a3df1 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -51,19 +51,14 @@ * [5.7 Layout大型web项目分层](ch5-web/ch5-07-layout-of-web-project.md) * [5.8 interface 和 table-driven 开发](ch5-web/ch5-08-interface-and-web.md) * [5.9 灰度发布和 A/B test](ch5-web/ch5-09-gated-launch.md) - * [5.11 Load-balance负载均衡](ch5-web/ch5-11-load-balance.md) + * [5.10 Load-balance负载均衡](ch5-web/ch5-10-load-balance.md) + * [5.11 补充说明(TODO)](ch5-web/ch5-11-ext.md) * [第6章 分布式系统](ch6-cloud/readme.md) - * [6.1 云上地鼠(TODO)](ch6-cloud/ch6-01-cloud.md) - * [6.2 分布式搜索引擎](ch6-cloud/ch6-02-search-engine.md) - * [6.2 分布式配置管理(Doing)](ch6-cloud/ch6-03-config.md) - * [6.4 分布式队列(TODO)](ch6-cloud/ch6-04-queue.md) - * [6.5 分布式缓存(TODO)](ch6-cloud/ch6-05-cache.md) - * [6.6 etcd(TODO)](ch6-cloud/ch6-06-etcd.md) - * [6.7 分布式 id 生成器](ch6-cloud/ch6-07-dist-id.md) - * [6.8 分布式锁](ch6-cloud/ch6-08-lock.md) - * [6.9 分布式爬虫(TODO)](ch6-cloud/ch6-09-scrawler.md) - * [6.10 延时任务系统](ch6-cloud/ch6-10-delay-job.md) - * [6.11 补充说明(TODO)](ch6-cloud/ch6-11-faq.md) + * [6.1 分布式锁](ch6-cloud/ch6-01-lock.md) + * [6.2 分布式 id 生成器](ch6-cloud/ch6-02-dist-id.md) + * [6.3 延时任务系统](ch6-cloud/ch6-03-delay-job.md) + * [6.4 分布式搜索引擎](ch6-cloud/ch6-04-search-engine.md) + * [6.5 补充说明(TODO)](ch6-cloud/ch6-05-ext.md) * [附录](appendix/readme.md) * [附录A: Go语言常见坑](appendix/appendix-a-trap.md) * [附录B: 有趣的代码片段](appendix/appendix-b-gems.md) diff --git a/ch5-web/ch5-11-load-balance.md b/ch5-web/ch5-10-load-balance.md similarity index 99% rename from ch5-web/ch5-11-load-balance.md rename to ch5-web/ch5-10-load-balance.md index 0b9c038..63a2b10 100644 --- a/ch5-web/ch5-11-load-balance.md +++ b/ch5-web/ch5-10-load-balance.md @@ -1,4 +1,4 @@ -# 5.11 Load-Balance 负载均衡 +# 5.10 Load-Balance 负载均衡 本节将会讨论常见的 web 后端服务之间的负载均衡手段。 diff --git a/ch5-web/ch5-11-ext.md b/ch5-web/ch5-11-ext.md new file mode 100644 index 0000000..40bc29e --- /dev/null +++ b/ch5-web/ch5-11-ext.md @@ -0,0 +1,3 @@ +# 5.11 补充说明 + +TODO diff --git a/ch6-cloud/ch6-08-lock.md b/ch6-cloud/ch6-01-lock.md similarity index 99% rename from ch6-cloud/ch6-08-lock.md rename to ch6-cloud/ch6-01-lock.md index 34cfa7d..95667c9 100644 --- a/ch6-cloud/ch6-08-lock.md +++ b/ch6-cloud/ch6-01-lock.md @@ -1,4 +1,4 @@ -# 6.8 分布式锁 +# 6.1 分布式锁 在单机程序并发或并行修改全局变量时,需要对修改行为加锁以创造临界区。为什么需要加锁呢?可以看看下段代码: diff --git a/ch6-cloud/ch6-07-dist-id.md b/ch6-cloud/ch6-02-dist-id.md similarity index 99% rename from ch6-cloud/ch6-07-dist-id.md rename to ch6-cloud/ch6-02-dist-id.md index 0d63e45..f1547f5 100644 --- a/ch6-cloud/ch6-07-dist-id.md +++ b/ch6-cloud/ch6-02-dist-id.md @@ -1,4 +1,4 @@ -# 6.7 分布式 id 生成器 +# 6.2 分布式 id 生成器 有时我们需要能够生成类似 MySQL 自增 ID 这样不断增大,同时又不会重复的 id。以支持业务中的高并发场景。比较典型的,电商促销时,短时间内会有大量的订单涌入到系统,比如每秒 10w+。明星出轨时,会有大量热情的粉丝发微薄以表心意,同样产生短时间大量的消息。 diff --git a/ch6-cloud/ch6-10-delay-job.md b/ch6-cloud/ch6-03-delay-job.md similarity index 99% rename from ch6-cloud/ch6-10-delay-job.md rename to ch6-cloud/ch6-03-delay-job.md index 17d4780..e101d5a 100644 --- a/ch6-cloud/ch6-10-delay-job.md +++ b/ch6-cloud/ch6-03-delay-job.md @@ -1,4 +1,4 @@ -# 6.10 延时任务系统 +# 6.3 延时任务系统 我们在做系统时,很多时候是处理实时的任务,请求来了马上就处理,然后立刻给用户以反馈。但有时也会遇到非实时的任务,比如确定的时间点发布重要公告。或者需要在用户做了一件事情的 X 分钟/Y 小时后,对其特殊动作,比如通知、发券等等。 diff --git a/ch6-cloud/ch6-04-queue.md b/ch6-cloud/ch6-04-queue.md deleted file mode 100644 index 0fbe31b..0000000 --- a/ch6-cloud/ch6-04-queue.md +++ /dev/null @@ -1,3 +0,0 @@ -# 6.4 分布式队列 - -TODO diff --git a/ch6-cloud/ch6-02-search-engine.md b/ch6-cloud/ch6-04-search-engine.md similarity index 99% rename from ch6-cloud/ch6-02-search-engine.md rename to ch6-cloud/ch6-04-search-engine.md index b6aa1b0..e5abf94 100644 --- a/ch6-cloud/ch6-02-search-engine.md +++ b/ch6-cloud/ch6-04-search-engine.md @@ -1,4 +1,4 @@ -# 6.2 分布式搜索引擎 +# 6.4 分布式搜索引擎 在 web 一章中,我们提到 MySQL 很脆弱。数据库系统本身要保证实时和强一致性,所以其功能设计上都是为了满足这种一致性需求。比如 write ahead log 的设计,基于 B+ 树实现的索引和数据组织,以及基于 MVCC 实现的事务等等。 diff --git a/ch6-cloud/ch6-05-cache.md b/ch6-cloud/ch6-05-cache.md deleted file mode 100644 index 34ff65b..0000000 --- a/ch6-cloud/ch6-05-cache.md +++ /dev/null @@ -1,3 +0,0 @@ -# 6.5 分布式缓存 - -TODO diff --git a/ch6-cloud/ch6-11-faq.md b/ch6-cloud/ch6-05-ext.md similarity index 97% rename from ch6-cloud/ch6-11-faq.md rename to ch6-cloud/ch6-05-ext.md index 3d7700f..e97974a 100644 --- a/ch6-cloud/ch6-11-faq.md +++ b/ch6-cloud/ch6-05-ext.md @@ -1,4 +1,4 @@ -# 6.11. 补充说明 +# 6.5 补充说明 分布式是很大的领域,本章中的介绍只能算是对领域的管中窥豹。因为大型系统流量大,并发高,所以往往很多朴素的方案会变得难以满足需求。人们为了解决大型系统场景中的各种问题,而开发出了各式各样的分布式系统。有些系统非常简单,比如本章中介绍的分布式 id 生成器,而有一些系统则可能非常复杂,比如本章中的分布式搜索引擎(当然,本章中提到的 es 不是 Go 实现)。 diff --git a/ch6-cloud/ch6-06-etcd.md b/ch6-cloud/ch6-06-etcd.md deleted file mode 100644 index 63c086f..0000000 --- a/ch6-cloud/ch6-06-etcd.md +++ /dev/null @@ -1,3 +0,0 @@ -# 6.6 etcd - -TODO