SlideShare une entreprise Scribd logo
1  sur  73
Télécharger pour lire hors ligne
Highly Available PHP/MySQL
Applications with mysqlnd
Jervin Real
PHP-UGPH, June 2014
Highly Available Applications
• … how much your application is able to serve its end users
within a time period
Highly Available Applications
• … how much your application is able to serve its end users
within a time period
• Usually referred to as 99[..]% uptime
Highly Available Applications
• … how much your application is able to serve its end users
within a time period
• Usually referred to as 99[..]% uptime
• It actually depends on whose perspective
Highly Available Applications
Keep PHP<>MySQL downtime to a minimum
WTF are you saying? I’m a “devloper"!
No no no no no no!
Lack of knowledge
Limited resources
How?
MySQL
MySQL HA
• MySQL Native Replication (Single Primary)
MySQL HA
• MySQL Native Replication (Single Primary)
• MySQL Native Replication (Multi-Master)
MySQL HA
• MySQL Native Replication (Single Primary)
• MySQL Native Replication (Multi-Master)
• MySQL NDB Cluster
MySQL HA
• MySQL Native Replication (Single Primary)
• MySQL Native Replication (Multi-Master)
• MySQL NDB Cluster
• Galera based
MySQL HA
• MySQL Native Replication (Single Primary)
• MySQL Native Replication (Multi-Master)
• MySQL NDB Cluster
• Galera based
• Percona XtraDB Cluster
• MariaDB Galera Cluster
• MySQL+Galera
MySQL HA
• MySQL Native Replication (Single Primary)
• MySQL Native Replication (Multi-Master)
• MySQL NDB Cluster
• Galera based
• Percona XtraDB Cluster
• MariaDB Galera Cluster
• MySQL+Galera
• Tungsten Replicator
MySQL HA
• MySQL Native Replication (Single Primary)
• MySQL Native Replication (Multi-Master)
• MySQL NDB Cluster
• Galera based
• Percona XtraDB Cluster
• MariaDB Galera Cluster
• MySQL+Galera
• Tungsten Replicator
• … and many more
• MySQL Master HA
MySQL HA (External Support)
MySQL HA (External Support)
• MySQL Master HA
• Percona Replication Manager (Pacemaker)
MySQL HA (External Support)
• MySQL Master HA
• Percona Replication Manager (Pacemaker)
• Haproxy
MySQL HA (External Support)
• MySQL Master HA
• Percona Replication Manager (Pacemaker)
• Haproxy
• Load Balancers
MySQL HA (External Support)
• MySQL Master HA
• Percona Replication Manager (Pacemaker)
• Haproxy
• Load Balancers
• MySQL Multi Master
MySQL HA (External Support)
• MySQL Master HA
• Percona Replication Manager (Pacemaker)
• Haproxy
• Load Balancers
• MySQL Multi Master
PHP (Application)
HA via Application
• Traditionally complex to implement
• Unnecessary overhead
• No single point of failure
mysqlnd
mysqlnd
• MySQL Native Driver
mysqlnd
• MySQL Native Driver
• Written C (as all extensions should be!)
mysqlnd
• MySQL Native Driver
• Written C (as all extensions should be!)
• MySQL Client Libraries no more
mysqlnd
• MySQL Native Driver
• Written C (as all extensions should be!)
• MySQL Client Libraries no more
• Smaller memory footprint in many cases
mysqlnd
• MySQL Native Driver
• Written C (as all extensions should be!)
• MySQL Client Libraries no more
• Smaller memory footprint in many cases
• Performance statistics
mysqlnd
• MySQL Native Driver
• Written C (as all extensions should be!)
• MySQL Client Libraries no more
• Smaller memory footprint in many cases
• Performance statistics
• Compression
mysqlnd
• MySQL Native Driver
• Written C (as all extensions should be!)
• MySQL Client Libraries no more
• Smaller memory footprint in many cases
• Performance statistics
• Compression
• Plugins
mysqlnd Plugins
• mysqlnd_qc - query result cache
mysqlnd Plugins
• mysqlnd_qc - query result cache
• mysqlnd_mux - connection multiplexing
mysqlnd Plugins
• mysqlnd_qc - query result cache
• mysqlnd_mux - connection multiplexing
• mysqlnd_uh - user handler
mysqlnd Plugins
• mysqlnd_qc - query result cache
• mysqlnd_mux - connection multiplexing
• mysqlnd_uh - user handler
• mysqlnd_memcache - Memcache (MySQL interface)
mysqlnd Plugins
• mysqlnd_qc - query result cache
• mysqlnd_mux - connection multiplexing
• mysqlnd_uh - user handler
• mysqlnd_memcache - Memcache (MySQL interface)
• mysqlnd_ms - replication and load balancing
mysqlnd_ms
mysqlnd_ms Supported Clusters
• All previously mentioned with few limitations
Limitations (Master-Slave)
• Master is a single point of failure
• Need external help for failover
• . . or, shoot the other node in the foot, this is still HA!
Limitations (Master-Slave)
Limitations (Master-Slave)
Limitations (Master-Slave)
Limitations (Master-Master)
• Risky, even if you try segregating writes per master you
can still lose data
Limitations (Master-Master)
db1
db1
Limitations (Master-Master)
db1
db1
Limitations (Master-Master)
db2
db1
Limitations (Master-Master)
db1 + db2
• Not good if sync_binlog = 0 AND/OR innodb_flush_log_at_trx_commit <> 1
• Not really recommended in general, use appropriate technologies
instead
Some More Limitations
• Lazy connections is on by default
• Each request will create its own connections when needed,
persistent connections may be required
• https://bugs.php.net/bug.php?id=67564
• https://bugs.php.net/bug.php?id=67565
• https://bugs.php.net/bug.php?id=67574
• Be careful with multi-statements and read-write splitting,
they are likely to be executed on slave!
SELECT  *  FROM  tbl;  DELETE  FROM  tbl;
• Single Primary - one writable node
• Multiple Primary - all nodes writable
mysqlnd_ms Supported Clusters
• Master-Slave
mysqlnd_ms Supported Clusters
• Master-Slave
• Declare 2 clusters
mysqlnd_ms Supported Clusters
• Master-Slave
• Declare 2 clusters
• When primary fails, mark it permanently dead and switch
to secondary
mysqlnd_ms Supported Clusters
• Master-Slave
• Declare 2 clusters
• When primary fails, mark
it permanently dead and
switch to secondary
{  
    "primary":  {  
        "master":  {  
            "master_1":  {  
                "host":  "127.0.0.1",  
                "port":  33001  
            }  
        },  
        "slave":  {  
            "slave_0":  {  
                "host":  "127.0.0.1",  
                "port":  33002  
            }  
        }  
    },  
    "standby":  {  
        "master":  {  
            "master_1":  {  
                "host":  "127.0.0.1",  
                "port":  33002  
            }  
        },  
        "slave":  {  
        }  
    }  
}
mysqlnd_ms Supported Clusters
• Master-Slave
• Declare 2 clusters
• When primary fails, mark
it permanently dead and
switch to secondary
• Works better with
master-master!
{  
    "primary":  {  
        "master":  {  
            "master_1":  {  
                "host":  "127.0.0.1",  
                "port":  33001  
            }  
        },  
        "slave":  {  
            "slave_0":  {  
                "host":  "127.0.0.1",  
                "port":  33002  
            }  
        }  
    },  
    "standby":  {  
        "master":  {  
            "master_1":  {  
                "host":  "127.0.0.1",  
                "port":  33002  
            }  
        },  
        "slave":  {  
        }  
    }  
}
mysqlnd_ms Supported Clusters
• Master-Slave Demo
• https://github.com/dotmanila/demo-me/phpugph201407/
• master-slave.ini
• mysqlnd_ms_ms.ini
• master-slave.php
mysqlnd_ms Supported Clusters
• Multi-Masters (NDB, Galera)
• Declare all nodes as masters
mysqlnd_ms Supported Clusters
• Multi-Masters (NDB, Galera)
mysqlnd_ms Supported Clusters
• Multi-Masters (NDB,
Galera)
• Declare all nodes as
masters
mysqlnd_ms Supported Clusters
  {  
      "primary":  {  
          "master":  {  
              "master_1":  {  
                  "host":  "192.168.56.44",  
                  "port":  "3306"  
              },  
              "master_2":  {  
                  "host":  "192.168.56.43",  
                  "port":  "3306"  
              },  
              "master_3":  {  
                  "host":  "192.168.56.42",  
                  "port":  "3306"  
              }  
          },  
          "slave":  {  },  
          "filters":  {  "random":  [  ]  },  
          "failover":  {    
              "strategy":  "loop_before_master",    
              "remember_failed":  true    
          }  
      }  
  }
• Multi-Masters (NDB,
Galera)
mysqlnd_ms Supported Clusters
  {  
      "primary":  {  
          "master":  {  
              "master_1":  {  
                  "host":  "192.168.56.44",  
                  "port":  "3306"  
              },  
              "master_2":  {  
                  "host":  "192.168.56.43",  
                  "port":  "3306"  
              },  
              "master_3":  {  
                  "host":  "192.168.56.42",  
                  "port":  "3306"  
              }  
          },  
          "slave":  {  },  
          "filters":  {  "random":  [  ]  },  
          "failover":  {    
              "strategy":  "loop_before_master",    
              "remember_failed":  true    
          }  
      }  
  }
• Multi-Masters (NDB,
Galera)
• Declare all nodes as
masters
• roundrobin - single node
writer (first node in
config)
mysqlnd_ms Supported Clusters
  {  
      "primary":  {  
          "master":  {  
              "master_1":  {  
                  "host":  "192.168.56.44",  
                  "port":  "3306"  
              },  
              "master_2":  {  
                  "host":  "192.168.56.43",  
                  "port":  "3306"  
              },  
              "master_3":  {  
                  "host":  "192.168.56.42",  
                  "port":  "3306"  
              }  
          },  
          "slave":  {  },  
          "filters":  {  "random":  [  ]  },  
          "failover":  {    
              "strategy":  "loop_before_master",    
              "remember_failed":  true    
          }  
      }  
  }
• Multi-Masters (NDB,
Galera)
• Declare all nodes as
masters
• roundrobin - single node
writer (first node in
config)
• random - all nodes
mysqlnd_ms Supported Clusters
  {  
      "primary":  {  
          "master":  {  
              "master_1":  {  
                  "host":  "192.168.56.44",  
                  "port":  "3306"  
              },  
              "master_2":  {  
                  "host":  "192.168.56.43",  
                  "port":  "3306"  
              },  
              "master_3":  {  
                  "host":  "192.168.56.42",  
                  "port":  "3306"  
              }  
          },  
          "slave":  {  },  
          "filters":  {  "random":  [  ]  },  
          "failover":  {    
              "strategy":  "loop_before_master",    
              "remember_failed":  true    
          }  
      }  
  }
• Multi-Masters (NDB,
Galera)
• Declare all nodes as
masters
• roundrobin - single node
writer (first node in
config)
• random - all nodes
• remember_failed is not
what it says it is
  {  
      "primary":  {  
          "master":  {  
              "master_1":  {  
                  "host":  "192.168.56.44",  
                  "port":  "3306"  
              },  
              "master_2":  {  
                  "host":  "192.168.56.43",  
                  "port":  "3306"  
              },  
              "master_3":  {  
                  "host":  "192.168.56.42",  
                  "port":  "3306"  
              }  
          },  
          "slave":  {  },  
          "filters":  {  "random":  [  ]  },  
          "failover":  {    
              "strategy":  "loop_before_master",    
              "remember_failed":  true    
          }  
      }  
  }
mysqlnd_ms Supported Clusters
• Master-Master Demo
• https://github.com/dotmanila/demo-me/phpugph201407/
• master-master.ini
• mysqlnd_ms_mm.ini
• master-master.php
mysqlnd_ms Supported Clusters
Am I Using mysqlnd? (rpm)
[revin@forge  ~]$  rpm  -­‐q  php-­‐mysql.x86_64  -­‐-­‐requires  
[…]  
libmysqlclient_r.so.16()(64bit)  
libmysqlclient_r.so.16(libmysqlclient_16)(64bit)  
libmysqlclient.so.16()(64bit)  
libmysqlclient.so.16(libmysqlclient_16)(64bit)  
[…]
[revin@forge  ~]$  rpm  -­‐q  php-­‐mysqlnd.x86_64  -­‐-­‐requires  
php-­‐pdo(x86-­‐64)  =  5.4.30-­‐36.el6.art  
rpmlib(VersionedDependencies)  <=  3.0.3-­‐1  
rpmlib(FileDigests)  <=  4.6.0-­‐1  
rpmlib(PayloadFilesHavePrefix)  <=  4.0-­‐1  
rpmlib(CompressedFileNames)  <=  3.0.4-­‐1  
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libpthread.so.0()(64bit)  
libpthread.so.0(GLIBC_2.2.5)(64bit)  
rtld(GNU_HASH)  
rpmlib(PayloadIsXz)  <=  5.2-­‐1
Am I Using mysqlnd? (rpm)
[revin@forge  ~]$  php  -­‐i  
[…]  
!
mysql  
!
MySQL  Support  =>  enabled  
Active  Persistent  Links  =>  0  
Active  Links  =>  0  
Client  API  version  =>  5.1.59  
MYSQL_MODULE_TYPE  =>  external  
MYSQL_SOCKET  =>  /var/lib/mysql/mysql.sock  
MYSQL_INCLUDE  =>  -­‐I/usr/include/mysql  
MYSQL_LIBS  =>  -­‐L/usr/lib64/mysql  -­‐lmysqlclient
Am I Using mysqlnd? (phpinfo)
[revin@forge  ~]$  php  -­‐i  
[…]  
!
mysqlnd  
!
mysqlnd  =>  enabled  
Version  =>  mysqlnd  5.0.10  -­‐  20111026  -­‐  $Id:  c85105d7c6f7d70d609bb4c000257868a40840ab  $  
Compression  =>  supported  
SSL  =>  supported  
Command  buffer  size  =>  4096  
Read  buffer  size  =>  32768  
Read  timeout  =>  31536000  
Collecting  statistics  =>  Yes  
Collecting  memory  statistics  =>  No  
Tracing  =>  n/a  
Loaded  plugins  =>  mysqlnd,example,debug_trace,  
   auth_plugin_mysql_native_password,  
   auth_plugin_mysql_clear_password  
API  Extensions  =>  mysql,mysqli,pdo_mysql
Am I Using mysqlnd? (phpinfo)
Conclusion
• Yes, we can achieve HA with mysqlnd_ms
• Not for the faint of heart
• Do not rely on for HA (writes) on critical production
systems
• Good for intended use case, rw-splitting
Q&A
• http://dotmanila.com/blog/
• http://www.mysqlperformanceblog.com/
• @dotmanila
Percona is Hiring!!
http://www.percona.com/about-us/careers/open-positions
$t  =  true  AND  false;  echo  (int)  $t;

Contenu connexe

Tendances

Built-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIsBuilt-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIsUlf Wendel
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High AvailabilityColin Charles
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQLUlf Wendel
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera ClusterAbdul Manaf
 
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4Ulf Wendel
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Marco Tusa
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave databaseWipro
 
DIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL ClusterDIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL ClusterUlf Wendel
 
MySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: FailoverMySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: FailoverUlf Wendel
 
The mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing pluginThe mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing pluginUlf Wendel
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationKenny Gryp
 
The PHP mysqlnd plugin talk - plugins an alternative to MySQL Proxy
The PHP mysqlnd plugin talk - plugins an alternative to MySQL ProxyThe PHP mysqlnd plugin talk - plugins an alternative to MySQL Proxy
The PHP mysqlnd plugin talk - plugins an alternative to MySQL ProxyUlf Wendel
 
PoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HAPoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HAUlf Wendel
 
Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Chris Barber
 
MySQL Multi Master Replication
MySQL Multi Master ReplicationMySQL Multi Master Replication
MySQL Multi Master ReplicationMoshe Kaplan
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
Codership's galera cluster installation and quickstart webinar march 2016
Codership's galera cluster installation and quickstart webinar march 2016Codership's galera cluster installation and quickstart webinar march 2016
Codership's galera cluster installation and quickstart webinar march 2016Sakari Keskitalo
 
Automate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with AnsibleAutomate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with AnsibleFederico Razzoli
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Henrik Ingo
 

Tendances (20)

Built-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIsBuilt-in query caching for all PHP MySQL extensions/APIs
Built-in query caching for all PHP MySQL extensions/APIs
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQL
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
 
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
 
DIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL ClusterDIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL Cluster
 
MySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: FailoverMySQL 5.6 Global Transaction Identifier - Use case: Failover
MySQL 5.6 Global Transaction Identifier - Use case: Failover
 
The mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing pluginThe mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing plugin
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
 
The PHP mysqlnd plugin talk - plugins an alternative to MySQL Proxy
The PHP mysqlnd plugin talk - plugins an alternative to MySQL ProxyThe PHP mysqlnd plugin talk - plugins an alternative to MySQL Proxy
The PHP mysqlnd plugin talk - plugins an alternative to MySQL Proxy
 
PoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HAPoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HA
 
Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)Intro to PECL/mysqlnd_ms (4/7/2011)
Intro to PECL/mysqlnd_ms (4/7/2011)
 
MySQL Multi Master Replication
MySQL Multi Master ReplicationMySQL Multi Master Replication
MySQL Multi Master Replication
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
Codership's galera cluster installation and quickstart webinar march 2016
Codership's galera cluster installation and quickstart webinar march 2016Codership's galera cluster installation and quickstart webinar march 2016
Codership's galera cluster installation and quickstart webinar march 2016
 
Automate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with AnsibleAutomate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with Ansible
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011
 

Similaire à Highly Available MySQL/PHP Applications with mysqlnd

MySQL HA with Pacemaker
MySQL HA with  PacemakerMySQL HA with  Pacemaker
MySQL HA with PacemakerKris Buytaert
 
Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with PacemakerKris Buytaert
 
M|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real WorldM|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real WorldMariaDB plc
 
Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with PacemakerKris Buytaert
 
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...NETWAYS
 
2013 london advanced-replication
2013 london advanced-replication2013 london advanced-replication
2013 london advanced-replicationMarc Schwering
 
Replication MongoDB Days 2013
Replication MongoDB Days 2013Replication MongoDB Days 2013
Replication MongoDB Days 2013Randall Hunt
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)Night Sailer
 
Make Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMake Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMySQLConference
 
Designing enterprise drupal
Designing enterprise drupalDesigning enterprise drupal
Designing enterprise drupalJason Burnett
 
MySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployerMySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployerGiuseppe Maxia
 
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...MongoDB
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesLenz Grimmer
 
Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudRevolution Analytics
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbMongoDB APAC
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsServer Density
 

Similaire à Highly Available MySQL/PHP Applications with mysqlnd (20)

MySQL HA with Pacemaker
MySQL HA with  PacemakerMySQL HA with  Pacemaker
MySQL HA with Pacemaker
 
Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with Pacemaker
 
M|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real WorldM|18 Writing Stored Procedures in the Real World
M|18 Writing Stored Procedures in the Real World
 
Linux-HA with Pacemaker
Linux-HA with PacemakerLinux-HA with Pacemaker
Linux-HA with Pacemaker
 
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
 
2013 london advanced-replication
2013 london advanced-replication2013 london advanced-replication
2013 london advanced-replication
 
Replication MongoDB Days 2013
Replication MongoDB Days 2013Replication MongoDB Days 2013
Replication MongoDB Days 2013
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)
 
Make Your Life Easier With Maatkit
Make Your Life Easier With MaatkitMake Your Life Easier With Maatkit
Make Your Life Easier With Maatkit
 
Mysqlnd uh
Mysqlnd uhMysqlnd uh
Mysqlnd uh
 
Designing enterprise drupal
Designing enterprise drupalDesigning enterprise drupal
Designing enterprise drupal
 
MySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployerMySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployer
 
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
Ensuring High Availability for Real-time Analytics featuring Boxed Ice / Serv...
 
MySQL Backup and Security Best Practices
MySQL Backup and Security Best PracticesMySQL Backup and Security Best Practices
MySQL Backup and Security Best Practices
 
Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the Cloud
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
 
Mongo scaling
Mongo scalingMongo scaling
Mongo scaling
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & Analytics
 

Plus de Jervin Real

Low Cost Transactional and Analytics with MySQL + Clickhouse
 Low Cost Transactional and Analytics with MySQL + Clickhouse Low Cost Transactional and Analytics with MySQL + Clickhouse
Low Cost Transactional and Analytics with MySQL + ClickhouseJervin Real
 
Low Cost Transactional and Analytics with MySQL + Clickhouse
Low Cost Transactional and Analytics with MySQL + ClickhouseLow Cost Transactional and Analytics with MySQL + Clickhouse
Low Cost Transactional and Analytics with MySQL + ClickhouseJervin Real
 
ZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet SpotsZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet SpotsJervin Real
 
Lock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data GuaranteedLock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data GuaranteedJervin Real
 
Learning MySQL 5.7
Learning MySQL 5.7Learning MySQL 5.7
Learning MySQL 5.7Jervin Real
 
Heterogenous Persistence
Heterogenous PersistenceHeterogenous Persistence
Heterogenous PersistenceJervin Real
 
Preventing and Resolving MySQL Downtime
Preventing and Resolving MySQL DowntimePreventing and Resolving MySQL Downtime
Preventing and Resolving MySQL DowntimeJervin Real
 
TokuDB - What You Need to Know
TokuDB - What You Need to KnowTokuDB - What You Need to Know
TokuDB - What You Need to KnowJervin Real
 
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupPLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupJervin Real
 
Learning by Experience, Devploying pyxbackup
Learning by Experience, Devploying pyxbackupLearning by Experience, Devploying pyxbackup
Learning by Experience, Devploying pyxbackupJervin Real
 
AWS Users Meetup April 2015
AWS Users Meetup April 2015AWS Users Meetup April 2015
AWS Users Meetup April 2015Jervin Real
 
High Performance Rails with MySQL
High Performance Rails with MySQLHigh Performance Rails with MySQL
High Performance Rails with MySQLJervin Real
 

Plus de Jervin Real (12)

Low Cost Transactional and Analytics with MySQL + Clickhouse
 Low Cost Transactional and Analytics with MySQL + Clickhouse Low Cost Transactional and Analytics with MySQL + Clickhouse
Low Cost Transactional and Analytics with MySQL + Clickhouse
 
Low Cost Transactional and Analytics with MySQL + Clickhouse
Low Cost Transactional and Analytics with MySQL + ClickhouseLow Cost Transactional and Analytics with MySQL + Clickhouse
Low Cost Transactional and Analytics with MySQL + Clickhouse
 
ZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet SpotsZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet Spots
 
Lock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data GuaranteedLock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data Guaranteed
 
Learning MySQL 5.7
Learning MySQL 5.7Learning MySQL 5.7
Learning MySQL 5.7
 
Heterogenous Persistence
Heterogenous PersistenceHeterogenous Persistence
Heterogenous Persistence
 
Preventing and Resolving MySQL Downtime
Preventing and Resolving MySQL DowntimePreventing and Resolving MySQL Downtime
Preventing and Resolving MySQL Downtime
 
TokuDB - What You Need to Know
TokuDB - What You Need to KnowTokuDB - What You Need to Know
TokuDB - What You Need to Know
 
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupPLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
 
Learning by Experience, Devploying pyxbackup
Learning by Experience, Devploying pyxbackupLearning by Experience, Devploying pyxbackup
Learning by Experience, Devploying pyxbackup
 
AWS Users Meetup April 2015
AWS Users Meetup April 2015AWS Users Meetup April 2015
AWS Users Meetup April 2015
 
High Performance Rails with MySQL
High Performance Rails with MySQLHigh Performance Rails with MySQL
High Performance Rails with MySQL
 

Dernier

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Dernier (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Highly Available MySQL/PHP Applications with mysqlnd

  • 1. Highly Available PHP/MySQL Applications with mysqlnd Jervin Real PHP-UGPH, June 2014
  • 2. Highly Available Applications • … how much your application is able to serve its end users within a time period
  • 3. Highly Available Applications • … how much your application is able to serve its end users within a time period • Usually referred to as 99[..]% uptime
  • 4. Highly Available Applications • … how much your application is able to serve its end users within a time period • Usually referred to as 99[..]% uptime • It actually depends on whose perspective
  • 5. Highly Available Applications Keep PHP<>MySQL downtime to a minimum
  • 6. WTF are you saying? I’m a “devloper"! No no no no no no!
  • 10. MySQL
  • 11. MySQL HA • MySQL Native Replication (Single Primary)
  • 12. MySQL HA • MySQL Native Replication (Single Primary) • MySQL Native Replication (Multi-Master)
  • 13. MySQL HA • MySQL Native Replication (Single Primary) • MySQL Native Replication (Multi-Master) • MySQL NDB Cluster
  • 14. MySQL HA • MySQL Native Replication (Single Primary) • MySQL Native Replication (Multi-Master) • MySQL NDB Cluster • Galera based
  • 15. MySQL HA • MySQL Native Replication (Single Primary) • MySQL Native Replication (Multi-Master) • MySQL NDB Cluster • Galera based • Percona XtraDB Cluster • MariaDB Galera Cluster • MySQL+Galera
  • 16. MySQL HA • MySQL Native Replication (Single Primary) • MySQL Native Replication (Multi-Master) • MySQL NDB Cluster • Galera based • Percona XtraDB Cluster • MariaDB Galera Cluster • MySQL+Galera • Tungsten Replicator
  • 17. MySQL HA • MySQL Native Replication (Single Primary) • MySQL Native Replication (Multi-Master) • MySQL NDB Cluster • Galera based • Percona XtraDB Cluster • MariaDB Galera Cluster • MySQL+Galera • Tungsten Replicator • … and many more
  • 18. • MySQL Master HA MySQL HA (External Support)
  • 19. MySQL HA (External Support) • MySQL Master HA • Percona Replication Manager (Pacemaker)
  • 20. MySQL HA (External Support) • MySQL Master HA • Percona Replication Manager (Pacemaker) • Haproxy
  • 21. MySQL HA (External Support) • MySQL Master HA • Percona Replication Manager (Pacemaker) • Haproxy • Load Balancers
  • 22. MySQL HA (External Support) • MySQL Master HA • Percona Replication Manager (Pacemaker) • Haproxy • Load Balancers • MySQL Multi Master
  • 23. MySQL HA (External Support) • MySQL Master HA • Percona Replication Manager (Pacemaker) • Haproxy • Load Balancers • MySQL Multi Master
  • 25. HA via Application • Traditionally complex to implement • Unnecessary overhead • No single point of failure
  • 28. mysqlnd • MySQL Native Driver • Written C (as all extensions should be!)
  • 29. mysqlnd • MySQL Native Driver • Written C (as all extensions should be!) • MySQL Client Libraries no more
  • 30. mysqlnd • MySQL Native Driver • Written C (as all extensions should be!) • MySQL Client Libraries no more • Smaller memory footprint in many cases
  • 31. mysqlnd • MySQL Native Driver • Written C (as all extensions should be!) • MySQL Client Libraries no more • Smaller memory footprint in many cases • Performance statistics
  • 32. mysqlnd • MySQL Native Driver • Written C (as all extensions should be!) • MySQL Client Libraries no more • Smaller memory footprint in many cases • Performance statistics • Compression
  • 33. mysqlnd • MySQL Native Driver • Written C (as all extensions should be!) • MySQL Client Libraries no more • Smaller memory footprint in many cases • Performance statistics • Compression • Plugins
  • 34. mysqlnd Plugins • mysqlnd_qc - query result cache
  • 35. mysqlnd Plugins • mysqlnd_qc - query result cache • mysqlnd_mux - connection multiplexing
  • 36. mysqlnd Plugins • mysqlnd_qc - query result cache • mysqlnd_mux - connection multiplexing • mysqlnd_uh - user handler
  • 37. mysqlnd Plugins • mysqlnd_qc - query result cache • mysqlnd_mux - connection multiplexing • mysqlnd_uh - user handler • mysqlnd_memcache - Memcache (MySQL interface)
  • 38. mysqlnd Plugins • mysqlnd_qc - query result cache • mysqlnd_mux - connection multiplexing • mysqlnd_uh - user handler • mysqlnd_memcache - Memcache (MySQL interface) • mysqlnd_ms - replication and load balancing
  • 40. mysqlnd_ms Supported Clusters • All previously mentioned with few limitations
  • 41. Limitations (Master-Slave) • Master is a single point of failure • Need external help for failover • . . or, shoot the other node in the foot, this is still HA!
  • 45. Limitations (Master-Master) • Risky, even if you try segregating writes per master you can still lose data
  • 49. Limitations (Master-Master) db1 + db2 • Not good if sync_binlog = 0 AND/OR innodb_flush_log_at_trx_commit <> 1 • Not really recommended in general, use appropriate technologies instead
  • 50. Some More Limitations • Lazy connections is on by default • Each request will create its own connections when needed, persistent connections may be required • https://bugs.php.net/bug.php?id=67564 • https://bugs.php.net/bug.php?id=67565 • https://bugs.php.net/bug.php?id=67574 • Be careful with multi-statements and read-write splitting, they are likely to be executed on slave! SELECT  *  FROM  tbl;  DELETE  FROM  tbl;
  • 51. • Single Primary - one writable node • Multiple Primary - all nodes writable mysqlnd_ms Supported Clusters
  • 53. • Master-Slave • Declare 2 clusters mysqlnd_ms Supported Clusters
  • 54. • Master-Slave • Declare 2 clusters • When primary fails, mark it permanently dead and switch to secondary mysqlnd_ms Supported Clusters
  • 55. • Master-Slave • Declare 2 clusters • When primary fails, mark it permanently dead and switch to secondary {      "primary":  {          "master":  {              "master_1":  {                  "host":  "127.0.0.1",                  "port":  33001              }          },          "slave":  {              "slave_0":  {                  "host":  "127.0.0.1",                  "port":  33002              }          }      },      "standby":  {          "master":  {              "master_1":  {                  "host":  "127.0.0.1",                  "port":  33002              }          },          "slave":  {          }      }   } mysqlnd_ms Supported Clusters
  • 56. • Master-Slave • Declare 2 clusters • When primary fails, mark it permanently dead and switch to secondary • Works better with master-master! {      "primary":  {          "master":  {              "master_1":  {                  "host":  "127.0.0.1",                  "port":  33001              }          },          "slave":  {              "slave_0":  {                  "host":  "127.0.0.1",                  "port":  33002              }          }      },      "standby":  {          "master":  {              "master_1":  {                  "host":  "127.0.0.1",                  "port":  33002              }          },          "slave":  {          }      }   } mysqlnd_ms Supported Clusters
  • 57. • Master-Slave Demo • https://github.com/dotmanila/demo-me/phpugph201407/ • master-slave.ini • mysqlnd_ms_ms.ini • master-slave.php mysqlnd_ms Supported Clusters
  • 58. • Multi-Masters (NDB, Galera) • Declare all nodes as masters mysqlnd_ms Supported Clusters
  • 59. • Multi-Masters (NDB, Galera) mysqlnd_ms Supported Clusters
  • 60. • Multi-Masters (NDB, Galera) • Declare all nodes as masters mysqlnd_ms Supported Clusters  {        "primary":  {            "master":  {                "master_1":  {                    "host":  "192.168.56.44",                    "port":  "3306"                },                "master_2":  {                    "host":  "192.168.56.43",                    "port":  "3306"                },                "master_3":  {                    "host":  "192.168.56.42",                    "port":  "3306"                }            },            "slave":  {  },            "filters":  {  "random":  [  ]  },            "failover":  {                  "strategy":  "loop_before_master",                  "remember_failed":  true              }        }    }
  • 61. • Multi-Masters (NDB, Galera) mysqlnd_ms Supported Clusters  {        "primary":  {            "master":  {                "master_1":  {                    "host":  "192.168.56.44",                    "port":  "3306"                },                "master_2":  {                    "host":  "192.168.56.43",                    "port":  "3306"                },                "master_3":  {                    "host":  "192.168.56.42",                    "port":  "3306"                }            },            "slave":  {  },            "filters":  {  "random":  [  ]  },            "failover":  {                  "strategy":  "loop_before_master",                  "remember_failed":  true              }        }    }
  • 62. • Multi-Masters (NDB, Galera) • Declare all nodes as masters • roundrobin - single node writer (first node in config) mysqlnd_ms Supported Clusters  {        "primary":  {            "master":  {                "master_1":  {                    "host":  "192.168.56.44",                    "port":  "3306"                },                "master_2":  {                    "host":  "192.168.56.43",                    "port":  "3306"                },                "master_3":  {                    "host":  "192.168.56.42",                    "port":  "3306"                }            },            "slave":  {  },            "filters":  {  "random":  [  ]  },            "failover":  {                  "strategy":  "loop_before_master",                  "remember_failed":  true              }        }    }
  • 63. • Multi-Masters (NDB, Galera) • Declare all nodes as masters • roundrobin - single node writer (first node in config) • random - all nodes mysqlnd_ms Supported Clusters  {        "primary":  {            "master":  {                "master_1":  {                    "host":  "192.168.56.44",                    "port":  "3306"                },                "master_2":  {                    "host":  "192.168.56.43",                    "port":  "3306"                },                "master_3":  {                    "host":  "192.168.56.42",                    "port":  "3306"                }            },            "slave":  {  },            "filters":  {  "random":  [  ]  },            "failover":  {                  "strategy":  "loop_before_master",                  "remember_failed":  true              }        }    }
  • 64. • Multi-Masters (NDB, Galera) • Declare all nodes as masters • roundrobin - single node writer (first node in config) • random - all nodes • remember_failed is not what it says it is  {        "primary":  {            "master":  {                "master_1":  {                    "host":  "192.168.56.44",                    "port":  "3306"                },                "master_2":  {                    "host":  "192.168.56.43",                    "port":  "3306"                },                "master_3":  {                    "host":  "192.168.56.42",                    "port":  "3306"                }            },            "slave":  {  },            "filters":  {  "random":  [  ]  },            "failover":  {                  "strategy":  "loop_before_master",                  "remember_failed":  true              }        }    } mysqlnd_ms Supported Clusters
  • 65. • Master-Master Demo • https://github.com/dotmanila/demo-me/phpugph201407/ • master-master.ini • mysqlnd_ms_mm.ini • master-master.php mysqlnd_ms Supported Clusters
  • 66. Am I Using mysqlnd? (rpm) [revin@forge  ~]$  rpm  -­‐q  php-­‐mysql.x86_64  -­‐-­‐requires   […]   libmysqlclient_r.so.16()(64bit)   libmysqlclient_r.so.16(libmysqlclient_16)(64bit)   libmysqlclient.so.16()(64bit)   libmysqlclient.so.16(libmysqlclient_16)(64bit)   […]
  • 67. [revin@forge  ~]$  rpm  -­‐q  php-­‐mysqlnd.x86_64  -­‐-­‐requires   php-­‐pdo(x86-­‐64)  =  5.4.30-­‐36.el6.art   rpmlib(VersionedDependencies)  <=  3.0.3-­‐1   rpmlib(FileDigests)  <=  4.6.0-­‐1   rpmlib(PayloadFilesHavePrefix)  <=  4.0-­‐1   rpmlib(CompressedFileNames)  <=  3.0.4-­‐1   libc.so.6()(64bit)   libc.so.6(GLIBC_2.2.5)(64bit)   libc.so.6(GLIBC_2.3.4)(64bit)   libc.so.6(GLIBC_2.4)(64bit)   libpthread.so.0()(64bit)   libpthread.so.0(GLIBC_2.2.5)(64bit)   rtld(GNU_HASH)   rpmlib(PayloadIsXz)  <=  5.2-­‐1 Am I Using mysqlnd? (rpm)
  • 68. [revin@forge  ~]$  php  -­‐i   […]   ! mysql   ! MySQL  Support  =>  enabled   Active  Persistent  Links  =>  0   Active  Links  =>  0   Client  API  version  =>  5.1.59   MYSQL_MODULE_TYPE  =>  external   MYSQL_SOCKET  =>  /var/lib/mysql/mysql.sock   MYSQL_INCLUDE  =>  -­‐I/usr/include/mysql   MYSQL_LIBS  =>  -­‐L/usr/lib64/mysql  -­‐lmysqlclient Am I Using mysqlnd? (phpinfo)
  • 69. [revin@forge  ~]$  php  -­‐i   […]   ! mysqlnd   ! mysqlnd  =>  enabled   Version  =>  mysqlnd  5.0.10  -­‐  20111026  -­‐  $Id:  c85105d7c6f7d70d609bb4c000257868a40840ab  $   Compression  =>  supported   SSL  =>  supported   Command  buffer  size  =>  4096   Read  buffer  size  =>  32768   Read  timeout  =>  31536000   Collecting  statistics  =>  Yes   Collecting  memory  statistics  =>  No   Tracing  =>  n/a   Loaded  plugins  =>  mysqlnd,example,debug_trace,     auth_plugin_mysql_native_password,     auth_plugin_mysql_clear_password   API  Extensions  =>  mysql,mysqli,pdo_mysql Am I Using mysqlnd? (phpinfo)
  • 70. Conclusion • Yes, we can achieve HA with mysqlnd_ms • Not for the faint of heart • Do not rely on for HA (writes) on critical production systems • Good for intended use case, rw-splitting
  • 71.
  • 72. Q&A • http://dotmanila.com/blog/ • http://www.mysqlperformanceblog.com/ • @dotmanila Percona is Hiring!! http://www.percona.com/about-us/careers/open-positions
  • 73. $t  =  true  AND  false;  echo  (int)  $t;