Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MySQL - The Old Way
Search
Gea-Suan Lin
July 29, 2012
Technology
500
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MySQL - The Old Way
Gea-Suan Lin
July 29, 2012
More Decks by Gea-Suan Lin
See All by Gea-Suan Lin
High Availability Vault Service on AWS Environment
gslin
0
7.3k
用 AWS CodeDeploy 解決程式佈署
gslin
0
460
MySQL to NoSQL & Search Engine
gslin
0
2.3k
用 Vagrant 與 Docker 拯救世界
gslin
1
320
Startup IT infrastructure: Developing and Working with AWS
gslin
8
3.8k
Talk about Percona XtraDB Cluster
gslin
0
220
API Design Optimized for Mobile Platform
gslin
9
8.8k
Use Facebook::Graph to write desktop application
gslin
2
520
COSCUP 2012 - MySQL System Stability
gslin
17
12k
Other Decks in Technology
See All in Technology
指示待ちから変化に応じるClaude Codeへ!~環境からAgentへの帰り道を作る~
gotalab555
7
1.5k
最新技術に積極チャレンジ!EKS共通基盤のこれまでとこれから
daitak
0
250
サーバー常駐型の 簡易障害調査AI エージェントを作ってみた話
masayoshi
1
290
GopherCon @シアトル に行ってきました
logica0419
0
330
現場の暗黙知を継承するAIエージェント — 対話から生まれる長期記憶と Skills
atsukish
0
120
紙 to デジタル
ichien178
0
340
Claude Codeで開発以外の業務も爆速化しよう!
minorun365
PRO
10
8.9k
会計事務所と顧問先の契約関係をOIDC・OAuthで表現する
terara
0
480
The Django UUID Story - DjangoCon US 2026
pauloxnet
0
310
分割40%キーボードにスムーズに入門するには
hoto17296
1
180
LLMアプリ、 雰囲気で運用してませんか? 〜LLMOpsの現在地〜
taka_aki
1
550
フィジカルAIの知識ゼロの僕でも AIを使えばここまでできた
tatsuya1970
0
200
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
220
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
310
Designing for Timeless Needs
cassininazir
1
460
Ethics towards AI in product and experience design
skipperchong
2
350
Google's AI Overviews - The New Search
badams
0
1.6k
Building the Perfect Custom Keyboard
takai
2
850
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Code Reviewing Like a Champion
maltzj
528
40k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Transcript
MySQL - The Old Way Gea-Suan Lin
Old != Bad
In this case, Old implies Reliable
Reliable
We are familiar with these issues,
We can workaround these issues
So...
First Solution
Built-in Replication
http://dev.mysql.com/ doc/refman/5.5/en/ replication.html
The Good Part
Simple
Dead Simple Setup
Dead Simple Concept
Master logs changes
Slave applies changes
The Bad Part
Async
Means...
Replication Lag
When you write data to master,
It’s possible unable to read from slave
Workaround
Always use master if you write data
The Worst Part
Application cannot write after master crash
This derives...
Second Solution
Master-Master
Two MySQL servers
Set each other as master server
The Good Part
Both MySQL servers can be written
The Bad Part
Data inconsistent
MySQL Server A TRUNCATE TABLE t; INSERT t SET i=1;
MySQL Server B TRUNCATE TABLE t; INSERT t SET i=2;
MySQL Server A TRUNCATE TABLE t; INSERT t SET i=1;
TRUNCATE TABLE t; INSERT t SET i=2; MySQL Server B TRUNCATE TABLE t; INSERT t SET i=2; TRUNCATE TABLE t; INSERT t SET i=1;
Result
MySQL Server A i=2 MySQL Server B i=1
Workaround
Write one server in normal case
Write another one when primary node fails
You can write code to handle failover
But we suggest to use Heartbeat
Heartbeat can handle this failover case
When data is inconsistent,
We can use Percona’s pt-table-sync to sync data
Third Solution
DRBD + Heartbeat
DRBD is Network-based RAID-1
Block-level mirror
Heartbeat handles High Availability
http://dev.mysql.com/ doc/refman/5.5/en/ha- drbd.html
http://dev.mysql.com/ doc/refman/5.5/en/ha- heartbeat.html
The Good Part
Data consistent
You won’t need to worry about data inconsistent issue
The Bad Part
Utilization Rate
Only one server uses to serve applications
Warm up time
When I/O rate cannot catch query rate
Conclusion
DRBD has higher down-time than other twos,
And it costs higher in server hardware
But it costs lower for SA Operations
If down-time of DRBD + Heartbeat is acceptable,
You should choose it
How much down- time ?
It depends,
Usually < 30 secs to failover
With warm up time
Possible 3~5 mins for 10GB data size ?
Thanks !