File tree Expand file tree Collapse file tree 13 files changed +47
-47
lines changed Expand file tree Collapse file tree 13 files changed +47
-47
lines changed Original file line number Diff line number Diff line change 1
- <div align =" center " ><img width =" 100px " src =" http://dunwu.test.upcdn.net/images /others/zp.png!zp " /></div >
1
+ <div align =" center " ><img width =" 100px " src =" http://dunwu.test.upcdn.net/cs /others/zp.png!zp " /></div >
2
2
3
3
# DB Tutorial
4
4
Original file line number Diff line number Diff line change @@ -80,5 +80,5 @@ def main():
80
80
从事件处理的角度来看,服务器运行流程如下:
81
81
82
82
<div align =" center " >
83
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/Redis事件的调度与执行.png!zp " />
83
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/Redis事件的调度与执行.png!zp " />
84
84
</div >
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ Redis 的容灾备份基本上就是对数据进行备份,并将这些备份
242
242
### Redis 复制的启动过程
243
243
244
244
<div align =" center " >
245
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/Redis复制启动过程.png!zp " width =" 400 " />
245
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/Redis复制启动过程.png!zp " width =" 400 " />
246
246
</div >
247
247
248
248
当多个从服务器尝试连接同一个主服务器时:
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ Redis 集群的重新分片操作由 Redis 集群管理软件 redis-trib 负责
196
196
重新分片的实现原理如下图所示:
197
197
198
198
<div align =" center " >
199
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-cluster-trib.png!zp " width =" 400 " />
199
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-cluster-trib.png!zp " width =" 400 " />
200
200
</div >
201
201
202
202
### ASK 错误
@@ -206,7 +206,7 @@ ASK 错误与 MOVED 的区别在于:**ASK 错误只是两个节点在迁移槽
206
206
判断 ASK 错误的过程如下图所示:
207
207
208
208
<div align =" center " >
209
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-ask.png!zp " width =" 400 " />
209
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-ask.png!zp " width =" 400 " />
210
210
</div >
211
211
212
212
### 复制
Original file line number Diff line number Diff line change 21
21
## STRING
22
22
23
23
<div align =" center " >
24
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-string.png!zp " width =" 400 " />
24
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-string.png!zp " width =" 400 " />
25
25
</div >
26
26
27
27
命令:
48
48
## LIST
49
49
50
50
<div align =" center " >
51
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-list.png!zp " width =" 400 " />
51
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-list.png!zp " width =" 400 " />
52
52
</div >
53
53
54
54
命令:
85
85
## SET
86
86
87
87
<div align =" center " >
88
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-set.png!zp " width =" 400 " />
88
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-set.png!zp " width =" 400 " />
89
89
</div >
90
90
91
91
命令:
132
132
## HASH
133
133
134
134
<div align =" center " >
135
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-hash.png!zp " width =" 400 " />
135
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-hash.png!zp " width =" 400 " />
136
136
</div >
137
137
138
138
命令:
183
183
## ZSET
184
184
185
185
<div align =" center " >
186
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-zset.png!zp " width =" 400 " />
186
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-zset.png!zp " width =" 400 " />
187
187
</div >
188
188
189
189
命令:
234
234
235
235
## 参考资料
236
236
237
- 《Redis 设计与实现》
237
+ 《Redis 设计与实现》
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Redis 的复制功能分为同步和命令传播两个操作:
35
35
### 同步
36
36
37
37
<div align =" center " >
38
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-sync.png!zp " width =" 400 " />
38
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-sync.png!zp " width =" 400 " />
39
39
</div >
40
40
41
41
@@ -80,7 +80,7 @@ Redis 的复制功能分为同步和命令传播两个操作:
80
80
它的工作原理是这样:** 主服务器端为复制流维护一个内存缓冲区(in-memory backlog)。主从服务器都维护一个复制偏移量(replication offset)和 master run id ,当连接断开时,从服务器会重新连接上主服务器,然后请求继续复制,假如主从服务器的两个 master run id 相同,并且指定的偏移量在内存缓冲区中还有效,复制就会从上次中断的点开始继续** 。如果其中一个条件不满足,就会进行完全重新同步(在 2.8 版本之前就是直接进行完全重新同步)。
81
81
82
82
<div align =" center " >
83
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-replication-offset.png!zp " width =" 400 " />
83
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-replication-offset.png!zp " width =" 400 " />
84
84
</div >
85
85
86
86
#### 复制偏移量
@@ -121,7 +121,7 @@ Redis 的复制功能分为同步和命令传播两个操作:
121
121
### PSYNC 命令的实现
122
122
123
123
<div align =" center " >
124
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-psync-workflow.png!zp " width =" 400 " />
124
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-psync-workflow.png!zp " width =" 400 " />
125
125
</div >
126
126
127
127
## 复制的实现
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ Redis 与 Memcached 因为都可以用于缓存,所以常常被拿来做比较
96
96
### 2.1. STRING
97
97
98
98
<div align =" center " >
99
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-string.png!zp " width =" 400 " />
99
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-string.png!zp " width =" 400 " />
100
100
</div >
101
101
102
102
命令:
123
123
### 2.2. LIST
124
124
125
125
<div align =" center " >
126
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-list.png!zp " width =" 400 " />
126
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-list.png!zp " width =" 400 " />
127
127
</div >
128
128
129
129
命令:
160
160
### 2.3. SET
161
161
162
162
<div align =" center " >
163
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-set.png!zp " width =" 400 " />
163
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-set.png!zp " width =" 400 " />
164
164
</div >
165
165
166
166
命令:
207
207
### 2.4. HASH
208
208
209
209
<div align =" center " >
210
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-hash.png!zp " width =" 400 " />
210
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-hash.png!zp " width =" 400 " />
211
211
</div >
212
212
213
213
命令:
258
258
### 2.5. ZSET
259
259
260
260
<div align =" center " >
261
- <img src =" http://dunwu.test.upcdn.net/images /database/redis/redis-datatype-zset.png!zp " width =" 400 " />
261
+ <img src =" http://dunwu.test.upcdn.net/cs /database/redis/redis-datatype-zset.png!zp " width =" 400 " />
262
262
</div >
263
263
264
264
命令:
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ H2 允许用户通过浏览器接口方式访问 SQL 数据库。
27
27
2 . 启动方式:在 bin 目录下,双击 jar 包;执行 ` java -jar h2*.jar ` ;执行脚本:` h2.bat ` 或 ` h2.sh ` 。
28
28
3 . 在浏览器中访问:http://localhost:8082,应该可以看到下图中的页面:
29
29
30
- <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/images /database/h2/h2-console.png!zp " /></div ><br >
30
+ <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/cs /database/h2/h2-console.png!zp " /></div ><br >
31
31
32
32
点击 ** Connect** ,可以进入操作界面:
33
33
34
- <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/images /database/h2/h2-console-02.png!zp " /></div ><br >
34
+ <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/cs /database/h2/h2-console-02.png!zp " /></div ><br >
35
35
36
36
操作界面十分简单,不一一细说。
37
37
Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ migrations 最常用的编写形式就是 SQL。
406
406
407
407
为了被 Flyway 自动识别,SQL migrations 的文件命名必须遵循规定的模式:
408
408
409
- <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/images /database/flyway/sql-migrations.png!zp " /></div ><br >
409
+ <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/cs /database/flyway/sql-migrations.png!zp " /></div ><br >
410
410
411
411
- ** Prefix** - ` V ` 代表 versioned migrations (可配置), ` U ` 代表 undo migrations (可配置)、 ` R ` 代表 repeatable migrations (可配置)
412
412
- ** Version** - 版本号通过` . ` (点)或` _ ` (下划线)分隔 (repeatable migrations 不需要)
@@ -425,7 +425,7 @@ migrations 最常用的编写形式就是 SQL。
425
425
426
426
为了被 Flyway 自动识别,JAVA migrations 的文件命名必须遵循规定的模式:
427
427
428
- <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/images /database/flyway/java-migrations.png!zp " /></div ><br >
428
+ <br ><div align =" center " ><img src =" http://dunwu.test.upcdn.net/cs /database/flyway/java-migrations.png!zp " /></div ><br >
429
429
430
430
- ** Prefix** - ` V ` 代表 versioned migrations (可配置), ` U ` 代表 undo migrations (可配置)、 ` R ` 代表 repeatable migrations (可配置)
431
431
- ** Version** - 版本号通过` . ` (点)或` _ ` (下划线)分隔 (repeatable migrations 不需要)
Original file line number Diff line number Diff line change @@ -531,7 +531,7 @@ Mysql 支持两种复制:基于行的复制和基于语句的复制。
531
531
- ** SQL 线程** :负责读取中继日志并重放其中的 SQL 语句。
532
532
533
533
<div align =" center " >
534
- <img src =" http://dunwu.test.upcdn.net/images /database/mysql/master-slave.png!zp " />
534
+ <img src =" http://dunwu.test.upcdn.net/cs /database/mysql/master-slave.png!zp " />
535
535
</div >
536
536
537
537
### 7.2. 读写分离
@@ -547,7 +547,7 @@ MySQL 读写分离能提高性能的原因在于:
547
547
- 增加冗余,提高可用性。
548
548
549
549
<div align =" center " >
550
- <img src =" http://dunwu.test.upcdn.net/images /database/mysql/master-slave-proxy.png!zp " />
550
+ <img src =" http://dunwu.test.upcdn.net/cs /database/mysql/master-slave-proxy.png!zp " />
551
551
</div >
552
552
553
553
## 8. 参考资料
You can’t perform that action at this time.
0 commit comments