SlideShare a Scribd company logo
1 of 33
Download to read offline
MySQL High-Availability and
                     Scale-Out architectures



                                 Oli Sennhauser
                                  Senior Consultant
                                osennhauser@mysql.com



Copyright 2007 Oli Sennhauser                 The World’s Most Popular Open Source Database   1
Introduction

    • Who we are?
    • What we want?




Copyright 2007 Oli Sennhauser             The World’s Most Popular Open Source Database   2
Table of Contents

    •    Scale-Up vs. Scale-Out
    •    MySQL Replication
    •    MySQL HA solution
    •    MySQL Cluster
    •    Application architectural solutions
    •    Other architectural stuff
    •    It's your turn...
    •    Let us build a replication




Copyright 2007 Oli Sennhauser               The World’s Most Popular Open Source Database   3
When do we think about architecture?

    • Performance problems
    • HA requirements




Copyright 2007 Oli Sennhauser    The World’s Most Popular Open Source Database   4
Scale-up vs. Scale-Out

    • Scale-up




    • Scale-out

                                          t



                  Relaxation of constraints
Copyright 2007 Oli Sennhauser                  The World’s Most Popular Open Source Database   5
MySQL Replication

    • The MySQL answer: Master-Slave-Replication:

                                  Application                    2 types of
                                                                 sessions!!!
                                        rtw
                                    Master


                         Slave1     Slave2      Slave3                   ...

                                      LB
                                       ro

    Even Oracle uses the expression “scale-out” now!
Copyright 2007 Oli Sennhauser                   The World’s Most Popular Open Source Database   6
MySQL Replication in detail


                        Appl          ro
                     rt w                  asynchronous!
                                                                   IO thread

                           M                       S              SQL thread


      ...    bin-log        bin-log                      relay-log          relay-log




    • wide distance possible!
    • thin line possible!

Copyright 2007 Oli Sennhauser                      The World’s Most Popular Open Source Database   7
MySQL Replication varieties

    • Cascaded replication:

                                          M

                                                                              black hole
                        SI                SI         SI            ...
                                                                              SE!

     S1          S2             S3   S4        S5   S6         S7            S8 ...



    for example Yahoo!

Copyright 2007 Oli Sennhauser                        The World’s Most Popular Open Source Database   8
MySQL Replication varieties

    • HA with “hot standby” Slave:
                                     Appl

                                     VIP               HA solution


             Sbackup            M           Sstandby


                      S1        S2          S3

    • active – active fail over!

Copyright 2007 Oli Sennhauser               The World’s Most Popular Open Source Database   9
MySQL HA solution

    • HA with MySQL:
                                          Appl

                                          VIP                       heartbeat

                                      M            M'

                                          DRBD
       S1          S2           S3

    • 99.99% HA (four nine)
    • active – passive fail over!

Copyright 2007 Oli Sennhauser                    The World’s Most Popular Open Source Database   10
MySQL HA solution

    • HA with MySQL and SAN:
                                          Appl

                                          VIP                       heartbeat

                                      M            M'



                                          SAN
       S1          S2           S3



Copyright 2007 Oli Sennhauser                    The World’s Most Popular Open Source Database   11
Multi-Master Replication

    • actually Master-Master Replication
                                      Appl            Appl


                                             VIP/LB




                                      M1              M2

       S11         S12          S13                             S21          S22          S23

    • This architecture does NOT solve your write
      problems!!!
Copyright 2007 Oli Sennhauser                         The World’s Most Popular Open Source Database   12
Multi-Master Replication

    • HA Multi-Master Replication

                            Appl                             Appl
                                           VIP/LB
                                VIP                            VIP


                  M1'                 M1            M2                    M2'

                            DRBD                            DRBD




       S11         S12          S13                           S21          S22          S23

Copyright 2007 Oli Sennhauser                       The World’s Most Popular Open Source Database   13
Shared disk cluster


                           DB1        DB2        DB2

                                      ro!

                                     shared
                                      disk

    • This is in 99.9% of the cases NOT your solution!!!
    • It looks like Oracle RAC but MySQL does NOT
      (yet) have the instruments needed!
    • Can be useful in some special kinds of reporting.

Copyright 2007 Oli Sennhauser                 The World’s Most Popular Open Source Database   14
Where are we now?

    • The architectures above solved:
          – your read problems.
          – some HA requirements.


    • But they did not solve:
          – your write problems!


    • And what when we need:
          – higher HA?
          – synchronous replication?
          – more write speed?



Copyright 2007 Oli Sennhauser               The World’s Most Popular Open Source Database   15
MySQL Cluster

    •    Shared-nothing architecture
    •    Synchronous replication (2-Phase commit)
    •    Fast automatic fail over
    •    High performance (also writing)
    •    High transactional throughput
    •    No special components required
    •    In-Memory database (in 5.1 also disk support)
    •    Scalable, 1000's of transactions per second
    •    99.999% HA (five nine)
    •    On-line upgrade path (at least on GA within same
         version)

Copyright 2007 Oli Sennhauser             The World’s Most Popular Open Source Database   16
MySQL Cluster architecture

                Application
                Application          Application                   Application
                 Application                                      Application

                                                                                    my.cnf
      SQL­Nodes            MySQL           MySQL                 MySQL
                           Server          Server                Server



                                     NDB Cluster
                                         (Data nodes)                                   config.ini
                                    DB                  DB                                MGM
      Data­Nodes
                                                                                         Server
                                    DB                  DB
                                                                                    MGM client

                                                                                     Mgmt­Nodes


Copyright 2007 Oli Sennhauser                                The World’s Most Popular Open Source Database   17
MySQL Cluster HA features


                        MySQL        XMySQL       X
                                                  MySQL            X
                                                                   MySQL              X
                                                                                      MySQL
                        Server         Server      Server            Server             Server




                                    NDB API


                      Data            NDB           Data                             Management
                      Node       Storage Engine     Node                               Server




                     X
                     Data                          X
                                                   Data
                     Node                          Node
                                                                                    X Server
                                                                                    Management




                                        MySQL Cluster
Copyright 2007 Oli Sennhauser                               The World’s Most Popular Open Source Database   18
Cluster with Replication
    • for read scale-out (Reporting):


                                  Appl
                                   rw
                   mysqld         mysqld      mysqld




                                ndbd   ndbd        S1     S2           S3
                                ndbd   ndbd


                                                       Reporting

Copyright 2007 Oli Sennhauser                             The World’s Most Popular Open Source Database   19
Cluster with Replication
    • Cluster-Cluster replication for disaster fail over
      (MySQL 5.0):

                         Appl
                                           fail over
                           rw
           mysqld        mysqld        mysqld     mysqld       mysqld          mysqld




                      ndbd      ndbd                       ndbd       ndbd

                      ndbd      ndbd                       ndbd       ndbd




Copyright 2007 Oli Sennhauser                          The World’s Most Popular Open Source Database   20
Cluster with Replication
    • Cluster-Cluster replication for disaster fail over
      (MySQL 5.1):

                         Appl              fail over
                           rw
           mysqld        mysqld        mysqld     mysqld       mysqld          mysqld




                      ndbd      ndbd                       ndbd       ndbd

                      ndbd      ndbd                       ndbd       ndbd




Copyright 2007 Oli Sennhauser                          The World’s Most Popular Open Source Database   21
Cluster with Replication




    • circular Cluster-Cluster
      replication (>= MySQL
      5.1.18?):




Copyright 2007 Oli Sennhauser               The World’s Most Popular Open Source Database   22
Cluster examples

    •    Session handling
    •    Telecom (Mobile)
    •    VoIP
    •    RSS-Feed aggregation
    •    Mail
    •    On-line Games

    • Use cluster where
          – you need HA
          – you have high write load
          – you do little Joins and Grouping


Copyright 2007 Oli Sennhauser               The World’s Most Popular Open Source Database   23
How to go on?

    • Read is a caching problem!
          ➔   More RAM or scale-out.


    ●    Write is a batching problem!
          ➔   Batch your load,
          ➔   Buy stronger I/O system.
          ➔   Use MySQL Cluster.
          ➔   SSD!


    ●    What then?



Copyright 2007 Oli Sennhauser             The World’s Most Popular Open Source Database   24
SSD disruption

    • I/O system without any movable parts!
    • SSD = Solid State disk (Flash memory, NAND,
      NOR chips, RAM-SAN).
    • During the last year(s)
    • Price from 15'000 USD / 160 Gbyte -> 100 USD /
      32 Gbyte
    • 10-50 times faster than mechanical I/O systems
    • 1 Mio write cycles dead :-( (special FS!)

    • RAM: Huge amount of memory is cheap!

    ➔    This will disrupt the database world!
Copyright 2007 Oli Sennhauser              The World’s Most Popular Open Source Database   25
What then?

    • With or without SSD we will reach a physical
      limit. What then?

    • Application partitioning:
          – Split applications
                 • OLTP vs. OLAP
                 • all in one
          – Segment your application




Copyright 2007 Oli Sennhauser               The World’s Most Popular Open Source Database   26
Application partitioning

    • OLTP vs. OLAP
          – hot business data (trx) vs. “old” reporting data


    • “All in one”
          – Sessions, user tracking, ads, chat, booking


    • Segment
          – split by for example 1 Mio users (split by user_id).




Copyright 2007 Oli Sennhauser               The World’s Most Popular Open Source Database   27
Architecture examples




Copyright 2007 Oli Sennhauser                 The World’s Most Popular Open Source Database   28
Architecture examples




Copyright 2007 Oli Sennhauser                 The World’s Most Popular Open Source Database   29
Architecture examples




Copyright 2007 Oli Sennhauser                 The World’s Most Popular Open Source Database   30
Architecture examples




Copyright 2007 Oli Sennhauser                 The World’s Most Popular Open Source Database   31
Some more architecture stuff?

    • Databases are slow!!!
          ➔   Whenever possible try to avoid databases! Use
              memcached for example.
    • The SP trap.
          ➔   Stored Procedures are a lock in! Try to avoid SP!
    • Use Materialized Views (MV) and/or shadow
      tables.
    • VM/SAN is nice for consolidation but not for
      performance/scale-out!
    • Backup and Staging
    • MySQL – Proxy


Copyright 2007 Oli Sennhauser                The World’s Most Popular Open Source Database   32
Now it's your turn...

    • Your problems?

    • Let us build a replication...




Copyright 2007 Oli Sennhauser                  The World’s Most Popular Open Source Database   33

More Related Content

What's hot

Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
ivmaykov
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
Abdul Manaf
 

What's hot (20)

Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
 
MySQL Cluster Basics
MySQL Cluster BasicsMySQL Cluster Basics
MySQL Cluster Basics
 
Linux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQLLinux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQL
 
Severalnines Self-Training: MySQL® Cluster - Part VII
Severalnines Self-Training: MySQL® Cluster - Part VIISeveralnines Self-Training: MySQL® Cluster - Part VII
Severalnines Self-Training: MySQL® Cluster - Part VII
 
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...Cassandra nyc 2011   ilya maykov - ooyala - scaling video analytics with apac...
Cassandra nyc 2011 ilya maykov - ooyala - scaling video analytics with apac...
 
Cloudera Impala: A modern SQL Query Engine for Hadoop
Cloudera Impala: A modern SQL Query Engine for HadoopCloudera Impala: A modern SQL Query Engine for Hadoop
Cloudera Impala: A modern SQL Query Engine for Hadoop
 
Introduction to Cassandra and CQL for Java developers
Introduction to Cassandra and CQL for Java developersIntroduction to Cassandra and CQL for Java developers
Introduction to Cassandra and CQL for Java developers
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
 
Database as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformDatabase as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance Platform
 
Deploying Grid Services Using Apache Hadoop
Deploying Grid Services Using Apache HadoopDeploying Grid Services Using Apache Hadoop
Deploying Grid Services Using Apache Hadoop
 
Hadoop Operations for Production Systems (Strata NYC)
Hadoop Operations for Production Systems (Strata NYC)Hadoop Operations for Production Systems (Strata NYC)
Hadoop Operations for Production Systems (Strata NYC)
 
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
 
Introduction to Cassandra Architecture
Introduction to Cassandra ArchitectureIntroduction to Cassandra Architecture
Introduction to Cassandra Architecture
 
MySQL NDB Cluster 101
MySQL NDB Cluster 101MySQL NDB Cluster 101
MySQL NDB Cluster 101
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
 
Webinar slides: Introduction to Database Proxies (for MySQL)
Webinar slides: Introduction to Database Proxies (for MySQL)Webinar slides: Introduction to Database Proxies (for MySQL)
Webinar slides: Introduction to Database Proxies (for MySQL)
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
 
MySQL Options in OpenStack
MySQL Options in OpenStackMySQL Options in OpenStack
MySQL Options in OpenStack
 
Walk Through a Software Defined Everything PoC
Walk Through a Software Defined Everything PoCWalk Through a Software Defined Everything PoC
Walk Through a Software Defined Everything PoC
 
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
 

Viewers also liked

MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
Ronald Bradford
 

Viewers also liked (20)

SQL Outer Joins for Fun and Profit
SQL Outer Joins for Fun and ProfitSQL Outer Joins for Fun and Profit
SQL Outer Joins for Fun and Profit
 
Redis介绍
Redis介绍Redis介绍
Redis介绍
 
Extensible Data Modeling
Extensible Data ModelingExtensible Data Modeling
Extensible Data Modeling
 
Inno db internals innodb file formats and source code structure
Inno db internals innodb file formats and source code structureInno db internals innodb file formats and source code structure
Inno db internals innodb file formats and source code structure
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
 
Эффективная отладка репликации MySQL
Эффективная отладка репликации MySQLЭффективная отладка репликации MySQL
Эффективная отладка репликации MySQL
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery Essentials
 
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
 
Mastering InnoDB Diagnostics
Mastering InnoDB DiagnosticsMastering InnoDB Diagnostics
Mastering InnoDB Diagnostics
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...What you wanted to know about MySQL, but could not find using inernal instrum...
What you wanted to know about MySQL, but could not find using inernal instrum...
 
Hbase源码初探
Hbase源码初探Hbase源码初探
Hbase源码初探
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteAdvanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suite
 
Group Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreGroup Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication Core
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
 
MySQL aio
MySQL aioMySQL aio
MySQL aio
 

Similar to MySQL High-Availability and Scale-Out architectures

Locality of (p)reference
Locality of (p)referenceLocality of (p)reference
Locality of (p)reference
FromDual GmbH
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DB
Heriyadi Janwar
 
Free Software and the Future of Database Technology
Free Software and the Future of Database TechnologyFree Software and the Future of Database Technology
Free Software and the Future of Database Technology
elliando dias
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
Tim Lossen
 
Cloud Deployments with Apache Hadoop and Apache HBase
Cloud Deployments with Apache Hadoop and Apache HBaseCloud Deployments with Apache Hadoop and Apache HBase
Cloud Deployments with Apache Hadoop and Apache HBase
DATAVERSITY
 

Similar to MySQL High-Availability and Scale-Out architectures (20)

Locality of (p)reference
Locality of (p)referenceLocality of (p)reference
Locality of (p)reference
 
NoSQL in MySQL
NoSQL in MySQLNoSQL in MySQL
NoSQL in MySQL
 
PayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL ClusterPayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL Cluster
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DB
 
A Global In-memory Data System for MySQL
A Global In-memory Data System for MySQLA Global In-memory Data System for MySQL
A Global In-memory Data System for MySQL
 
Free Software and the Future of Database Technology
Free Software and the Future of Database TechnologyFree Software and the Future of Database Technology
Free Software and the Future of Database Technology
 
My sql tutorial-oscon-2012
My sql tutorial-oscon-2012My sql tutorial-oscon-2012
My sql tutorial-oscon-2012
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
 
Froscon2011: How i learned to use sql and then learned not to use it
Froscon2011:  How i learned to use sql and then learned not to use itFroscon2011:  How i learned to use sql and then learned not to use it
Froscon2011: How i learned to use sql and then learned not to use it
 
2 my sql overview technology etc[1]. etc
2 my sql overview   technology etc[1]. etc2 my sql overview   technology etc[1]. etc
2 my sql overview technology etc[1]. etc
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
 
DataStax C*ollege Credit: What and Why NoSQL?
DataStax C*ollege Credit: What and Why NoSQL?DataStax C*ollege Credit: What and Why NoSQL?
DataStax C*ollege Credit: What and Why NoSQL?
 
What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?
 
Cloud Deployments with Apache Hadoop and Apache HBase
Cloud Deployments with Apache Hadoop and Apache HBaseCloud Deployments with Apache Hadoop and Apache HBase
Cloud Deployments with Apache Hadoop and Apache HBase
 
Is NoSQL The Future of Data Storage?
Is NoSQL The Future of Data Storage?Is NoSQL The Future of Data Storage?
Is NoSQL The Future of Data Storage?
 
Clustrix Database Overview
Clustrix Database OverviewClustrix Database Overview
Clustrix Database Overview
 
Vote NO for MySQL
Vote NO for MySQLVote NO for MySQL
Vote NO for MySQL
 
Seminar : "The Future of MySQL - Roadmap to Success" session MySQL ...
Seminar : "The Future of MySQL - Roadmap to Success" session MySQL ...Seminar : "The Future of MySQL - Roadmap to Success" session MySQL ...
Seminar : "The Future of MySQL - Roadmap to Success" session MySQL ...
 

More from FromDual GmbH

More from FromDual GmbH (20)

MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?
 
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopPXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
 
IT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesIT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New Features
 
MariaDB 10.4 New Features
MariaDB 10.4 New FeaturesMariaDB 10.4 New Features
MariaDB 10.4 New Features
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New Features
 
PERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schemaPERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schema
 
MySQL für Oracle DBA's
MySQL für Oracle DBA'sMySQL für Oracle DBA's
MySQL für Oracle DBA's
 
MySQL Backup/Recovery
MySQL Backup/RecoveryMySQL Backup/Recovery
MySQL Backup/Recovery
 
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
 
MySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterMySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und Cluster
 
Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?
 
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationWeltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
 
MySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sMySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA's
 
MySQL Security SLAC 2015
MySQL Security SLAC 2015MySQL Security SLAC 2015
MySQL Security SLAC 2015
 
MySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerMySQL Performance Tuning für Entwickler
MySQL Performance Tuning für Entwickler
 
MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?
 
Reading MySQL fingerprints
Reading MySQL fingerprintsReading MySQL fingerprints
Reading MySQL fingerprints
 
High-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLHigh-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQL
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera Cluster
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

MySQL High-Availability and Scale-Out architectures

  • 1. MySQL High-Availability and Scale-Out architectures Oli Sennhauser Senior Consultant osennhauser@mysql.com Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 1
  • 2. Introduction • Who we are? • What we want? Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 2
  • 3. Table of Contents • Scale-Up vs. Scale-Out • MySQL Replication • MySQL HA solution • MySQL Cluster • Application architectural solutions • Other architectural stuff • It's your turn... • Let us build a replication Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 3
  • 4. When do we think about architecture? • Performance problems • HA requirements Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 4
  • 5. Scale-up vs. Scale-Out • Scale-up • Scale-out t Relaxation of constraints Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 5
  • 6. MySQL Replication • The MySQL answer: Master-Slave-Replication: Application 2 types of sessions!!! rtw Master Slave1 Slave2 Slave3 ... LB ro Even Oracle uses the expression “scale-out” now! Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 6
  • 7. MySQL Replication in detail Appl ro rt w asynchronous! IO thread M S SQL thread ... bin-log bin-log relay-log relay-log • wide distance possible! • thin line possible! Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 7
  • 8. MySQL Replication varieties • Cascaded replication: M black hole SI SI SI ... SE! S1 S2 S3 S4 S5 S6 S7 S8 ... for example Yahoo! Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 8
  • 9. MySQL Replication varieties • HA with “hot standby” Slave: Appl VIP HA solution Sbackup M Sstandby S1 S2 S3 • active – active fail over! Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 9
  • 10. MySQL HA solution • HA with MySQL: Appl VIP heartbeat M M' DRBD S1 S2 S3 • 99.99% HA (four nine) • active – passive fail over! Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 10
  • 11. MySQL HA solution • HA with MySQL and SAN: Appl VIP heartbeat M M' SAN S1 S2 S3 Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 11
  • 12. Multi-Master Replication • actually Master-Master Replication Appl Appl VIP/LB M1 M2 S11 S12 S13 S21 S22 S23 • This architecture does NOT solve your write problems!!! Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 12
  • 13. Multi-Master Replication • HA Multi-Master Replication Appl Appl VIP/LB VIP VIP M1' M1 M2 M2' DRBD DRBD S11 S12 S13 S21 S22 S23 Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 13
  • 14. Shared disk cluster DB1 DB2 DB2 ro! shared disk • This is in 99.9% of the cases NOT your solution!!! • It looks like Oracle RAC but MySQL does NOT (yet) have the instruments needed! • Can be useful in some special kinds of reporting. Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 14
  • 15. Where are we now? • The architectures above solved: – your read problems. – some HA requirements. • But they did not solve: – your write problems! • And what when we need: – higher HA? – synchronous replication? – more write speed? Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 15
  • 16. MySQL Cluster • Shared-nothing architecture • Synchronous replication (2-Phase commit) • Fast automatic fail over • High performance (also writing) • High transactional throughput • No special components required • In-Memory database (in 5.1 also disk support) • Scalable, 1000's of transactions per second • 99.999% HA (five nine) • On-line upgrade path (at least on GA within same version) Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 16
  • 17. MySQL Cluster architecture Application Application Application Application Application Application my.cnf SQL­Nodes MySQL MySQL MySQL Server Server Server NDB Cluster (Data nodes) config.ini DB DB MGM Data­Nodes Server DB DB MGM client Mgmt­Nodes Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 17
  • 18. MySQL Cluster HA features MySQL XMySQL X MySQL X MySQL X MySQL Server Server Server Server Server NDB API Data NDB Data Management Node Storage Engine Node Server X Data X Data Node Node X Server Management MySQL Cluster Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 18
  • 19. Cluster with Replication • for read scale-out (Reporting): Appl rw mysqld mysqld mysqld ndbd ndbd S1 S2 S3 ndbd ndbd Reporting Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 19
  • 20. Cluster with Replication • Cluster-Cluster replication for disaster fail over (MySQL 5.0): Appl fail over rw mysqld mysqld mysqld mysqld mysqld mysqld ndbd ndbd ndbd ndbd ndbd ndbd ndbd ndbd Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 20
  • 21. Cluster with Replication • Cluster-Cluster replication for disaster fail over (MySQL 5.1): Appl fail over rw mysqld mysqld mysqld mysqld mysqld mysqld ndbd ndbd ndbd ndbd ndbd ndbd ndbd ndbd Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 21
  • 22. Cluster with Replication • circular Cluster-Cluster replication (>= MySQL 5.1.18?): Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 22
  • 23. Cluster examples • Session handling • Telecom (Mobile) • VoIP • RSS-Feed aggregation • Mail • On-line Games • Use cluster where – you need HA – you have high write load – you do little Joins and Grouping Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 23
  • 24. How to go on? • Read is a caching problem! ➔ More RAM or scale-out. ● Write is a batching problem! ➔ Batch your load, ➔ Buy stronger I/O system. ➔ Use MySQL Cluster. ➔ SSD! ● What then? Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 24
  • 25. SSD disruption • I/O system without any movable parts! • SSD = Solid State disk (Flash memory, NAND, NOR chips, RAM-SAN). • During the last year(s) • Price from 15'000 USD / 160 Gbyte -> 100 USD / 32 Gbyte • 10-50 times faster than mechanical I/O systems • 1 Mio write cycles dead :-( (special FS!) • RAM: Huge amount of memory is cheap! ➔ This will disrupt the database world! Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 25
  • 26. What then? • With or without SSD we will reach a physical limit. What then? • Application partitioning: – Split applications • OLTP vs. OLAP • all in one – Segment your application Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 26
  • 27. Application partitioning • OLTP vs. OLAP – hot business data (trx) vs. “old” reporting data • “All in one” – Sessions, user tracking, ads, chat, booking • Segment – split by for example 1 Mio users (split by user_id). Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 27
  • 28. Architecture examples Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 28
  • 29. Architecture examples Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 29
  • 30. Architecture examples Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 30
  • 31. Architecture examples Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 31
  • 32. Some more architecture stuff? • Databases are slow!!! ➔ Whenever possible try to avoid databases! Use memcached for example. • The SP trap. ➔ Stored Procedures are a lock in! Try to avoid SP! • Use Materialized Views (MV) and/or shadow tables. • VM/SAN is nice for consolidation but not for performance/scale-out! • Backup and Staging • MySQL – Proxy Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 32
  • 33. Now it's your turn... • Your problems? • Let us build a replication... Copyright 2007 Oli Sennhauser The World’s Most Popular Open Source Database 33