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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Gea-Suan Lin
July 29, 2012
Technology
4
470
MySQL - The Old Way
Gea-Suan Lin
July 29, 2012
Tweet
Share
More Decks by Gea-Suan Lin
See All by Gea-Suan Lin
High Availability Vault Service on AWS Environment
gslin
0
7.2k
用 AWS CodeDeploy 解決程式佈署
gslin
0
420
MySQL to NoSQL & Search Engine
gslin
0
2.1k
用 Vagrant 與 Docker 拯救世界
gslin
1
280
Startup IT infrastructure: Developing and Working with AWS
gslin
8
3.7k
Talk about Percona XtraDB Cluster
gslin
0
190
API Design Optimized for Mobile Platform
gslin
9
8.7k
Use Facebook::Graph to write desktop application
gslin
2
510
COSCUP 2012 - MySQL System Stability
gslin
17
12k
Other Decks in Technology
See All in Technology
Claude Code for NOT Programming
kawaguti
PRO
1
100
Webhook best practices for rock solid and resilient deployments
glaforge
2
310
Agile Leadership Summit Keynote 2026
m_seki
1
680
AWS DevOps Agent x ECS on Fargate検証 / AWS DevOps Agent x ECS on Fargate
kinunori
2
190
SchooでVue.js/Nuxtを技術選定している理由
yamanoku
3
210
OpenShiftでllm-dを動かそう!
jpishikawa
0
140
生成AIと余白 〜開発スピードが向上した今、何に向き合う?〜
kakehashi
PRO
0
160
AWS Network Firewall Proxyを触ってみた
nagisa53
1
240
22nd ACRi Webinar - NTT Kawahara-san's slide
nao_sumikawa
0
110
私たち準委任PdEは2つのプロダクトに挑戦する ~ソフトウェア、開発支援という”二重”のプロダクトエンジニアリングの実践~ / 20260212 Naoki Takahashi
shift_evolve
PRO
2
210
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
210
1,000 にも届く AWS Organizations 組織のポリシー運用をちゃんとしたい、という話
kazzpapa3
0
180
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
110
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
190
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
68
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
Into the Great Unknown - MozCon
thekraken
40
2.3k
Scaling GitHub
holman
464
140k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
110
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
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 !