SlideShare una empresa de Scribd logo
1 de 42
Descargar para leer sin conexión
Has MySQL Grown Up?

    Mark Stanton grude
A brief history
A brief history
1995          Named after Monty’s daughter (My)
2000          Open sourced
2001   3.23
2003   4.0
2005   5.0    Oracle buys the company behind InnoDB
2006          MySQL hits 33% market share, Oracle tries to buy
2008   5.1    Sun acquires MySQL for $1 billion, Monty leaves
2010   5.5    Oracle buys Sun for $7.4 billion
Where are we now?
• MySQL is growing up
• Oracle are showing love
• Facebook, Google & others are contributing
• Make sure you are running:
 • 5.5
 • recent version of 5.1
The wonderful world of
   Storage Engines
Storage Engines

•   Storage engines are pluggable
    table types

•   You can have multiple storage
    engines within each a DB

•   Transparent to clients (mostly)
                                          MyISAM


                                 InnoDB
MyISAM

• Simple, light weight
• File based
• FULLTEXT indexes
• Table level locking
InnoDB

•   ACID compliant         •   Hot backup

•   Crash safe             •   Active development

•   Foreign keys           •   Optimised for multi-core

•   Row-level locking      •   Default from 5.5 on

•   Table compression      •   No FULLTEXT (until 5.6)
NDB - MySQL Cluster
•   High Availability
•   Tables clustered across
    nodes
•   Auto fail & recover
•   Auto partitioning
•   No FK, limited transactions
•   Poor multi-table joins
•   Pretends to be MySQL,
    really whole other product
Other Storage Engines

• MERGE
• MEMORY
• BLACKHOLE
• CSV (                                                      )
     CREATE TABLE export ENGINE=CSV SELECT foo, bar FROM table
Storage Engines:
        Conclusion

• InnoDB is the new default & new direction
• MyISAM is the past
• If you are still on MyISAM, think of moving
• NDB is very interesting for special cases
Replication
Why Replicate?

• Scale out
• High availability
• Geographic
• Backup
• Analytics / Business Intelligence
Under the Hood:
              Logs

                               IO Thread



             Step 2   Step 3
                                            SQL
                                           Thread


Step 1                          Step 4
Under the Hood:
    Format


     • Statement:
       UPDATE table..
     • Records
      1100101100111
Under the Hood:
            Semi-sync


             Step 1   Step 1




Step 1                         Step 2
Configuration:
               Master-Slave
•   Master my.cnf:
    server-id = 10
    log-bin=mysql-M1-bin


•   Master DB:
    mysql> CREATE USER 'repl';          Name    Server-Id Port
    mysql> GRANT REPLICATION SLAVE ON
           *.* TO 'repl';
                                        M1      10        3310

•   Slave my.cnf:
    server-id = 11
                                        M1-S1   11        3311


•   Slave DB:
    mysql> CHANGE MASTER TO
           MASTER_HOST='localhost',
           MASTER_PORT=3310,
           MASTER_USER='repl';
SHOW SLAVE STATUS
mysql> show slave status G
*************************** 1.   row ***************************
               Slave_IO_State:   Waiting for master to send event
             Master_Server_Id:   10
                  Master_Host:   localhost
                  Master_Port:   3310
                  Master_User:   repl
              Master_Log_File:   mysql-M1-bin.000017
          Read_Master_Log_Pos:   107
          Exec_Master_Log_Pos:   107
             Slave_IO_Running:   Yes
            Slave_SQL_Running:   Yes
                   Last_Errno:   0
                   Last_Error:
        Seconds_Behind_Master:   0
             Master_Server_Id:   10
In Practice
Multi-Master

  M1      M2




 M1#S1   M2#S1
Why Multi-Master?


• Active/Passive sites
• High Availability
• Geographically dispersed writes
Multi-Master:
        Considerations

Multi-Master replication needs at least one of:
•   Conflict Avoidance
•   Conflict Resolution
•   Hope
Multi-Master:
      Considerations
• Conflict Avoidance
 • UUIDs
 • Auto increment hacks = 2
   auto_increment_increment
   auto_increment_offset = 1

 • Semi-sync
 • Active/Passive
 • Ticket server
Multi-Master:
       Considerations

• Conflict Resolution
 • Cluster/NDB
 • Galera
 • or roll your own...
Configuration:
              Multi-Master
Name    Server-Id Port
M1      10        3310
M1-S1   11        3311
M2      20        3320
                          M1      M2
M2-S1   21        3321


• M2 as slave of M1
• M1 as slave of M2
• M2-S1 as slave of M2
                         M1#S1   M2#S1
Review of Topologies
   Master   Master   Master   Master     Master     Master




   Slave    Slave                         Slave      Slave




  Master    Slave                        Master    Master




                                       Mul)*      Mul)*
Mul$%
                                       Slaves     Slaves
Slaves
Connector/J

• MySQL’s Connector/J supports:
 • Failover
 • Load Balancing
 • (Replication)
JDBC Connection
          Syntax

jdbc:mysql://hostname:port/dbname ?property=value

jdbc:mysql://localhost:3306/test?username=root
JDBC Failover
jdbc:mysql://host1:port1,host2:port2/dbname
JDBC Load Balancing
jdbc:mysql:loadbalance://host1:port1,host2:port2,host3:port3/dbname
Warning

• Failover doesn’t attempt to be transparent
• ColdFusion doesn’t allow you full control
• Check/upgrade your Connector/J version
• Set connectionTimeout, socketTimeout and
  blacklistTimeout carefully
MySQL Enterprise
   Monitor
MySQL Enterprise
       Monitor
• Heat maps
• Charts
• Query analyser
• Replication status
• Configurable advisors & email alerts
• Event logs
MySQL Enterprise
       Monitor

• Server with agents for each mysqld
• Query analyser can have performance hit
• Non-free
Backing Up MySQL
• Several approaches:
 • Copy DB files
 • mysqldump
 • binlog
 • Backup to slave
 • mysqlbackup
Backup: File copy

• Enable read lock:
  mysql> LOCK TABLES READ;
  mysql> FLUSH TABLES;


• Run file copy:
  $ cp -R ./myDB /mybackups/myDB


• Unlock tables:
  mysql> UNLOCK TABLES;
Backup: mysqldump

• Creates an sql script containing commands
  to recreate database
• Run from command-line:
  $ mysqldump --single-transaction --all-databases >
  backup_sunday_1_PM.sql
Backup: binlog
• The binary log:
 • records statements
 • can be replayed from arbitrary point
 • need to know where to replay from
• Rotate binlog
  mysql> FLUSH LOGS;


• Then copy relevant files
Backup: Slave

• Setup dedicated slave for backup purposes
• Shutdown slave
• Run backup
• Restart slave
Backup: mysqlbackup
• Non-free enterprise backup tool
• Features:
 • Hot
 • Incremental
 • Compressed
 • Verification
Summary of Backup
              Options
                                                                           backup to
                       copy DB files             mysqldump       binlog                 mysqlbackup
                                                                           slave

                                                Lock (MyISAM)                          Lock (MyISAM)
Hot/Read-Lock                   Lock                                Hot        Hot
                                                Hot* (InnoDB)                           Hot (InnoDB)


Incremental                      No                  No              Yes       No           Yes



InnoDB Support                   No                  Yes             Yes       Yes          Yes



Restore Speed                    Fast              OK **            OK         Fast        Fast

* use --single-transaction for InnoDB
** disable for autocommit/FK checks in InnoDB
Questions?

• Mark Stanton
• http://blog.gruden.com
• mark@gruden.com
• @MarkStanto

Más contenido relacionado

La actualidad más candente

Mysql replication @ gnugroup
Mysql replication @ gnugroupMysql replication @ gnugroup
Mysql replication @ gnugroupJayant Chutke
 
JBoss, Rails and the cloud
JBoss, Rails and the cloudJBoss, Rails and the cloud
JBoss, Rails and the cloudelliando dias
 
Windows server 8 hyper v & storage (hans vredevoort)
Windows server 8 hyper v & storage (hans vredevoort)Windows server 8 hyper v & storage (hans vredevoort)
Windows server 8 hyper v & storage (hans vredevoort)hypervnu
 
MySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsMySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsRapidValue
 
Running Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureRunning Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureSimon Evans
 
vSphere APIs for performance monitoring
vSphere APIs for performance monitoringvSphere APIs for performance monitoring
vSphere APIs for performance monitoringAlan Renouf
 
Automation with Microsoft Powershell
Automation with Microsoft PowershellAutomation with Microsoft Powershell
Automation with Microsoft Powershellsubtitle
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Managerwalkerchang
 
Configuring v sphere 5 profile driven storage
Configuring v sphere 5 profile driven storageConfiguring v sphere 5 profile driven storage
Configuring v sphere 5 profile driven storagevirtualsouthwest
 
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)Eugene Yokota
 
JBoss AS 7 따라잡기
JBoss AS 7 따라잡기JBoss AS 7 따라잡기
JBoss AS 7 따라잡기jbugkorea
 
Ruby For Web Development
Ruby For Web DevelopmentRuby For Web Development
Ruby For Web DevelopmentJames Thompson
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der PraxisJonathan Weiss
 
Yabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvmYabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvmIsaku Yamahata
 

La actualidad más candente (20)

Mysql replication @ gnugroup
Mysql replication @ gnugroupMysql replication @ gnugroup
Mysql replication @ gnugroup
 
JBoss, Rails and the cloud
JBoss, Rails and the cloudJBoss, Rails and the cloud
JBoss, Rails and the cloud
 
Windows server 8 hyper v & storage (hans vredevoort)
Windows server 8 hyper v & storage (hans vredevoort)Windows server 8 hyper v & storage (hans vredevoort)
Windows server 8 hyper v & storage (hans vredevoort)
 
Automated master failover
Automated master failoverAutomated master failover
Automated master failover
 
MySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsMySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue Solutions
 
Running Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureRunning Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows Azure
 
vSphere APIs for performance monitoring
vSphere APIs for performance monitoringvSphere APIs for performance monitoring
vSphere APIs for performance monitoring
 
Automation with Microsoft Powershell
Automation with Microsoft PowershellAutomation with Microsoft Powershell
Automation with Microsoft Powershell
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Manager
 
Docker ppt
Docker pptDocker ppt
Docker ppt
 
RHT Design for Security
RHT Design for SecurityRHT Design for Security
RHT Design for Security
 
Configuring v sphere 5 profile driven storage
Configuring v sphere 5 profile driven storageConfiguring v sphere 5 profile driven storage
Configuring v sphere 5 profile driven storage
 
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
 
JBoss AS 7 따라잡기
JBoss AS 7 따라잡기JBoss AS 7 따라잡기
JBoss AS 7 따라잡기
 
Vps hosting
Vps hostingVps hosting
Vps hosting
 
2. OS vs. VMM
2. OS vs. VMM2. OS vs. VMM
2. OS vs. VMM
 
Ruby For Web Development
Ruby For Web DevelopmentRuby For Web Development
Ruby For Web Development
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der Praxis
 
Yabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvmYabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvm
 
Nano Server (ATD 11)
Nano Server (ATD 11)Nano Server (ATD 11)
Nano Server (ATD 11)
 

Destacado

Affiliate Huddle - The Value Agencies bring to Affiliate Marketing
Affiliate Huddle - The Value Agencies bring to Affiliate MarketingAffiliate Huddle - The Value Agencies bring to Affiliate Marketing
Affiliate Huddle - The Value Agencies bring to Affiliate MarketingAndrew Girdwood
 
2010 Media Kit Feb 10
2010 Media Kit Feb 102010 Media Kit Feb 10
2010 Media Kit Feb 10guest75a4f37b
 
Slide share as an affiliatemarketing tool for camping trend
Slide share as an  affiliatemarketing tool for camping trendSlide share as an  affiliatemarketing tool for camping trend
Slide share as an affiliatemarketing tool for camping trendElina Guseynova
 
Understand War: Fehrenbach vs Tofflers v1.0
Understand War: Fehrenbach vs Tofflers v1.0Understand War: Fehrenbach vs Tofflers v1.0
Understand War: Fehrenbach vs Tofflers v1.01st_TSG_Airborne
 
managment style
managment stylemanagment style
managment styleNadia
 
The Handy Toolkit for Launching & Measuring a Remarkable Campaign
The Handy Toolkit for Launching & Measuring a Remarkable CampaignThe Handy Toolkit for Launching & Measuring a Remarkable Campaign
The Handy Toolkit for Launching & Measuring a Remarkable CampaignClearPivot
 
Tool kit marketing demo
Tool kit marketing demoTool kit marketing demo
Tool kit marketing demoGiaCSRG
 
Franchise Model - Franchise as a Development Tool - Social Franchise Entreprise
Franchise Model - Franchise as a Development Tool - Social Franchise EntrepriseFranchise Model - Franchise as a Development Tool - Social Franchise Entreprise
Franchise Model - Franchise as a Development Tool - Social Franchise EntrepriseWattJet
 
B2B Affiliate Marketing Tool Kit
B2B Affiliate Marketing Tool KitB2B Affiliate Marketing Tool Kit
B2B Affiliate Marketing Tool KitAffiliate Summit
 
Cream World franchisee kit
Cream World franchisee kitCream World franchisee kit
Cream World franchisee kittenredmedia
 
The Handy Tool Kit For Launching & Measuring a Remarkable Campaign
The Handy Tool Kit For Launching & Measuring a Remarkable CampaignThe Handy Tool Kit For Launching & Measuring a Remarkable Campaign
The Handy Tool Kit For Launching & Measuring a Remarkable CampaignLionbridge
 
Burger King - Case Study Review
 Burger King - Case Study Review Burger King - Case Study Review
Burger King - Case Study ReviewZuhren Md. Nasir
 
Unicef branding toolkit
Unicef branding toolkitUnicef branding toolkit
Unicef branding toolkitRich Tong
 
Presentation on burger king
Presentation on burger kingPresentation on burger king
Presentation on burger kingmominul_Islam
 
Local Store Marketing Presentation
Local Store Marketing PresentationLocal Store Marketing Presentation
Local Store Marketing PresentationMary White-cornell
 
BCG matrix with example
BCG matrix with exampleBCG matrix with example
BCG matrix with exampleMayur Narole
 

Destacado (18)

Affiliate Huddle - The Value Agencies bring to Affiliate Marketing
Affiliate Huddle - The Value Agencies bring to Affiliate MarketingAffiliate Huddle - The Value Agencies bring to Affiliate Marketing
Affiliate Huddle - The Value Agencies bring to Affiliate Marketing
 
2010 Media Kit Feb 10
2010 Media Kit Feb 102010 Media Kit Feb 10
2010 Media Kit Feb 10
 
Slide share as an affiliatemarketing tool for camping trend
Slide share as an  affiliatemarketing tool for camping trendSlide share as an  affiliatemarketing tool for camping trend
Slide share as an affiliatemarketing tool for camping trend
 
Understand War: Fehrenbach vs Tofflers v1.0
Understand War: Fehrenbach vs Tofflers v1.0Understand War: Fehrenbach vs Tofflers v1.0
Understand War: Fehrenbach vs Tofflers v1.0
 
managment style
managment stylemanagment style
managment style
 
Fit En Fun
Fit En FunFit En Fun
Fit En Fun
 
The Handy Toolkit for Launching & Measuring a Remarkable Campaign
The Handy Toolkit for Launching & Measuring a Remarkable CampaignThe Handy Toolkit for Launching & Measuring a Remarkable Campaign
The Handy Toolkit for Launching & Measuring a Remarkable Campaign
 
Tool kit marketing demo
Tool kit marketing demoTool kit marketing demo
Tool kit marketing demo
 
IMC
IMCIMC
IMC
 
Franchise Model - Franchise as a Development Tool - Social Franchise Entreprise
Franchise Model - Franchise as a Development Tool - Social Franchise EntrepriseFranchise Model - Franchise as a Development Tool - Social Franchise Entreprise
Franchise Model - Franchise as a Development Tool - Social Franchise Entreprise
 
B2B Affiliate Marketing Tool Kit
B2B Affiliate Marketing Tool KitB2B Affiliate Marketing Tool Kit
B2B Affiliate Marketing Tool Kit
 
Cream World franchisee kit
Cream World franchisee kitCream World franchisee kit
Cream World franchisee kit
 
The Handy Tool Kit For Launching & Measuring a Remarkable Campaign
The Handy Tool Kit For Launching & Measuring a Remarkable CampaignThe Handy Tool Kit For Launching & Measuring a Remarkable Campaign
The Handy Tool Kit For Launching & Measuring a Remarkable Campaign
 
Burger King - Case Study Review
 Burger King - Case Study Review Burger King - Case Study Review
Burger King - Case Study Review
 
Unicef branding toolkit
Unicef branding toolkitUnicef branding toolkit
Unicef branding toolkit
 
Presentation on burger king
Presentation on burger kingPresentation on burger king
Presentation on burger king
 
Local Store Marketing Presentation
Local Store Marketing PresentationLocal Store Marketing Presentation
Local Store Marketing Presentation
 
BCG matrix with example
BCG matrix with exampleBCG matrix with example
BCG matrix with example
 

Similar a Has MySQL grown up?

Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability TutorialBest practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability TutorialColin Charles
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityColin Charles
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...NETWAYS
 
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...Insight Technology, Inc.
 
Replication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party ExtinctionReplication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party ExtinctionBen Mildren
 
Drupal Con My Sql Ha 2008 08 29
Drupal Con My Sql Ha 2008 08 29Drupal Con My Sql Ha 2008 08 29
Drupal Con My Sql Ha 2008 08 29liufabin 66688
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?DATAVERSITY
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerkuchinskaya
 
MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931Baruch Osoveskiy
 
Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMariaDB plc
 
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?Sveta Smirnova
 
Introduction to TokuDB v7.5 and Read Free Replication
Introduction to TokuDB v7.5 and Read Free ReplicationIntroduction to TokuDB v7.5 and Read Free Replication
Introduction to TokuDB v7.5 and Read Free ReplicationTim Callaghan
 
Easy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and TroubleshootingEasy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and TroubleshootingBob Burgess
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deploymentYoshinori Matsunobu
 
Download presentation
Download presentationDownload presentation
Download presentationRachit Gaur
 
Download presentation531
Download presentation531Download presentation531
Download presentation531Indra Pratap
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High AvailabilityColin Charles
 

Similar a Has MySQL grown up? (20)

Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability TutorialBest practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
 
MySQL highav Availability
MySQL highav AvailabilityMySQL highav Availability
MySQL highav Availability
 
Why MariaDB?
Why MariaDB?Why MariaDB?
Why MariaDB?
 
mtl_rubykaigi
mtl_rubykaigimtl_rubykaigi
mtl_rubykaigi
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
 
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
 
Replication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party ExtinctionReplication features, technologies and 3rd party Extinction
Replication features, technologies and 3rd party Extinction
 
Drupal Con My Sql Ha 2008 08 29
Drupal Con My Sql Ha 2008 08 29Drupal Con My Sql Ha 2008 08 29
Drupal Con My Sql Ha 2008 08 29
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemaker
 
MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931
 
Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at Facebook
 
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
 
Introduction to TokuDB v7.5 and Read Free Replication
Introduction to TokuDB v7.5 and Read Free ReplicationIntroduction to TokuDB v7.5 and Read Free Replication
Introduction to TokuDB v7.5 and Read Free Replication
 
Easy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and TroubleshootingEasy MySQL Replication Setup and Troubleshooting
Easy MySQL Replication Setup and Troubleshooting
 
MyRocks introduction and production deployment
MyRocks introduction and production deploymentMyRocks introduction and production deployment
MyRocks introduction and production deployment
 
Download presentation
Download presentationDownload presentation
Download presentation
 
Download presentation531
Download presentation531Download presentation531
Download presentation531
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 

Último

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Último (20)

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Has MySQL grown up?

  • 1. Has MySQL Grown Up? Mark Stanton grude
  • 3. A brief history 1995 Named after Monty’s daughter (My) 2000 Open sourced 2001 3.23 2003 4.0 2005 5.0 Oracle buys the company behind InnoDB 2006 MySQL hits 33% market share, Oracle tries to buy 2008 5.1 Sun acquires MySQL for $1 billion, Monty leaves 2010 5.5 Oracle buys Sun for $7.4 billion
  • 4. Where are we now? • MySQL is growing up • Oracle are showing love • Facebook, Google & others are contributing • Make sure you are running: • 5.5 • recent version of 5.1
  • 5. The wonderful world of Storage Engines
  • 6. Storage Engines • Storage engines are pluggable table types • You can have multiple storage engines within each a DB • Transparent to clients (mostly) MyISAM InnoDB
  • 7. MyISAM • Simple, light weight • File based • FULLTEXT indexes • Table level locking
  • 8. InnoDB • ACID compliant • Hot backup • Crash safe • Active development • Foreign keys • Optimised for multi-core • Row-level locking • Default from 5.5 on • Table compression • No FULLTEXT (until 5.6)
  • 9. NDB - MySQL Cluster • High Availability • Tables clustered across nodes • Auto fail & recover • Auto partitioning • No FK, limited transactions • Poor multi-table joins • Pretends to be MySQL, really whole other product
  • 10. Other Storage Engines • MERGE • MEMORY • BLACKHOLE • CSV ( ) CREATE TABLE export ENGINE=CSV SELECT foo, bar FROM table
  • 11. Storage Engines: Conclusion • InnoDB is the new default & new direction • MyISAM is the past • If you are still on MyISAM, think of moving • NDB is very interesting for special cases
  • 13. Why Replicate? • Scale out • High availability • Geographic • Backup • Analytics / Business Intelligence
  • 14. Under the Hood: Logs IO Thread Step 2 Step 3 SQL Thread Step 1 Step 4
  • 15. Under the Hood: Format • Statement: UPDATE table.. • Records 1100101100111
  • 16. Under the Hood: Semi-sync Step 1 Step 1 Step 1 Step 2
  • 17. Configuration: Master-Slave • Master my.cnf: server-id = 10 log-bin=mysql-M1-bin • Master DB: mysql> CREATE USER 'repl'; Name Server-Id Port mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'; M1 10 3310 • Slave my.cnf: server-id = 11 M1-S1 11 3311 • Slave DB: mysql> CHANGE MASTER TO MASTER_HOST='localhost', MASTER_PORT=3310, MASTER_USER='repl';
  • 18. SHOW SLAVE STATUS mysql> show slave status G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Server_Id: 10 Master_Host: localhost Master_Port: 3310 Master_User: repl Master_Log_File: mysql-M1-bin.000017 Read_Master_Log_Pos: 107 Exec_Master_Log_Pos: 107 Slave_IO_Running: Yes Slave_SQL_Running: Yes Last_Errno: 0 Last_Error: Seconds_Behind_Master: 0 Master_Server_Id: 10
  • 20. Multi-Master M1 M2 M1#S1 M2#S1
  • 21. Why Multi-Master? • Active/Passive sites • High Availability • Geographically dispersed writes
  • 22. Multi-Master: Considerations Multi-Master replication needs at least one of: • Conflict Avoidance • Conflict Resolution • Hope
  • 23. Multi-Master: Considerations • Conflict Avoidance • UUIDs • Auto increment hacks = 2 auto_increment_increment auto_increment_offset = 1 • Semi-sync • Active/Passive • Ticket server
  • 24. Multi-Master: Considerations • Conflict Resolution • Cluster/NDB • Galera • or roll your own...
  • 25. Configuration: Multi-Master Name Server-Id Port M1 10 3310 M1-S1 11 3311 M2 20 3320 M1 M2 M2-S1 21 3321 • M2 as slave of M1 • M1 as slave of M2 • M2-S1 as slave of M2 M1#S1 M2#S1
  • 26. Review of Topologies Master Master Master Master Master Master Slave Slave Slave Slave Master Slave Master Master Mul)* Mul)* Mul$% Slaves Slaves Slaves
  • 27. Connector/J • MySQL’s Connector/J supports: • Failover • Load Balancing • (Replication)
  • 28. JDBC Connection Syntax jdbc:mysql://hostname:port/dbname ?property=value jdbc:mysql://localhost:3306/test?username=root
  • 31. Warning • Failover doesn’t attempt to be transparent • ColdFusion doesn’t allow you full control • Check/upgrade your Connector/J version • Set connectionTimeout, socketTimeout and blacklistTimeout carefully
  • 32. MySQL Enterprise Monitor
  • 33. MySQL Enterprise Monitor • Heat maps • Charts • Query analyser • Replication status • Configurable advisors & email alerts • Event logs
  • 34. MySQL Enterprise Monitor • Server with agents for each mysqld • Query analyser can have performance hit • Non-free
  • 35. Backing Up MySQL • Several approaches: • Copy DB files • mysqldump • binlog • Backup to slave • mysqlbackup
  • 36. Backup: File copy • Enable read lock: mysql> LOCK TABLES READ; mysql> FLUSH TABLES; • Run file copy: $ cp -R ./myDB /mybackups/myDB • Unlock tables: mysql> UNLOCK TABLES;
  • 37. Backup: mysqldump • Creates an sql script containing commands to recreate database • Run from command-line: $ mysqldump --single-transaction --all-databases > backup_sunday_1_PM.sql
  • 38. Backup: binlog • The binary log: • records statements • can be replayed from arbitrary point • need to know where to replay from • Rotate binlog mysql> FLUSH LOGS; • Then copy relevant files
  • 39. Backup: Slave • Setup dedicated slave for backup purposes • Shutdown slave • Run backup • Restart slave
  • 40. Backup: mysqlbackup • Non-free enterprise backup tool • Features: • Hot • Incremental • Compressed • Verification
  • 41. Summary of Backup Options backup to copy DB files mysqldump binlog mysqlbackup slave Lock (MyISAM) Lock (MyISAM) Hot/Read-Lock Lock Hot Hot Hot* (InnoDB) Hot (InnoDB) Incremental No No Yes No Yes InnoDB Support No Yes Yes Yes Yes Restore Speed Fast OK ** OK Fast Fast * use --single-transaction for InnoDB ** disable for autocommit/FK checks in InnoDB
  • 42. Questions? • Mark Stanton • http://blog.gruden.com • mark@gruden.com • @MarkStanto