-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
715 lines (500 loc) · 22.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
<!DOCTYPE html>
<html lang="en">
<!-- Head tag -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keyword" content="">
<link rel="shortcut icon" href="/img/Kid.gif">
<title>
Kido的博客 | Kido's Blog
</title>
<link rel="canonical" href="https://blog.kido.site/">
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="/css/hux-blog.min.css">
<!-- Pygments Highlight CSS -->
<link rel="stylesheet" href="/css/highlight.css">
<!-- Custom Fonts -->
<!-- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
<!-- Hux change font-awesome CDN to qiniu -->
<!-- 本地化 -->
<!-- <link href="https://cdn.staticfile.org/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
<link href="/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- 统一字体 -->
<link rel="stylesheet" href="/css/font-Raleway.css" type="text/css">
<!-- Hux Delete, sad but pending in China
<link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/
css'>
-->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- ga & ba script hoook -->
<script></script>
<meta name="generator" content="Hexo 6.0.0"></head>
<!-- hack iOS CSS :active style -->
<body ontouchstart="">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">KIDO</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<!-- Known Issue, found by Hux:
<nav>'s height woule be hold on by its content.
so, when navbar scale out, the <nav> will cover tags.
also mask any touch event of tags, unfortunately.
-->
<div id="huxblog_navbar">
<div class="navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<!-- movie,book,NAVIGATION,ABOUT ME 属于跳转外部网站 -->
<li>
<a target="_blank" rel="noopener" href="http://kido.site/movie/list/1/15">电影推荐</a>
</li>
<li>
<a href="/">技术博客</a>
</li>
<li>
<a target="_blank" rel="noopener" href="http://kido.site/tab/show">网站导航</a>
</li>
<li>
<a target="_blank" rel="noopener" href="http://kido.site/author/about">不要点开</a>
</li>
<!--
<li>
<a href="/about/">About</a>
</li>
<li>
<a href="/categories/">categories</a>
</li>
<li>
<a href="/archives/">Archives</a>
</li>
<li>
<a href="/tags/">Tags</a>
</li>
-->
</ul>
</div>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<script>
// Drop Bootstarp low-performance Navbar
// Use customize navbar with high-quality material design animation
// in high-perf jank-free CSS3 implementation
var $body = document.body;
var $toggle = document.querySelector('.navbar-toggle');
var $navbar = document.querySelector('#huxblog_navbar');
var $collapse = document.querySelector('.navbar-collapse');
$toggle.addEventListener('click', handleMagic)
function handleMagic(e){
if ($navbar.className.indexOf('in') > 0) {
// CLOSE
$navbar.className = " ";
// wait until animation end.
setTimeout(function(){
// prevent frequently toggle
if($navbar.className.indexOf('in') < 0) {
$collapse.style.height = "0px"
}
},400)
}else{
// OPEN
$collapse.style.height = "auto"
$navbar.className += " in";
}
}
</script>
<!-- Main Content -->
<!-- Page Header -->
<header class="intro-header" style="background-image: url('/img/home-bg-02.jpg')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
<div class="site-heading">
<h1>KIDO BLOG</h1>
<!--<hr class="small">-->
<span class="subheading">Do not fear the unknown.</span>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- USE SIDEBAR -->
<!-- Post Container -->
<div class="
col-lg-8 col-lg-offset-1
col-md-8 col-md-offset-1
col-sm-12
col-xs-12
post-container
">
<!-- Main Content -->
<div class="post-preview">
<a href="/2018/12/09/db-and-cache-04/">
<h2 class="post-title">
缓存与数据库一致性系列-04
</h2>
<h3 class="post-subtitle">
</h3>
<div class="post-content-preview">
经过前三篇的讨论,我们终于的实现了“最终一致性”,那今天呢,我们再进一步,在前一个方案的基础上实现“强一致性”
强一致性,包含两种含义:
缓存和DB数据一致
缓存中没有数据(或者说:不会去读缓存中的老版本数据)
首先我们来分析一下,既然已经实现了“最终一致性”,那它和“强一致性”的区别是什么呢?没错,就是“时间差”,所以:
“最终一致性方案” + “时间差” = “强一致......
</div>
</a>
<p class="post-meta">
Posted by Kido on
2018-12-09
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/12/08/db-and-cache-03/">
<h2 class="post-title">
缓存与数据库一致性系列-03
</h2>
<h3 class="post-subtitle">
</h3>
<div class="post-content-preview">
经过前两篇的讨论,我们离实现“最终一致性”只差一步了
在《缓存与数据库一致性系列-02》文章,我们提到上一个方案的并发问题
读的时候,缓存中的数据已失效,此时又发生了更新
数据更新的时候,缓存中的数据已失效,此时又发生了更新
那我们我们可以看到,这个问题就来自于“读数据库” + “写缓存” 之间的交错并发,那怎么来避免呢?有一个方法就是:串行化,我们利用MQ将所有“读数据库” + “......
</div>
</a>
<p class="post-meta">
Posted by Kido on
2018-12-08
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/12/07/db-and-cache-02/">
<h2 class="post-title">
缓存与数据库一致性系列-02
</h2>
<h3 class="post-subtitle">
</h3>
<div class="post-content-preview">
在《缓存与数据库一致性系列-01》文章,我们提到,“它的一个比较大的缺陷在于刷新缓存有可能会失败,而失败之后缓存中数据就一直会处于错误状态,所以它并不能保证数据的最终一致性”
为了保证“数据最终一致性”,我们引入binlog,通过解析binlog来刷新缓存,这样即使刷新失败,依然可以进行日志回放,再次刷新缓存
写流程:第一步先删除缓存,删除之后再更新DB,我们监听从库(资源少的话主库也o......
</div>
</a>
<p class="post-meta">
Posted by Kido on
2018-12-07
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/12/01/db-and-cache-01/">
<h2 class="post-title">
缓存与数据库一致性系列-01
</h2>
<h3 class="post-subtitle">
</h3>
<div class="post-content-preview">
今天,我们来分析一下,缓存与数据库被使用次数最多的一种使用方法
写流程:第一步先删除缓存,删除之后再更新DB,之后再异步将数据刷回缓存
读流程:第一步先读缓存,如果缓存没读到,则去读DB,之后再异步将数据刷回缓存
方案分析优点剖析1. 实现起来简单
What Should I Say ?
2. “先淘汰缓存,再写数据库” 合理为什么说这也算优点呢?试想一下
如果把写流程改一下:先更新缓......
</div>
</a>
<p class="post-meta">
Posted by Kido on
2018-12-01
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/11/24/db-and-cache-preface/">
<h2 class="post-title">
缓存与数据库一致性系列-序言
</h2>
<h3 class="post-subtitle">
</h3>
<div class="post-content-preview">
一般来说,对于一个新的业务,一般会经历这几个阶段:
阶段1:单库阶段读写流量都比较小,这个时候所有的读写操作都在主库就ok了这个时候,从库可能只是用来灾备风险分析:从数据一致性角度来说没有风险,全走主库美滋滋~
阶段2:多库阶段阶段2.1:单库扛不住了,这个时候就会考虑到分库分表了,通过增加数据库的方式,把单库的QPS降下来风险分析: 从数据一致性角度来说没有风险,全走主库依然美滋滋~
阶段......
</div>
</a>
<p class="post-meta">
Posted by Kido on
2018-11-24
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/11/23/json-note/">
<h2 class="post-title">
浅谈JSON类库
</h2>
<h3 class="post-subtitle">
</h3>
<div class="post-content-preview">
1.JSON介绍JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,易于人阅读和编写,同时也易于机器解析和生成,它基于JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999的一个子集。 JSON采用完全独立于语言的文本格式, 这些特性使JSON成为理......
</div>
</a>
<p class="post-meta">
Posted by Kido on
2018-11-23
</p>
</div>
<hr>
<div class="post-preview">
<a href="/2018/11/17/talking_redis_transaction/">
<h2 class="post-title">
浅谈Redis事务
</h2>
<h3 class="post-subtitle">
</h3>
<div class="post-content-preview">
Redis事务和传统关系数据库事务的区别传统数据库事务过程在关系型数据库中,我们开启事务并进行一系列的读写操作,最后,用户用户可以选择发送commit来确认之前的修改,或者发送rollback来放弃之前的修改。
1234567891011Connection conn = ... //获取数据库连接conn.setAutoCommit(false); //开启事务try{ //......
</div>
</a>
<p class="post-meta">
Posted by Kido on
2018-11-17
</p>
</div>
<hr>
<!-- Pager -->
<ul class="pager">
</ul>
<!-- 如果开启评论功能 -->
</div>
<!-- Sidebar Container -->
<div class="
col-lg-3 col-lg-offset-0
col-md-3 col-md-offset-0
col-sm-12
col-xs-12
sidebar-container
">
<!-- Featured Tags -->
<section>
<!-- no hr -->
<h5><a href="/tags/">FEATURED TAGS</a></h5>
<div class="tags">
<a href="/tags/#缓存" title="缓存" rel="6">缓存</a>
<a href="/tags/#JSON" title="JSON" rel="1">JSON</a>
<a href="/tags/#Redis" title="Redis" rel="1">Redis</a>
</div>
</section>
<!-- Short About -->
<section class="visible-md visible-lg">
<hr><h5><a href="/about/">ABOUT ME</a></h5>
<div class="short-about">
<img src="/img/blog-avatar.jpg" />
<p>泡面大厨</p>
<!-- SNS Link -->
<ul class="list-inline">
<li>
<a target="_blank" href="https://www.zhihu.com/people/dian-Kido">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-stack-1x fa-inverse">知</i>
</span>
</a>
</li>
<li>
<a target="_blank" href="http://weibo.com/1882973501">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a target="_blank" href="https://github.com/Dian-Kido">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
</div>
</section>
<!-- Friends Blog -->
<hr>
<h5>FRIENDS</h5>
<ul class="list-inline">
<li><a href="https://ocarina-diary.com/blogs/" target="_blank">陶笛日记</a></li>
<li><a href="https://goffea.com/" target="_blank">Peter Fan</a></li>
<li><a href="http://www.tianshouzhi.com/" target="_blank">TianShouzhi</a></li>
<li><a href="https://breeze924.github.io/" target="_blank">Breeze924</a></li>
</ul>
</div>
</div>
</div>
<!-- Footer -->
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center">
<li>
<a target="_blank" href="https://www.zhihu.com/people/dian-Kido">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-stack-1x fa-inverse">知</i>
</span>
</a>
</li>
<li>
<a target="_blank" href="http://weibo.com/1882973501">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a target="_blank" href="https://github.com/Dian-Kido">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="copyright text-muted">
Copyright © Kido 2022
<br>
<!--
Theme by <a target="_blank" rel="noopener" href="http://huangxuan.me">Hux</a>
<span style="display: inline-block; margin: 0 5px;">
<i class="fa fa-heart"></i>
</span>
Ported by <a target="_blank" rel="noopener" href="http://blog.kaijun.rocks">Kaijun</a> |
<iframe
style="margin-left: 2px; margin-bottom:-5px;"
frameborder="0" scrolling="0" width="91px" height="20px"
src="https://ghbtns.com/github-btn.html?user=kaijun&repo=hexo-theme-huxblog&type=star&count=true" >
</iframe>
-->
</p>
</div>
</div>
</div>
</footer>
<!-- jQuery -->
<script src="/js/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="/js/bootstrap.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="/js/hux-blog.min.js"></script>
<!-- async load function -->
<script>
function async(u, c) {
var d = document, t = 'script',
o = d.createElement(t),
s = d.getElementsByTagName(t)[0];
o.src = u;
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
s.parentNode.insertBefore(o, s);
}
</script>
<!--
Because of the native support for backtick-style fenced code blocks
right within the Markdown is landed in Github Pages,
From V1.6, There is no need for Highlight.js,
so Huxblog drops it officially.
- https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0
- https://help.github.com/articles/creating-and-highlighting-code-blocks/
-->
<!--
<script>
async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
hljs.initHighlightingOnLoad();
})
</script>
<link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
-->
<!-- jquery.tagcloud.js -->
<script>
// only load tagcloud.js in tag.html
if($('#tag_cloud').length !== 0){
async("https://blog.kido.site/js/jquery.tagcloud.js",function(){
$.fn.tagcloud.defaults = {
//size: {start: 1, end: 1, unit: 'em'},
color: {start: '#bbbbee', end: '#0085a1'},
};
$('#tag_cloud a').tagcloud();
})
}
</script>
<!--fastClick.js -->
<script>
async("/js/fastclick.min.js", function(){
var $nav = document.querySelector("nav");
if($nav) FastClick.attach($nav);
})
</script>
<!-- Google Analytics
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-140410086-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-140410086-2');
</script>
-->
<!-- Baidu Tongji -->
<script>
// dynamic User by Hux
var _baId = '14296f5fec38bbac68ddad04e4cf4b72';
// Originial
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?" + _baId;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Side Catalog -->
<!-- Image to hack wechat -->
<!-- <img src="https://blog.kido.site/img/icon_wechat.png" width="0" height="0" /> -->
<!-- Migrate from head to bottom, no longer block render and still work -->
</body>
</html>