docs: 更新文档

pull/24/merge
dunwu 2023-02-10 11:43:21 +08:00
parent 258eee5769
commit 8178829ba3
12 changed files with 57 additions and 51 deletions

1
.gitattributes vendored
View File

@ -22,6 +22,7 @@
*.less text
*.sql text
*.properties text
*.md text
# unix style
*.sh text eol=lf

9
.gitignore vendored
View File

@ -29,7 +29,6 @@ hs_err_pid*
# maven plugin temp files
.flattened-pom.xml
package-lock.json
# ------------------------------- javascript -------------------------------
@ -37,10 +36,12 @@ package-lock.json
node_modules
# temp folders
.temp
build
dist
_book
_jsdoc
.temp
.deploy*/
# temp files
*.log
@ -48,7 +49,11 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
bundle*.js
.DS_Store
Thumbs.db
db.json
book.pdf
package-lock.json
# ------------------------------- intellij -------------------------------

View File

@ -15,7 +15,7 @@
</a>
<a href="https://github.com/dunwu/db-tutorial/commits/master">
<img alt="commit" class="no-zoom" src="https://img.shields.io/github/workflow/status/dunwu/db-tutorial/CI?style=for-the-badge">
<img alt="build" class="no-zoom" src="https://img.shields.io/github/actions/workflow/status/dunwu/db-tutorial/deploy.yml?style=for-the-badge">
</a>
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">
@ -35,14 +35,14 @@
### 分布式综合
- [分布式面试总结](https://dunwu.github.io/waterdrop/pages/f9209d/)
- [分布式面试总结](https://dunwu.github.io/blog/pages/f9209d/)
### 分布式理论
- [分布式理论](https://dunwu.github.io/waterdrop/pages/286bb3/) - 关键词:`拜占庭将军`、`CAP`、`BASE`、`错误的分布式假设`
- [共识性算法 Paxos](https://dunwu.github.io/waterdrop/pages/0276bb/) - 关键词:`共识性算法`
- [共识性算法 Raft](https://dunwu.github.io/waterdrop/pages/4907dc/) - 关键词:`共识性算法`
- [分布式算法 Gossip](https://dunwu.github.io/waterdrop/pages/71539a/) - 关键词:`数据传播`
- [分布式理论](https://dunwu.github.io/blog/pages/286bb3/) - 关键词:`拜占庭将军`、`CAP`、`BASE`、`错误的分布式假设`
- [共识性算法 Paxos](https://dunwu.github.io/blog/pages/0276bb/) - 关键词:`共识性算法`
- [共识性算法 Raft](https://dunwu.github.io/blog/pages/4907dc/) - 关键词:`共识性算法`
- [分布式算法 Gossip](https://dunwu.github.io/blog/pages/71539a/) - 关键词:`数据传播`
### 分布式关键技术
@ -53,20 +53,20 @@
#### 流量调度
- [流量控制](https://dunwu.github.io/waterdrop/pages/60bb6d/) - 关键词:`限流`、`熔断`、`降级`、`计数器法`、`时间窗口法`、`令牌桶法`、`漏桶法`
- [负载均衡](https://dunwu.github.io/waterdrop/pages/98a1c1/) - 关键词:`轮询`、`随机`、`最少连接`、`源地址哈希`、`一致性哈希`、`虚拟 hash 槽`
- [服务路由](https://dunwu.github.io/waterdrop/pages/3915e8/) - 关键词:`路由`、`条件路由`、`脚本路由`、`标签路由`
- [流量控制](https://dunwu.github.io/blog/pages/60bb6d/) - 关键词:`限流`、`熔断`、`降级`、`计数器法`、`时间窗口法`、`令牌桶法`、`漏桶法`
- [负载均衡](https://dunwu.github.io/blog/pages/98a1c1/) - 关键词:`轮询`、`随机`、`最少连接`、`源地址哈希`、`一致性哈希`、`虚拟 hash 槽`
- [服务路由](https://dunwu.github.io/blog/pages/3915e8/) - 关键词:`路由`、`条件路由`、`脚本路由`、`标签路由`
- 服务网关
- [分布式会话](https://dunwu.github.io/waterdrop/pages/95e45f/) - 关键词:`粘性 Session`、`Session 复制共享`、`基于缓存的 session 共享`
- [分布式会话](https://dunwu.github.io/blog/pages/95e45f/) - 关键词:`粘性 Session`、`Session 复制共享`、`基于缓存的 session 共享`
#### 数据调度
- [数据缓存](https://dunwu.github.io/waterdrop/pages/fd0aaa/) - 关键词:`进程内缓存`、`分布式缓存`、`缓存雪崩`、`缓存穿透`、`缓存击穿`、`缓存更新`、`缓存预热`、`缓存降级`
- [读写分离](https://dunwu.github.io/waterdrop/pages/3faf18/)
- [分库分表](https://dunwu.github.io/waterdrop/pages/e1046e/) - 关键词:`分片`、`路由`、`迁移`、`扩容`、`双写`、`聚合`
- [分布式 ID](https://dunwu.github.io/waterdrop/pages/3ae455/) - 关键词:`UUID`、`自增序列`、`雪花算法`、`Leaf`
- [分布式事务](https://dunwu.github.io/waterdrop/pages/e1881c/) - 关键词:`2PC`、`3PC`、`TCC`、`本地消息表`、`MQ 消息`、`SAGA`
- [分布式锁](https://dunwu.github.io/waterdrop/pages/40ac64/) - 关键词:`数据库`、`Redis`、`ZooKeeper`、`互斥`、`可重入`、`死锁`、`容错`、`自旋尝试`
- [数据缓存](https://dunwu.github.io/blog/pages/fd0aaa/) - 关键词:`进程内缓存`、`分布式缓存`、`缓存雪崩`、`缓存穿透`、`缓存击穿`、`缓存更新`、`缓存预热`、`缓存降级`
- [读写分离](https://dunwu.github.io/blog/pages/3faf18/)
- [分库分表](https://dunwu.github.io/blog/pages/e1046e/) - 关键词:`分片`、`路由`、`迁移`、`扩容`、`双写`、`聚合`
- [分布式 ID](https://dunwu.github.io/blog/pages/3ae455/) - 关键词:`UUID`、`自增序列`、`雪花算法`、`Leaf`
- [分布式事务](https://dunwu.github.io/blog/pages/e1881c/) - 关键词:`2PC`、`3PC`、`TCC`、`本地消息表`、`MQ 消息`、`SAGA`
- [分布式锁](https://dunwu.github.io/blog/pages/40ac64/) - 关键词:`数据库`、`Redis`、`ZooKeeper`、`互斥`、`可重入`、`死锁`、`容错`、`自旋尝试`
#### 资源调度
@ -74,8 +74,8 @@
#### 服务治理
- [服务注册和发现](https://dunwu.github.io/waterdrop/pages/1a90aa/)
- [服务容错](https://dunwu.github.io/waterdrop/pages/e32c7e/)
- [服务注册和发现](https://dunwu.github.io/blog/pages/1a90aa/)
- [服务容错](https://dunwu.github.io/blog/pages/e32c7e/)
- 服务编排
- 服务版本管理

View File

@ -22,11 +22,11 @@ hidden: true
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200115160512.png)
### [布式存储基本原理](https://github.com/dunwu/blog/blob/master/source/_posts/theory/distributed-storage.md)
### [库分表基本原理](https://dunwu.github.io/blog/pages/e1046e/)
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200716110854.png)
### [分布式事务基本原理](https://github.com/dunwu/blog/blob/master/source/_posts/theory/distributed-transaction.md)
### [分布式事务基本原理](https://dunwu.github.io/blog/pages/e1881c/)
## 📚 资料

View File

@ -218,11 +218,11 @@ MySQL 读写分离能提高性能的原因在于:
## 9. 分布式事务
> 参考:[分布式事务基本原理](https://github.com/dunwu/blog/blob/master/source/_posts/theory/distributed-transaction.md)
> 参考:[分布式事务基本原理](https://dunwu.github.io/blog/pages/e1881c/)
## 10. 分库分表
> 参考:[分布式存储基本原理](https://github.com/dunwu/blog/blob/master/source/_posts/theory/distributed-storage.md)
> 参考:[分库分表基本原理](https://dunwu.github.io/blog/pages/e1046e/)
## 11. 参考资料

View File

@ -336,7 +336,7 @@ InnoDB 存储引擎的主键索引为聚簇索引,其它索引为辅助索引
- 本地消息表/MQ 事务 都适用于事务中参与方支持操作幂等,对一致性要求不高,业务上能容忍数据不一致到一个人工检查周期,事务涉及的参与方、参与环节较少,业务上有对账/校验系统兜底。
- Saga 事务 由于 Saga 事务不能保证隔离性,需要在业务层控制并发,适合于业务场景事务并发操作同一资源较少的情况。 Saga 相比缺少预提交动作导致补偿动作的实现比较麻烦例如业务是发送短信补偿动作则得再发送一次短信说明撤销用户体验比较差。Saga 事务较适用于补偿动作容易处理的场景。
> 分布式事务详细说明、分析请参考:[分布式事务基本原理](https://github.com/dunwu/blog/blob/master/source/_posts/theory/distributed-transaction.md)
> 分布式事务详细说明、分析请参考:[分布式事务基本原理](https://dunwu.github.io/blog/pages/e1881c/)
## 7. 事务最佳实践

View File

@ -55,7 +55,7 @@ hidden: true
- [关系型数据库面试总结](https://github.com/dunwu/db-tutorial/blob/master/docs/sql/sql-interview.md) 💯
- [SQL Cheat Sheet](https://github.com/dunwu/db-tutorial/blob/master/docs/sql/sql-cheat-sheet.md)
- [分布式事务基本原理](https://github.com/dunwu/blog/blob/master/source/_posts/theory/distributed-transaction.md)
- [分布式事务基本原理](https://dunwu.github.io/blog/pages/e1881c/)
## 📚 资料

View File

@ -17,7 +17,7 @@ permalink: /pages/615afe/
> Redis 哨兵Sentinel是 Redis 的**高可用性**Hight Availability解决方案。
>
> Redis 哨兵是 [Raft 算法](https://github.com/dunwu/blog/blob/master/source/_posts/theory/raft.md) 的具体实现。
> Redis 哨兵是 [Raft 算法](https://dunwu.github.io/blog/pages/4907dc/) 的具体实现。
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200713072747.png)
@ -107,7 +107,7 @@ Sentinel 对 `__sentinel__:hello` 频道的订阅会一直持续到 Sentinel 与
> Redis Sentinel 系统选举 Leader 的算法是 [Raft](https://ramcloud.atlassian.net/wiki/download/attachments/6586375/raft.pdf) 的实现。
>
> Raft 是一种共识性算法,想了解其原理,可以参考 [深入剖析共识性算法 Raft](https://github.com/dunwu/blog/blob/master/source/_posts/theory/raft.md)。
> Raft 是一种共识性算法,想了解其原理,可以参考 [深入剖析共识性算法 Raft](https://dunwu.github.io/blog/pages/4907dc/)。
**当一个主服务器被判断为客观下线时,监视这个下线主服务器的各个 Sentinel 会进行协商,选举出一个领头的 Sentinel并由领头 Sentinel 对下线主服务器执行故障转移操作**。

View File

@ -44,7 +44,7 @@ BitMap 和 BloomFilter 都可以用于解决缓存穿透问题。要点在于:
- **避免永远不释放锁** - 使用 `expire` 加一个过期时间,避免一直不释放锁,导致阻塞。
- **原子性** - setnx 和 expire 必须合并为一个原子指令,避免 setnx 后,机器崩溃,没来得及设置 expire从而导致锁永不释放。
> 更多分布式锁的实现方式及细节,请参考:[分布式锁基本原理](https://github.com/dunwu/blog/blob/master/source/_posts/theory/distributed-lock.md)
> 更多分布式锁的实现方式及细节,请参考:[分布式锁基本原理](https://dunwu.github.io/blog/pages/40ac64/)
## 二、技巧

View File

@ -83,7 +83,7 @@ Elasticsearch 是利用分片将数据分发到集群内各处的。分片是数
让我们在包含一个空节点的集群内创建名为 `blogs` 的索引。 索引在默认情况下会被分配 5 个主分片, 但是为了演示目的,我们将分配 3 个主分片和一份副本(每个主分片拥有一个副本分片):
```java
```json
PUT /blogs
{
"settings" : {
@ -192,7 +192,7 @@ PUT /blogs
在运行中的集群上是可以动态调整副本分片数目的,我们可以按需伸缩集群。让我们把副本数从默认的 `1` 增加到 `2`
```sense
```json
PUT /blogs/_settings
{
"number_of_replicas" : 2

View File

@ -26,7 +26,7 @@ hidden: true
</a>
<a href="https://github.com/dunwu/db-tutorial/commits/master">
<img alt="commit" class="no-zoom" src="https://img.shields.io/github/workflow/status/dunwu/db-tutorial/CI?style=for-the-badge">
<img alt="build" class="no-zoom" src="https://img.shields.io/github/actions/workflow/status/dunwu/db-tutorial/deploy.yml?style=for-the-badge">
</a>
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">
@ -58,7 +58,7 @@ hidden: true
##### 流量调度
- [流量控制](https://dunwu.github.io/design/pages/282676/)
- [深入浅出负载均衡](https://dunwu.github.io/design/pages/b7ca44/)
- [负载均衡](https://dunwu.github.io/blog/pages/98a1c1/)
- [服务路由](https://dunwu.github.io/design/pages/d04ece/)
- [分布式会话基本原理](https://dunwu.github.io/design/pages/3e66c2/)

View File

@ -19,7 +19,7 @@ footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu
</a>
<a href="https://github.com/dunwu/db-tutorial/commits/master">
<img alt="commit" class="no-zoom" src="https://img.shields.io/github/workflow/status/dunwu/db-tutorial/CI?style=for-the-badge">
<img alt="build" class="no-zoom" src="https://img.shields.io/github/actions/workflow/status/dunwu/db-tutorial/deploy.yml?style=for-the-badge">
</a>
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">
@ -37,14 +37,14 @@ footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu
### 分布式综合
- [分布式面试总结](https://dunwu.github.io/waterdrop/pages/f9209d/)
- [分布式面试总结](https://dunwu.github.io/blog/pages/f9209d/)
### 分布式理论
- [分布式理论](https://dunwu.github.io/waterdrop/pages/286bb3/) - 关键词:`拜占庭将军`、`CAP`、`BASE`、`错误的分布式假设`
- [共识性算法 Paxos](https://dunwu.github.io/waterdrop/pages/0276bb/) - 关键词:`共识性算法`
- [共识性算法 Raft](https://dunwu.github.io/waterdrop/pages/4907dc/) - 关键词:`共识性算法`
- [分布式算法 Gossip](https://dunwu.github.io/waterdrop/pages/71539a/) - 关键词:`数据传播`
- [分布式理论](https://dunwu.github.io/blog/pages/286bb3/) - 关键词:`拜占庭将军`、`CAP`、`BASE`、`错误的分布式假设`
- [共识性算法 Paxos](https://dunwu.github.io/blog/pages/0276bb/) - 关键词:`共识性算法`
- [共识性算法 Raft](https://dunwu.github.io/blog/pages/4907dc/) - 关键词:`共识性算法`
- [分布式算法 Gossip](https://dunwu.github.io/blog/pages/71539a/) - 关键词:`数据传播`
### 分布式关键技术
@ -55,20 +55,20 @@ footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu
#### 流量调度
- [流量控制](https://dunwu.github.io/waterdrop/pages/60bb6d/) - 关键词:`限流`、`熔断`、`降级`、`计数器法`、`时间窗口法`、`令牌桶法`、`漏桶法`
- [负载均衡](https://dunwu.github.io/waterdrop/pages/98a1c1/) - 关键词:`轮询`、`随机`、`最少连接`、`源地址哈希`、`一致性哈希`、`虚拟 hash 槽`
- [服务路由](https://dunwu.github.io/waterdrop/pages/3915e8/) - 关键词:`路由`、`条件路由`、`脚本路由`、`标签路由`
- [流量控制](https://dunwu.github.io/blog/pages/60bb6d/) - 关键词:`限流`、`熔断`、`降级`、`计数器法`、`时间窗口法`、`令牌桶法`、`漏桶法`
- [负载均衡](https://dunwu.github.io/blog/pages/98a1c1/) - 关键词:`轮询`、`随机`、`最少连接`、`源地址哈希`、`一致性哈希`、`虚拟 hash 槽`
- [服务路由](https://dunwu.github.io/blog/pages/3915e8/) - 关键词:`路由`、`条件路由`、`脚本路由`、`标签路由`
- 服务网关
- [分布式会话](https://dunwu.github.io/waterdrop/pages/95e45f/) - 关键词:`粘性 Session`、`Session 复制共享`、`基于缓存的 session 共享`
- [分布式会话](https://dunwu.github.io/blog/pages/95e45f/) - 关键词:`粘性 Session`、`Session 复制共享`、`基于缓存的 session 共享`
#### 数据调度
- [数据缓存](https://dunwu.github.io/waterdrop/pages/fd0aaa/) - 关键词:`进程内缓存`、`分布式缓存`、`缓存雪崩`、`缓存穿透`、`缓存击穿`、`缓存更新`、`缓存预热`、`缓存降级`
- [读写分离](https://dunwu.github.io/waterdrop/pages/3faf18/)
- [分库分表](https://dunwu.github.io/waterdrop/pages/e1046e/) - 关键词:`分片`、`路由`、`迁移`、`扩容`、`双写`、`聚合`
- [分布式 ID](https://dunwu.github.io/waterdrop/pages/3ae455/) - 关键词:`UUID`、`自增序列`、`雪花算法`、`Leaf`
- [分布式事务](https://dunwu.github.io/waterdrop/pages/e1881c/) - 关键词:`2PC`、`3PC`、`TCC`、`本地消息表`、`MQ 消息`、`SAGA`
- [分布式锁](https://dunwu.github.io/waterdrop/pages/40ac64/) - 关键词:`数据库`、`Redis`、`ZooKeeper`、`互斥`、`可重入`、`死锁`、`容错`、`自旋尝试`
- [数据缓存](https://dunwu.github.io/blog/pages/fd0aaa/) - 关键词:`进程内缓存`、`分布式缓存`、`缓存雪崩`、`缓存穿透`、`缓存击穿`、`缓存更新`、`缓存预热`、`缓存降级`
- [读写分离](https://dunwu.github.io/blog/pages/3faf18/)
- [分库分表](https://dunwu.github.io/blog/pages/e1046e/) - 关键词:`分片`、`路由`、`迁移`、`扩容`、`双写`、`聚合`
- [分布式 ID](https://dunwu.github.io/blog/pages/3ae455/) - 关键词:`UUID`、`自增序列`、`雪花算法`、`Leaf`
- [分布式事务](https://dunwu.github.io/blog/pages/e1881c/) - 关键词:`2PC`、`3PC`、`TCC`、`本地消息表`、`MQ 消息`、`SAGA`
- [分布式锁](https://dunwu.github.io/blog/pages/40ac64/) - 关键词:`数据库`、`Redis`、`ZooKeeper`、`互斥`、`可重入`、`死锁`、`容错`、`自旋尝试`
#### 资源调度
@ -76,8 +76,8 @@ footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu
#### 服务治理
- [服务注册和发现](https://dunwu.github.io/waterdrop/pages/1a90aa/)
- [服务容错](https://dunwu.github.io/waterdrop/pages/e32c7e/)
- [服务注册和发现](https://dunwu.github.io/blog/pages/1a90aa/)
- [服务容错](https://dunwu.github.io/blog/pages/e32c7e/)
- 服务编排
- 服务版本管理