SlideShare a Scribd company logo
<Insert Picture Here>   MySQL Cluster @ PayPal




                                                      Henrique Leandro
                                           henrique.leandro@oracle.com
                                               Consultor Senior MySQL
                                                  henrique.leandro@oracle.com



                                                                      Dec-2012

Wednesday, December 12, 12
Big Data is a Big Scam (Most of the Time)

      Daniel Austin, PayPal Technical Staff


      MySQL Connect Conference Brazil
      December 04, 2012 v1.3




Wednesday, December 12, 12
Today’s Agenda


                     Big Myths about Big Data


                       YESQL: A Counterexample


                                Q&A



                                          Confidential and Proprietary   3

Wednesday, December 12, 12
THE FUNDAMENTAL PROBLEM IN
       DISTRIBUTED DATA SYSTEMS
       “How Do We Manage Reliable Distribution
       of Data Across Geographical Distances?”




                                     Confidential and Proprietary



Wednesday, December 12, 12
Big Data Myth #1: Big Data = NoSQL


     • ‘Big Data’ Refers to a Common Set of Problems
          – Large Volumes
          – High Rates of Change
             • Of Data
             • Of Data Models
             • Of Data Presentation and Output
          – Often Require ‘Fast Data’ as well as ‘Big’
             • Near-real Time Analytics
             • Mapping Complex Structures


     Takeaway: Big Data is the problem, NoSQL is one
     (proposed) solution
                                                  Confidential and Proprietary



Wednesday, December 12, 12
The NoSQL Solution


     • NoSQL Systems provide a solution that relaxes
       many of the common constraints of typical RDBMS
       systems
          – Slow - RDBMS has not scaled with CPUs
          – Often require complex data management (SOX,
            SOR)
          – Costly to build and maintain, slow to change and
            adapt
          – Intolerant of CAP models (more on this later)
     • Non-relational models, usually key-value
     • May be batched or streaming
     • Not necessarily distributed geographically

                                                Confidential and Proprietary



Wednesday, December 12, 12
3 Kinds of Big Data Systems


     1. Columnar K-V Systems
          – Hadoop, Hbase, Cassandra, PNUTs
     2. Document-Based
          – MongoDB, TerraCotta
     3. Graph-Based
          – FlockDB, Voldemort

     Takeaway: These were originally designed as
     solutions to specific problems because no
     commercial solution would work.

                                        Confidential and Proprietary



Wednesday, December 12, 12
Big Data Myth #2: The CAP Theorem Doesn’t Say
  What You Think It Does


     • Consistency, Availability, (Network) Partition
     • The Real Story: These are not Independent
       Variables
     • AP =CP (Um, what? But…A != C )
     • Variations:
          – PACELC (adds latency tolerance)


     Takeaway: the real story here is about the tradeoffs
     made by designers of different systems, and the
     main tradeoff is between consistency and
     availability, usually in favor of the latter.

                                              Confidential and Proprietary



Wednesday, December 12, 12
Big Data Hype Cycle: Where Are We Now?

     There are currently more than 120+ NoSQL
     databases listed at nosql-databases.com!



                                        You Are Here ?




             As the pace of new technology solutions has slowed, some clear winners have emerged.


                                                                            Confidential and Proprietary



Wednesday, December 12, 12
BIG DATA MYTH #3: BIG DATA AND NOSQL ARE
       NEW IDEAS

       •    The first and most successful
            such system is DNS, created in
            1983.
       •    Began with flat files
       •    Currently serves the entire
            Internet (!)
       •    DNS is an AP system, availability
            is #1
       •    Many extensions complicate a
            simple design
       •    Suggests a new term for CAP-like
            ideas: variability
             • DNS variability is very high,
                often 2-3x the mean


                                                Confidential and Proprietary



Wednesday, December 12, 12
Big Data Myth: You Need A Big Data System


     Well, Maybe….But Before You Go There…
     There are essentially two ‘Big Data Problems’:
     “I have too much data and it’s coming in too fast to
     handle with any RDBMS.”

     “I have a lot of data distributed geographically and
     need to be able to read and write from anywhere in
     near real-time.”

     Takeaway: if you have one of these Big Data
     problems, a NoSQL solution might work for you.
     But there are also other alternatives…
                                            Confidential and Proprietary



Wednesday, December 12, 12
Today’s Agenda


                        Big Myths About Big Data


                   YESQL: A Counterexample


                                 Q&A



                                            Confidential and Proprietary   12

Wednesday, December 12, 12
Mission YESQL

     “Develop a globally distributed DB For
     user-related data.”
     • Must Not Fail (99.999%)
     • Must Not Lose Data. Period.
     • Must Support Transactions
     • Must Support (some) SQL
     • Must WriteRead 32-bit integer globally in
       1000ms
     • Maximum Data Volume: 100 TB
     • Must Scale Linearly with Costs
                                      Confidential and Proprietary



Wednesday, December 12, 12
What about “High Performance”?

       • Maximum lightspeed distance on Earth’s
         Surface: ~67 ms
       • Target: data available worldwide in < 1000 ms

                             Sound Easy?

                             Think Again!




                                            Confidential and Proprietary



Wednesday, December 12, 12
WHY MYSQL CLUSTER?
                     Pro                       Con
       •    True HA by design     •   Some semantic
             – Fast recovery          limitations on fields
       •    Supports (some) X-    •   Size constraints (2
            actions                   TB?)
       •    Relational Model          Hardware limits also
       •    In-memory             •   Higher cost/byte
            architecture = high   •   Requires reasonable
            performance               data partitioning
       •    Disk storage for      •   Higher complexity
            non-indexed data
             (since 5.1)
        •   APIs, APIs, APIs
                                              Confidential and Proprietary



Wednesday, December 12, 12
How MySQL Cluster Works in One Slide




           Graphics courtesy dev.mysql.com

                                             Confidential and Proprietary



Wednesday, December 12, 12
Confidential and Proprietary   17

Wednesday, December 12, 12
CIRCULAR REPLICATION/FAILOVER




       Graphics courtesy O’Reilly OnLamp.com


                                               Confidential and Proprietary



Wednesday, December 12, 12
•   Click to edit Master text styles




                                                Confidential and Proprietary   19

Wednesday, December 12, 12
AWS Meets MySQL Cluster

     • Why AWS?
          – Cheap and easy infrastructure-in-a-box
             (Or so I thought! Ha!)
     • Services Used:
          – EC2 (Centos 5.3, small instances for mgm
            & query nodes, XL for data
          – Elastic IPs/ELB
          – EBS Volumes
          – S3
          – Cloudwatch

                                          Confidential and Proprietary



Wednesday, December 12, 12
ARCHITECTURAL TILES
                                                AWS Availability Zones
       Tiling Rules
                                       A                        B
       • Never separate NDB & SQL
       • Ndb:2-SQL:1-MGM:1
       • Scale by adding more tiles
       • Failover 1st to nearest AZ
       • Then to nearest DC
       • At least 1 replica/AZ
                                       C                 ELB
       • Don’t share nodes
       • Mgmt nodes are redundant
       Limitations                         Unused (not present in all locations)
       • AWS is network-bound @ 250
          MBPS – ouch!
       • Need specific ACL across AZ
          boundaries
       • AZs not uniform!
       • No GSLB                             NDB               MGM                 SQL




                                                        Confidential and Proprietary



Wednesday, December 12, 12
Architecture Stack

          Scale by Tiling




                             A           B               A   B       A        B
                                 A           B
                                     A           B




                                                 A   B           A   B




                                                                          5 AWS Data Centers:
                                                                         US-E, US-W, TK, EU, AS

                                                                             Confidential and Proprietary



Wednesday, December 12, 12
SYSTEM READ/WRITE PERFORMANCE (!)

       What we tested:
       • 32 & 256 byte char fields                                            In-region replication tests
       • Reads, writes, query speed vs. volume
       • Data replication speeds
       Results:
       • Global replication < 350 ms
       • 256 byte read < 1000 ms worldwide




                             06/19/2011 06/20/2011 06/21/2011 06/22/2011 06/23/2011

                                                                        Confidential and Proprietary



Wednesday, December 12, 12
Data Models and Query Optimization for NDB


     • Network Latency is an obvious issue
     • Data model requires all segments present
       in each geo-region
     • Parameterized (Linked) Joins
          – SPJ technique from Clustra (see Clement
            Frazer’s blog for details)




                                         Confidential and Proprietary



Wednesday, December 12, 12
Hard Lessons, Shared

     • Be Careful…
        – With “Eventual Consistency”-related concepts
        – ACID, CAP are not really as well-defined as we’d like
          considering how often we invoke them
     • MySQL Cluster is a good solution
        – Real HA, real SQL
        – Notable limitations around fields, datatypes
        – Successfully competes with NoSQL systems for most use
          cases – better in many cases
     • NoSQL Systems
        – All have relatively low levels of maturity
        – More suitable for simpler key-value models
        – Victim of Tech Fashion


                                                Confidential and Proprietary



Wednesday, December 12, 12
Confidential and Proprietary   26

Wednesday, December 12, 12
Confidential and Proprietary   27

Wednesday, December 12, 12
MySQL Enterprise Edition




                             28
Wednesday, December 12, 12
MySQL Enterprise Edition

        Mais produtividade, menores riscos e maior capacidade
        para o MySQL.


                                             Oracle Premier
                                            Lifetime Support
                             MySQL Enterprise                 Oracle Product
                                 Security                Certifications/Integrations
                    MySQL Enterprise                                MySQL Enterprise
                             Audit                               Monitor/Query Analyzer
              MySQL Enterprise                                           MySQL Enterprise
                   Scalability                                                 Backup
          MySQL Enterprise
                                                                            MySQL Workbench
            High Availability



                                                    28
Wednesday, December 12, 12
Future Directions

     • Alternate solution using Pacemaker,
       Heartbeat
          – Uses InnoDB, not NDB
     • Implement Memcached plugin
          – To test NoSQL functionality from MySQL
     • Add simple connection-based persistence to
       preserve connections during failover
     • Better data node distribution
     • Better testing & monitoring


                                      Confidential and Proprietary



Wednesday, December 12, 12
Summing Up On YESQL v0.85


     • It works! Far better than expected.
     • Very fast, very reliable
     • Reduced complexity since v0.7
     • AWS poses challenges that private data
       centers may not experience
     • You can achieve high performance and
       availability without giving up relational
       models and read consistency!


                                       Confidential and Proprietary



Wednesday, December 12, 12
The Big Picture on Big Data

     • Only use Big Data solutions when you have a real
       Big Data problem.
          – Don’t be a Dedicated Follower of Tech Fashion!
     • Not all Big Data solutions are created equal
          – What tradeoffs are most important to you?
          – Consistency, Fault Tolerance, Availability,
            Performance, Variability
     • Is your data model a fit for NoSQL?
          – You don’t have to give up the relational model in
            most cases, so don’t!
     • You can achieve high performance and availability
       without giving up relational models and read
       consistency! Just say YESQL!
                                                 Confidential and Proprietary



Wednesday, December 12, 12
“In the long run, we are all dead
      eventually consistent.”
      Maynard Keynes on NoSQL Databases


      Twitter: @daniel_b_austin
      Emai: daaustin@paypal.com




      With apologies and thanks to the real DB experts, Andrew Goodman, Yves
      Trudeau, Clement Frazer, Daniel Abadi, Kent Beck, and everyone else who
      contributed. It really works!




Wednesday, December 12, 12
<Insert Picture Here>   Obrigado




                                                   Henrique Leandro
                                        henrique.leandro@oracle.com
                                            Consultor Senior MySQL
                                               henrique.leandro@oracle.com



                                                                   Dec-2012

Wednesday, December 12, 12

More Related Content

What's hot (20)

PDF
Apache Cassandra @Geneva JUG 2013.02.26
Benoit Perroud
 
PDF
Webinar: The Future of SQL
Crate.io
 
PPT
SQL/NoSQL How to choose ?
Venu Anuganti
 
PPT
RDBMS vs NoSQL
Murat Çakal
 
PPTX
Minnebar 2013 - Scaling with Cassandra
Jeff Bollinger
 
DOCX
Sql vs NO-SQL database differences explained
Satya Pal
 
PDF
NoSQL
Yousof Alsatom
 
PPTX
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
lisapaglia
 
PDF
Hybrid my sql_hadoop_datawarehouse
Laine Campbell
 
PPTX
NoSQL A brief look at Apache Cassandra Distributed Database
Joe Alex
 
PDF
Five Lessons in Distributed Databases
jbellis
 
PDF
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
Todd Hoff
 
PPTX
Intro to Big Data and NoSQL
Don Demcsak
 
PPTX
M6d cassandrapresentation
Edward Capriolo
 
PDF
MySQL NDB Cluster 101
Bernd Ocklin
 
PDF
Things Every Oracle DBA Needs to Know About the Hadoop Ecosystem (c17lv version)
Zohar Elkayam
 
PPTX
Chapter1: NoSQL: It’s about making intelligent choices
Maynooth University
 
PDF
NoSQL-Database-Concepts
Bhaskar Gunda
 
PDF
Cassandra and Spark
nickmbailey
 
PDF
Database revolution opening webcast 01 18-12
mark madsen
 
Apache Cassandra @Geneva JUG 2013.02.26
Benoit Perroud
 
Webinar: The Future of SQL
Crate.io
 
SQL/NoSQL How to choose ?
Venu Anuganti
 
RDBMS vs NoSQL
Murat Çakal
 
Minnebar 2013 - Scaling with Cassandra
Jeff Bollinger
 
Sql vs NO-SQL database differences explained
Satya Pal
 
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
lisapaglia
 
Hybrid my sql_hadoop_datawarehouse
Laine Campbell
 
NoSQL A brief look at Apache Cassandra Distributed Database
Joe Alex
 
Five Lessons in Distributed Databases
jbellis
 
What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications
Todd Hoff
 
Intro to Big Data and NoSQL
Don Demcsak
 
M6d cassandrapresentation
Edward Capriolo
 
MySQL NDB Cluster 101
Bernd Ocklin
 
Things Every Oracle DBA Needs to Know About the Hadoop Ecosystem (c17lv version)
Zohar Elkayam
 
Chapter1: NoSQL: It’s about making intelligent choices
Maynooth University
 
NoSQL-Database-Concepts
Bhaskar Gunda
 
Cassandra and Spark
nickmbailey
 
Database revolution opening webcast 01 18-12
mark madsen
 

Similar to MySQL Cluster no PayPal (20)

PDF
PayPal Big Data and MySQL Cluster
Mat Keep
 
PPTX
Yes sql08 inmemorydb
Daniel Austin
 
PDF
Big Data - architectural concerns for the new age
Debasish Ghosh
 
PPTX
Big Data is a Big Scam Most of the Time! (MySQL Connect Keynote 2012)
Daniel Austin
 
PPTX
A Global In-memory Data System for MySQL
Daniel Austin
 
PDF
Morning with MongoDB Paris 2012 - Accueil et Introductions
MongoDB
 
PPTX
Introduction to NoSQL
PolarSeven Pty Ltd
 
PDF
The Rules of Scalable database
Dahui Feng
 
PDF
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
Chris Richardson
 
PDF
Where Does Big Data Meet Big Database - QCon 2012
Ben Stopford
 
PPTX
Navigating NoSQL in cloudy skies
shnkr_rmchndrn
 
PDF
A Morning with MongoDB Barcelona: Introduction
MongoDB
 
PDF
Intro to NoSQL and MongoDB
MongoDB
 
PPTX
Nashville analytics summit aug9 no sql mike king dell v1.5
Mike King
 
PDF
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
ScyllaDB
 
PDF
1. Lecture1_NOSQL_Introduction.pdf
ShaimaaMohamedGalal
 
PDF
Solr cloud the 'search first' nosql database extended deep dive
lucenerevolution
 
PDF
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
PPT
No sql
Prateek Jain
 
PDF
MongoDB Hadoop and Humongous Data
MongoDB
 
PayPal Big Data and MySQL Cluster
Mat Keep
 
Yes sql08 inmemorydb
Daniel Austin
 
Big Data - architectural concerns for the new age
Debasish Ghosh
 
Big Data is a Big Scam Most of the Time! (MySQL Connect Keynote 2012)
Daniel Austin
 
A Global In-memory Data System for MySQL
Daniel Austin
 
Morning with MongoDB Paris 2012 - Accueil et Introductions
MongoDB
 
Introduction to NoSQL
PolarSeven Pty Ltd
 
The Rules of Scalable database
Dahui Feng
 
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
Chris Richardson
 
Where Does Big Data Meet Big Database - QCon 2012
Ben Stopford
 
Navigating NoSQL in cloudy skies
shnkr_rmchndrn
 
A Morning with MongoDB Barcelona: Introduction
MongoDB
 
Intro to NoSQL and MongoDB
MongoDB
 
Nashville analytics summit aug9 no sql mike king dell v1.5
Mike King
 
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
ScyllaDB
 
1. Lecture1_NOSQL_Introduction.pdf
ShaimaaMohamedGalal
 
Solr cloud the 'search first' nosql database extended deep dive
lucenerevolution
 
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
No sql
Prateek Jain
 
MongoDB Hadoop and Humongous Data
MongoDB
 
Ad

More from MySQL Brasil (20)

PDF
MySQL como Document Store PHP Conference 2017
MySQL Brasil
 
PDF
MySQL no Paypal Tesla e Uber
MySQL Brasil
 
PDF
MySQL 8.0.1 DMR
MySQL Brasil
 
PDF
Alta disponibilidade com MySQL Enterprise
MySQL Brasil
 
PDF
MySQL Roadmap NoSQL HA Fev17
MySQL Brasil
 
PDF
Segurança no MySQL
MySQL Brasil
 
PDF
5 razões estratégicas para usar MySQL
MySQL Brasil
 
PDF
Alta disponibilidade no MySQL 5.7 GUOB 2016
MySQL Brasil
 
PDF
MySQL 5.7 como Document Store
MySQL Brasil
 
PDF
Enabling digital transformation with MySQL
MySQL Brasil
 
PDF
Alta Disponibilidade no MySQL 5.7 para aplicações em PHP
MySQL Brasil
 
PDF
Alta Disponibilidade no MySQL 5.7
MySQL Brasil
 
PDF
NoSQL no MySQL 5.7
MySQL Brasil
 
PDF
OpenStack & MySQL
MySQL Brasil
 
PDF
10 Razões para Usar MySQL em Startups
MySQL Brasil
 
PDF
Novidades do MySQL para desenvolvedores ago15
MySQL Brasil
 
PDF
Estratégias de Segurança e Gerenciamento para MySQL
MySQL Brasil
 
PDF
Novidades do Universo MySQL julho-15
MySQL Brasil
 
PDF
Serviços Escaláveis e de Alta Performance com MySQL e Java
MySQL Brasil
 
PDF
MySQL The State of the Dolphin - jun15
MySQL Brasil
 
MySQL como Document Store PHP Conference 2017
MySQL Brasil
 
MySQL no Paypal Tesla e Uber
MySQL Brasil
 
MySQL 8.0.1 DMR
MySQL Brasil
 
Alta disponibilidade com MySQL Enterprise
MySQL Brasil
 
MySQL Roadmap NoSQL HA Fev17
MySQL Brasil
 
Segurança no MySQL
MySQL Brasil
 
5 razões estratégicas para usar MySQL
MySQL Brasil
 
Alta disponibilidade no MySQL 5.7 GUOB 2016
MySQL Brasil
 
MySQL 5.7 como Document Store
MySQL Brasil
 
Enabling digital transformation with MySQL
MySQL Brasil
 
Alta Disponibilidade no MySQL 5.7 para aplicações em PHP
MySQL Brasil
 
Alta Disponibilidade no MySQL 5.7
MySQL Brasil
 
NoSQL no MySQL 5.7
MySQL Brasil
 
OpenStack & MySQL
MySQL Brasil
 
10 Razões para Usar MySQL em Startups
MySQL Brasil
 
Novidades do MySQL para desenvolvedores ago15
MySQL Brasil
 
Estratégias de Segurança e Gerenciamento para MySQL
MySQL Brasil
 
Novidades do Universo MySQL julho-15
MySQL Brasil
 
Serviços Escaláveis e de Alta Performance com MySQL e Java
MySQL Brasil
 
MySQL The State of the Dolphin - jun15
MySQL Brasil
 
Ad

MySQL Cluster no PayPal

  • 1. <Insert Picture Here> MySQL Cluster @ PayPal Henrique Leandro [email protected] Consultor Senior MySQL [email protected] Dec-2012 Wednesday, December 12, 12
  • 2. Big Data is a Big Scam (Most of the Time) Daniel Austin, PayPal Technical Staff MySQL Connect Conference Brazil December 04, 2012 v1.3 Wednesday, December 12, 12
  • 3. Today’s Agenda Big Myths about Big Data YESQL: A Counterexample Q&A Confidential and Proprietary 3 Wednesday, December 12, 12
  • 4. THE FUNDAMENTAL PROBLEM IN DISTRIBUTED DATA SYSTEMS “How Do We Manage Reliable Distribution of Data Across Geographical Distances?” Confidential and Proprietary Wednesday, December 12, 12
  • 5. Big Data Myth #1: Big Data = NoSQL • ‘Big Data’ Refers to a Common Set of Problems – Large Volumes – High Rates of Change • Of Data • Of Data Models • Of Data Presentation and Output – Often Require ‘Fast Data’ as well as ‘Big’ • Near-real Time Analytics • Mapping Complex Structures Takeaway: Big Data is the problem, NoSQL is one (proposed) solution Confidential and Proprietary Wednesday, December 12, 12
  • 6. The NoSQL Solution • NoSQL Systems provide a solution that relaxes many of the common constraints of typical RDBMS systems – Slow - RDBMS has not scaled with CPUs – Often require complex data management (SOX, SOR) – Costly to build and maintain, slow to change and adapt – Intolerant of CAP models (more on this later) • Non-relational models, usually key-value • May be batched or streaming • Not necessarily distributed geographically Confidential and Proprietary Wednesday, December 12, 12
  • 7. 3 Kinds of Big Data Systems 1. Columnar K-V Systems – Hadoop, Hbase, Cassandra, PNUTs 2. Document-Based – MongoDB, TerraCotta 3. Graph-Based – FlockDB, Voldemort Takeaway: These were originally designed as solutions to specific problems because no commercial solution would work. Confidential and Proprietary Wednesday, December 12, 12
  • 8. Big Data Myth #2: The CAP Theorem Doesn’t Say What You Think It Does • Consistency, Availability, (Network) Partition • The Real Story: These are not Independent Variables • AP =CP (Um, what? But…A != C ) • Variations: – PACELC (adds latency tolerance) Takeaway: the real story here is about the tradeoffs made by designers of different systems, and the main tradeoff is between consistency and availability, usually in favor of the latter. Confidential and Proprietary Wednesday, December 12, 12
  • 9. Big Data Hype Cycle: Where Are We Now? There are currently more than 120+ NoSQL databases listed at nosql-databases.com! You Are Here ? As the pace of new technology solutions has slowed, some clear winners have emerged. Confidential and Proprietary Wednesday, December 12, 12
  • 10. BIG DATA MYTH #3: BIG DATA AND NOSQL ARE NEW IDEAS • The first and most successful such system is DNS, created in 1983. • Began with flat files • Currently serves the entire Internet (!) • DNS is an AP system, availability is #1 • Many extensions complicate a simple design • Suggests a new term for CAP-like ideas: variability • DNS variability is very high, often 2-3x the mean Confidential and Proprietary Wednesday, December 12, 12
  • 11. Big Data Myth: You Need A Big Data System Well, Maybe….But Before You Go There… There are essentially two ‘Big Data Problems’: “I have too much data and it’s coming in too fast to handle with any RDBMS.” “I have a lot of data distributed geographically and need to be able to read and write from anywhere in near real-time.” Takeaway: if you have one of these Big Data problems, a NoSQL solution might work for you. But there are also other alternatives… Confidential and Proprietary Wednesday, December 12, 12
  • 12. Today’s Agenda Big Myths About Big Data YESQL: A Counterexample Q&A Confidential and Proprietary 12 Wednesday, December 12, 12
  • 13. Mission YESQL “Develop a globally distributed DB For user-related data.” • Must Not Fail (99.999%) • Must Not Lose Data. Period. • Must Support Transactions • Must Support (some) SQL • Must WriteRead 32-bit integer globally in 1000ms • Maximum Data Volume: 100 TB • Must Scale Linearly with Costs Confidential and Proprietary Wednesday, December 12, 12
  • 14. What about “High Performance”? • Maximum lightspeed distance on Earth’s Surface: ~67 ms • Target: data available worldwide in < 1000 ms Sound Easy? Think Again! Confidential and Proprietary Wednesday, December 12, 12
  • 15. WHY MYSQL CLUSTER? Pro Con • True HA by design • Some semantic – Fast recovery limitations on fields • Supports (some) X- • Size constraints (2 actions TB?) • Relational Model Hardware limits also • In-memory • Higher cost/byte architecture = high • Requires reasonable performance data partitioning • Disk storage for • Higher complexity non-indexed data (since 5.1) • APIs, APIs, APIs Confidential and Proprietary Wednesday, December 12, 12
  • 16. How MySQL Cluster Works in One Slide Graphics courtesy dev.mysql.com Confidential and Proprietary Wednesday, December 12, 12
  • 17. Confidential and Proprietary 17 Wednesday, December 12, 12
  • 18. CIRCULAR REPLICATION/FAILOVER Graphics courtesy O’Reilly OnLamp.com Confidential and Proprietary Wednesday, December 12, 12
  • 19. Click to edit Master text styles Confidential and Proprietary 19 Wednesday, December 12, 12
  • 20. AWS Meets MySQL Cluster • Why AWS? – Cheap and easy infrastructure-in-a-box (Or so I thought! Ha!) • Services Used: – EC2 (Centos 5.3, small instances for mgm & query nodes, XL for data – Elastic IPs/ELB – EBS Volumes – S3 – Cloudwatch Confidential and Proprietary Wednesday, December 12, 12
  • 21. ARCHITECTURAL TILES AWS Availability Zones Tiling Rules A B • Never separate NDB & SQL • Ndb:2-SQL:1-MGM:1 • Scale by adding more tiles • Failover 1st to nearest AZ • Then to nearest DC • At least 1 replica/AZ C ELB • Don’t share nodes • Mgmt nodes are redundant Limitations Unused (not present in all locations) • AWS is network-bound @ 250 MBPS – ouch! • Need specific ACL across AZ boundaries • AZs not uniform! • No GSLB NDB MGM SQL Confidential and Proprietary Wednesday, December 12, 12
  • 22. Architecture Stack Scale by Tiling A B A B A B A B A B A B A B 5 AWS Data Centers: US-E, US-W, TK, EU, AS Confidential and Proprietary Wednesday, December 12, 12
  • 23. SYSTEM READ/WRITE PERFORMANCE (!) What we tested: • 32 & 256 byte char fields In-region replication tests • Reads, writes, query speed vs. volume • Data replication speeds Results: • Global replication < 350 ms • 256 byte read < 1000 ms worldwide 06/19/2011 06/20/2011 06/21/2011 06/22/2011 06/23/2011 Confidential and Proprietary Wednesday, December 12, 12
  • 24. Data Models and Query Optimization for NDB • Network Latency is an obvious issue • Data model requires all segments present in each geo-region • Parameterized (Linked) Joins – SPJ technique from Clustra (see Clement Frazer’s blog for details) Confidential and Proprietary Wednesday, December 12, 12
  • 25. Hard Lessons, Shared • Be Careful… – With “Eventual Consistency”-related concepts – ACID, CAP are not really as well-defined as we’d like considering how often we invoke them • MySQL Cluster is a good solution – Real HA, real SQL – Notable limitations around fields, datatypes – Successfully competes with NoSQL systems for most use cases – better in many cases • NoSQL Systems – All have relatively low levels of maturity – More suitable for simpler key-value models – Victim of Tech Fashion Confidential and Proprietary Wednesday, December 12, 12
  • 26. Confidential and Proprietary 26 Wednesday, December 12, 12
  • 27. Confidential and Proprietary 27 Wednesday, December 12, 12
  • 28. MySQL Enterprise Edition 28 Wednesday, December 12, 12
  • 29. MySQL Enterprise Edition Mais produtividade, menores riscos e maior capacidade para o MySQL. Oracle Premier Lifetime Support MySQL Enterprise Oracle Product Security Certifications/Integrations MySQL Enterprise MySQL Enterprise Audit Monitor/Query Analyzer MySQL Enterprise MySQL Enterprise Scalability Backup MySQL Enterprise MySQL Workbench High Availability 28 Wednesday, December 12, 12
  • 30. Future Directions • Alternate solution using Pacemaker, Heartbeat – Uses InnoDB, not NDB • Implement Memcached plugin – To test NoSQL functionality from MySQL • Add simple connection-based persistence to preserve connections during failover • Better data node distribution • Better testing & monitoring Confidential and Proprietary Wednesday, December 12, 12
  • 31. Summing Up On YESQL v0.85 • It works! Far better than expected. • Very fast, very reliable • Reduced complexity since v0.7 • AWS poses challenges that private data centers may not experience • You can achieve high performance and availability without giving up relational models and read consistency! Confidential and Proprietary Wednesday, December 12, 12
  • 32. The Big Picture on Big Data • Only use Big Data solutions when you have a real Big Data problem. – Don’t be a Dedicated Follower of Tech Fashion! • Not all Big Data solutions are created equal – What tradeoffs are most important to you? – Consistency, Fault Tolerance, Availability, Performance, Variability • Is your data model a fit for NoSQL? – You don’t have to give up the relational model in most cases, so don’t! • You can achieve high performance and availability without giving up relational models and read consistency! Just say YESQL! Confidential and Proprietary Wednesday, December 12, 12
  • 33. “In the long run, we are all dead eventually consistent.” Maynard Keynes on NoSQL Databases Twitter: @daniel_b_austin Emai: [email protected] With apologies and thanks to the real DB experts, Andrew Goodman, Yves Trudeau, Clement Frazer, Daniel Abadi, Kent Beck, and everyone else who contributed. It really works! Wednesday, December 12, 12
  • 34. <Insert Picture Here> Obrigado Henrique Leandro [email protected] Consultor Senior MySQL [email protected] Dec-2012 Wednesday, December 12, 12