SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
MySQL High Availability
Baron Schwartz
February 2011
Agenda
● Defining High Availability
● High Availability Techniques
● High Availability Technologies
● Recommendations (?)
What is High Availability?
● What is Availability?
● How high is enough?
○ "I need six nines"
● MTTR and MTBF
● Service availability versus data availability
Achieving HA
● Increase MTBF
○ "Best practices" and proactive measures
○ Monitoring and alerting
○ Build systems that can soft-fail or run degraded
● Reduce MTTR
○ This is reactive, not proactive
○ Add redundancy to remove SPOFs
○ Add failover/takeover capabilities
Increasing MTBF
● Test regularly; find failures before they matter
● Least privilege
● Keep things neat, clean, systematic
● Manage changes carefully
○ More about this in "causes of downtime" talk
● Good system architecture & design
○ Loose coupling, degraded functionality, load shedding,
etc
Decreasing MTTR
● Two important components:
1. Notice problems quickly
2. Resolve them quickly
● Technical measures help with part 2
○ Systems that have no SPOF, etc
○ Redundancy and failover capability
Data Availability
● This is a related topic, but distinct from HA
● Typically want a strong D guarantee in ACID
● Usually implemented with synchronous replication
● In practice, usually inseparable from HA
● Makes HA much harder
○ It's easy to be HA if it's OK to lose your data!
Technologies
● Replication
● SAN
● DRBD
● MySQL Cluster (NDB)
● Percona XtraDB Cluster (Galera)
● Clustrix and similar
● Load Balancing and Proxies
Replication
● The classic approach, used for years by many
● Can have very short MTTR
● Essential problem: asynchronous
● Has a "glass ceiling"
● Some failover managers available, but most aren't great
SAN
● "Enterprise" approach
● Really a zero-data-loss technique, not HA
● MTTR can be (very) high
● SAN is still a SPOF (can be mitigated)
DRBD
● Replicated storage
● "Enterprise" zero-data-loss approach
● Relatively high MTTR
● DRBD + replication historically not a great approach
● There is Percona-PRM; worth knowing about
Percona XtraDB Cluster
● Built on modified InnoDB + Galera sync replication library
● Multi-master, synchronous, write-anywhere
● Beta; see percona.com/software/
Percona XtraDB Cluster
● Strengths?
○ Transparent, familiar technology*
○ Real HA and protection from data loss
○ No lagging replicas
○ Data stored redundantly; all nodes equal
● Weaknesses?
○ As slow as the slowest node
○ Data stored redundantly; probably limits total size
○ Deadlocks and rollbacks can increase
* Uses optimistic conflict resolution, not pessimistic
MySQL Cluster (NDB)
● Shared-nothing approach: true HA
● Not fully general-purpose, but good for lots of things
● Not "vanilla MySQL" - NDB is a separate database
● Improving rapidly; MySQL Cluster 7.2 GA today!
● Unbeatable for specific purposes
Clustrix et al.
● Clustrix
○ NDB-ish, but queries execute fully on the nodes
○ Validated extensively by Percona
● Xeround
○ Ditto; for the cloud; not evaluated by Percona yet
● Continuent Tungsten
○ Replacement for MySQL replication
○ Kind of an opensource GoldenGate
Load Balancing and Proxies
● Usually used in combination with replication
● Usually require some scripting/integration
● $YOUR_LOAD_BALANCER_HERE
● HAProxy, pen, etc
● MySQL Proxy
● ScaleBase, ScaleArc
Recommendations
● Sorry, too complex for these slides :)
● Usual approach:
○ Cross off unsuitable solutions
○ Examine what's left
● Anti-recommendations:
○ Be careful with replication-based HA
○ MMM can be troublesome in some configurations
○ MySQL Proxy doesn't really excel in most cases
Percona XtraDB Cluster
● Writes update all nodes
● Reads execute locally
Comparison of Clustering Methods
MySQL Cluster (NDB)
● Writes update all copies of data
● Reads execute locally + distributed
Comparison of Clustering Methods
Clustrix
● Writes update all copies of data
● Reads execute fully distributed
Comparison of Clustering Methods
What's Percona Been Up To?
http://tools.percona.com/
Resources
● Free webinars: www.percona.com/webinars
● White papers on preventing downtime:
○ www.percona.com/about-us/mysql-white-papers
○ "Causes of downtime" paper
○ "Preventing downtime" paper
● Slides from Percona Live DC 2012
○ Yves's talk on Percona-PRM and MySQL Cluster
○ percona.com/live/
Santa Clara, CA
April 10-13
Be There!

Contenu connexe

Tendances

Tendances (19)

MySQL topology healing at OLA.
MySQL topology healing at OLA.MySQL topology healing at OLA.
MySQL topology healing at OLA.
 
P99CONF — What We Need to Unlearn About Persistent Storage
P99CONF — What We Need to Unlearn About Persistent StorageP99CONF — What We Need to Unlearn About Persistent Storage
P99CONF — What We Need to Unlearn About Persistent Storage
 
How to Meet Your P99 Goal While Overcommitting Another Workload
How to Meet Your P99 Goal While Overcommitting Another WorkloadHow to Meet Your P99 Goal While Overcommitting Another Workload
How to Meet Your P99 Goal While Overcommitting Another Workload
 
Optimising for Performance
Optimising for PerformanceOptimising for Performance
Optimising for Performance
 
Pass Elk: CAP Theorem since 90s and Beyond
Pass Elk: CAP Theorem since 90s and BeyondPass Elk: CAP Theorem since 90s and Beyond
Pass Elk: CAP Theorem since 90s and Beyond
 
RESTEasy Reactive: Why should you care? | DevNation Tech Talk
RESTEasy Reactive: Why should you care? | DevNation Tech TalkRESTEasy Reactive: Why should you care? | DevNation Tech Talk
RESTEasy Reactive: Why should you care? | DevNation Tech Talk
 
M|18 PolarDB: Extending Shared-storage to MyRocks
M|18 PolarDB: Extending Shared-storage to MyRocksM|18 PolarDB: Extending Shared-storage to MyRocks
M|18 PolarDB: Extending Shared-storage to MyRocks
 
Redis part 2
Redis part 2Redis part 2
Redis part 2
 
M|18 How DBAs at TradingScreen Make Life Easier With Automation
M|18 How DBAs at TradingScreen Make Life Easier With AutomationM|18 How DBAs at TradingScreen Make Life Easier With Automation
M|18 How DBAs at TradingScreen Make Life Easier With Automation
 
Auto Europe's ongoing journey with MariaDB and open source
Auto Europe's ongoing journey with MariaDB and open sourceAuto Europe's ongoing journey with MariaDB and open source
Auto Europe's ongoing journey with MariaDB and open source
 
Keeping Latency Low and Throughput High with Application-level Priority Manag...
Keeping Latency Low and Throughput High with Application-level Priority Manag...Keeping Latency Low and Throughput High with Application-level Priority Manag...
Keeping Latency Low and Throughput High with Application-level Priority Manag...
 
Scylla Cloud on Display: Functionality, Performance and Demos
Scylla Cloud on Display: Functionality, Performance and DemosScylla Cloud on Display: Functionality, Performance and Demos
Scylla Cloud on Display: Functionality, Performance and Demos
 
Sizing Your Scylla Cluster
Sizing Your Scylla ClusterSizing Your Scylla Cluster
Sizing Your Scylla Cluster
 
Seastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for CephSeastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for Ceph
 
Scylla Summit 2016: Why Kenshoo is about to displace Cassandra with Scylla
Scylla Summit 2016: Why Kenshoo is about to displace Cassandra with ScyllaScylla Summit 2016: Why Kenshoo is about to displace Cassandra with Scylla
Scylla Summit 2016: Why Kenshoo is about to displace Cassandra with Scylla
 
CrateDB - Giacomo Ceribelli
CrateDB - Giacomo CeribelliCrateDB - Giacomo Ceribelli
CrateDB - Giacomo Ceribelli
 
How Incremental Compaction Reduces Your Storage Footprint
How Incremental Compaction Reduces Your Storage FootprintHow Incremental Compaction Reduces Your Storage Footprint
How Incremental Compaction Reduces Your Storage Footprint
 
Avoiding Data Hotspots at Scale
Avoiding Data Hotspots at ScaleAvoiding Data Hotspots at Scale
Avoiding Data Hotspots at Scale
 
strangeloop 2012 apache cassandra anti patterns
strangeloop 2012 apache cassandra anti patternsstrangeloop 2012 apache cassandra anti patterns
strangeloop 2012 apache cassandra anti patterns
 

En vedette (6)

The MySQL Diaspora
The MySQL DiasporaThe MySQL Diaspora
The MySQL Diaspora
 
Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化
 
Percona XtraDB 集群内部
Percona XtraDB 集群内部Percona XtraDB 集群内部
Percona XtraDB 集群内部
 
Confluencewiki 使用空间
Confluencewiki 使用空间Confluencewiki 使用空间
Confluencewiki 使用空间
 
Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件
 
Percona XtraDB 集群安装与配置
Percona XtraDB 集群安装与配置Percona XtraDB 集群安装与配置
Percona XtraDB 集群安装与配置
 

Similaire à MySQL 高可用性

MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
Lenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
Louis liu
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemaker
kuchinskaya
 
Benchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetesBenchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetes
DoKC
 
Olap scalability
Olap scalabilityOlap scalability
Olap scalability
lucboudreau
 
UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL Tuning
FromDual GmbH
 

Similaire à MySQL 高可用性 (20)

Running MySQL in AWS
Running MySQL in AWSRunning MySQL in AWS
Running MySQL in AWS
 
Redis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs TalksRedis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs Talks
 
Scalability broad strokes
Scalability   broad strokesScalability   broad strokes
Scalability broad strokes
 
MariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database ProxyMariaDB MaxScale: an Intelligent Database Proxy
MariaDB MaxScale: an Intelligent Database Proxy
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
Scalable, good, cheap
Scalable, good, cheapScalable, good, cheap
Scalable, good, cheap
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemaker
 
Benchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetesBenchmarking for postgresql workloads in kubernetes
Benchmarking for postgresql workloads in kubernetes
 
Olap scalability
Olap scalabilityOlap scalability
Olap scalability
 
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache KafkaStrata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
Strata+Hadoop 2017 San Jose: Lessons from a year of supporting Apache Kafka
 
Evolution of DBA in the Cloud Era
 Evolution of DBA in the Cloud Era Evolution of DBA in the Cloud Era
Evolution of DBA in the Cloud Era
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia Databases
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
 
UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL Tuning
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 
OSMC 2019 | How to improve database Observability by Charles Judith
OSMC 2019 | How to improve database Observability by Charles JudithOSMC 2019 | How to improve database Observability by Charles Judith
OSMC 2019 | How to improve database Observability by Charles Judith
 

Plus de YUCHENG HU

Confluence 回顾(retrospectives) 蓝图 cwikiossez
Confluence 回顾(retrospectives) 蓝图   cwikiossezConfluence 回顾(retrospectives) 蓝图   cwikiossez
Confluence 回顾(retrospectives) 蓝图 cwikiossez
YUCHENG HU
 

Plus de YUCHENG HU (20)

Git
GitGit
Git
 
Logback 介绍
Logback 介绍Logback 介绍
Logback 介绍
 
Presta shop 1.6 详细安装指南
Presta shop 1.6 详细安装指南Presta shop 1.6 详细安装指南
Presta shop 1.6 详细安装指南
 
Presta shop 1.6 的安装环境
Presta shop 1.6 的安装环境Presta shop 1.6 的安装环境
Presta shop 1.6 的安装环境
 
Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件
 
Presta shop 1.6 图文安装教程
Presta shop 1.6 图文安装教程Presta shop 1.6 图文安装教程
Presta shop 1.6 图文安装教程
 
V tiger 5.4.0 图文安装教程
V tiger 5.4.0 图文安装教程V tiger 5.4.0 图文安装教程
V tiger 5.4.0 图文安装教程
 
Confluence 回顾(retrospectives) 蓝图 cwikiossez
Confluence 回顾(retrospectives) 蓝图   cwikiossezConfluence 回顾(retrospectives) 蓝图   cwikiossez
Confluence 回顾(retrospectives) 蓝图 cwikiossez
 
Confluence 会议记录(meeting notes)蓝图 cwikiossez
Confluence 会议记录(meeting notes)蓝图   cwikiossezConfluence 会议记录(meeting notes)蓝图   cwikiossez
Confluence 会议记录(meeting notes)蓝图 cwikiossez
 
VTIGER - 销售机会 - CWIKIOSSEZ
VTIGER - 销售机会 - CWIKIOSSEZ VTIGER - 销售机会 - CWIKIOSSEZ
VTIGER - 销售机会 - CWIKIOSSEZ
 
Confluence 使用一个模板新建一个页面 cwikiossez
Confluence 使用一个模板新建一个页面     cwikiossezConfluence 使用一个模板新建一个页面     cwikiossez
Confluence 使用一个模板新建一个页面 cwikiossez
 
Confluence 使用模板
Confluence 使用模板Confluence 使用模板
Confluence 使用模板
 
Cwikiossez confluence 订阅页面更新邮件通知
Cwikiossez confluence 订阅页面更新邮件通知Cwikiossez confluence 订阅页面更新邮件通知
Cwikiossez confluence 订阅页面更新邮件通知
 
Cwikiossez confluence 关注页面 博客页面和空间
Cwikiossez confluence 关注页面 博客页面和空间Cwikiossez confluence 关注页面 博客页面和空间
Cwikiossez confluence 关注页面 博客页面和空间
 
My sql università di enna a.a. 2005-06
My sql   università di enna a.a. 2005-06My sql   università di enna a.a. 2005-06
My sql università di enna a.a. 2005-06
 
My sql would you like transactions
My sql would you like transactionsMy sql would you like transactions
My sql would you like transactions
 
MySQL 指南
MySQL 指南MySQL 指南
MySQL 指南
 
MySQL 简要介绍
MySQL 简要介绍MySQL 简要介绍
MySQL 简要介绍
 
mysql 5.5.25 用户安装备忘
mysql 5.5.25 用户安装备忘mysql 5.5.25 用户安装备忘
mysql 5.5.25 用户安装备忘
 
Sql
SqlSql
Sql
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

MySQL 高可用性

  • 1. MySQL High Availability Baron Schwartz February 2011
  • 2. Agenda ● Defining High Availability ● High Availability Techniques ● High Availability Technologies ● Recommendations (?)
  • 3. What is High Availability? ● What is Availability? ● How high is enough? ○ "I need six nines" ● MTTR and MTBF ● Service availability versus data availability
  • 4. Achieving HA ● Increase MTBF ○ "Best practices" and proactive measures ○ Monitoring and alerting ○ Build systems that can soft-fail or run degraded ● Reduce MTTR ○ This is reactive, not proactive ○ Add redundancy to remove SPOFs ○ Add failover/takeover capabilities
  • 5. Increasing MTBF ● Test regularly; find failures before they matter ● Least privilege ● Keep things neat, clean, systematic ● Manage changes carefully ○ More about this in "causes of downtime" talk ● Good system architecture & design ○ Loose coupling, degraded functionality, load shedding, etc
  • 6. Decreasing MTTR ● Two important components: 1. Notice problems quickly 2. Resolve them quickly ● Technical measures help with part 2 ○ Systems that have no SPOF, etc ○ Redundancy and failover capability
  • 7. Data Availability ● This is a related topic, but distinct from HA ● Typically want a strong D guarantee in ACID ● Usually implemented with synchronous replication ● In practice, usually inseparable from HA ● Makes HA much harder ○ It's easy to be HA if it's OK to lose your data!
  • 8. Technologies ● Replication ● SAN ● DRBD ● MySQL Cluster (NDB) ● Percona XtraDB Cluster (Galera) ● Clustrix and similar ● Load Balancing and Proxies
  • 9. Replication ● The classic approach, used for years by many ● Can have very short MTTR ● Essential problem: asynchronous ● Has a "glass ceiling" ● Some failover managers available, but most aren't great
  • 10. SAN ● "Enterprise" approach ● Really a zero-data-loss technique, not HA ● MTTR can be (very) high ● SAN is still a SPOF (can be mitigated)
  • 11. DRBD ● Replicated storage ● "Enterprise" zero-data-loss approach ● Relatively high MTTR ● DRBD + replication historically not a great approach ● There is Percona-PRM; worth knowing about
  • 12. Percona XtraDB Cluster ● Built on modified InnoDB + Galera sync replication library ● Multi-master, synchronous, write-anywhere ● Beta; see percona.com/software/
  • 13. Percona XtraDB Cluster ● Strengths? ○ Transparent, familiar technology* ○ Real HA and protection from data loss ○ No lagging replicas ○ Data stored redundantly; all nodes equal ● Weaknesses? ○ As slow as the slowest node ○ Data stored redundantly; probably limits total size ○ Deadlocks and rollbacks can increase * Uses optimistic conflict resolution, not pessimistic
  • 14. MySQL Cluster (NDB) ● Shared-nothing approach: true HA ● Not fully general-purpose, but good for lots of things ● Not "vanilla MySQL" - NDB is a separate database ● Improving rapidly; MySQL Cluster 7.2 GA today! ● Unbeatable for specific purposes
  • 15. Clustrix et al. ● Clustrix ○ NDB-ish, but queries execute fully on the nodes ○ Validated extensively by Percona ● Xeround ○ Ditto; for the cloud; not evaluated by Percona yet ● Continuent Tungsten ○ Replacement for MySQL replication ○ Kind of an opensource GoldenGate
  • 16. Load Balancing and Proxies ● Usually used in combination with replication ● Usually require some scripting/integration ● $YOUR_LOAD_BALANCER_HERE ● HAProxy, pen, etc ● MySQL Proxy ● ScaleBase, ScaleArc
  • 17. Recommendations ● Sorry, too complex for these slides :) ● Usual approach: ○ Cross off unsuitable solutions ○ Examine what's left ● Anti-recommendations: ○ Be careful with replication-based HA ○ MMM can be troublesome in some configurations ○ MySQL Proxy doesn't really excel in most cases
  • 18. Percona XtraDB Cluster ● Writes update all nodes ● Reads execute locally Comparison of Clustering Methods
  • 19. MySQL Cluster (NDB) ● Writes update all copies of data ● Reads execute locally + distributed Comparison of Clustering Methods
  • 20. Clustrix ● Writes update all copies of data ● Reads execute fully distributed Comparison of Clustering Methods
  • 21. What's Percona Been Up To? http://tools.percona.com/
  • 22. Resources ● Free webinars: www.percona.com/webinars ● White papers on preventing downtime: ○ www.percona.com/about-us/mysql-white-papers ○ "Causes of downtime" paper ○ "Preventing downtime" paper ● Slides from Percona Live DC 2012 ○ Yves's talk on Percona-PRM and MySQL Cluster ○ percona.com/live/
  • 23. Santa Clara, CA April 10-13 Be There!