SlideShare une entreprise Scribd logo
1  sur  25
A Global In-memory Data System for MySQL

Daniel Austin, PayPal Technical Staff


Percona Live!
London, Oct. 25, 2011   v1.1
AGENDA


               Intro: Globalizing NDB

              Proposed Architecture

                    What We Learned

                             Q&A



    Global In-memory MySQL         Confidential and Proprietary   2
Our Mission

 “UserBase: Develop a globally
 distributed DB For User-related data”

 •   Must Not Fail (99.999%)
 •   Must Not Lose Data. Period.
 •   Must Support Transactions
 •   Must Be FAST
 •   Must Support (some) SQL
 •   May Be Buzzword-compliant (RFC 2119)

                                Confidential and Proprietary
THE FUNDAMENTAL PROBLEM IN
DISTRIBUTED DATA SYSTEMS

“How Do We Manage Reliable
Distribution of Data Across Geographical
Distances?”




                              Confidential and Proprietary
To SQL or Not to SQL,’Tis the Query

 • Modern NoSQL Systems as solutions
   – Hive, Cassandra, Mongo, 120+ more
   – Mostly designed for „Big Data‟ problems
   – Low levels of maturity
 • Trade-offs:
   – Consistency vs. Availability, Fault
     Tolerance (dreaded CAP theorem)
   – Relational Model & X-actions dropped


                                Confidential and Proprietary
SYSTEM AVAILABILITY DEFINED

• Availability of the entire
  system:
            n   m
Asys = 1 – P(1-Pri)j
           i=1 j=1             V
                               I
                               P

• Number of Parallel
  Components Needed to




                                   Parallel
  Achieve Availability Amin:
                                                      Serial

Nmin =
[ln(1-Amin)/ln(1-r)]

                                              Confidential and Proprietary
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
Intro: Globalizing NDB

       Proposed Architecture

                What We Learned

                         Q&A



Global In-memory MySQL            Confidential and Proprietary   8
WHY NDB?

            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
•   In-memory                    also
    architecture = high   •   Higher cost/byte
    performance           •   Requires reasonable
•   Disk storage for          data partitioning
    non-indexed data      •   Higher complexity
     (since 5.1)
•   APIs, APIs, APIs                 Confidential and Proprietary
How NDB Works in One Slide




Graphics courtesy dev.mysql.com

                                  Confidential and Proprietary
CIRCULAR REPLICATION/FAILOVER




Graphics courtesy O’Reilly OnLamp.com


                                        Confidential and Proprietary
AWS Meets NDB

• Why AWS?
  – Cheap and easy infrastructure-in-a-box
     (Or so we 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
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
• Dynamic IPs
• ELB sticky sessions !reliable

                                                  Confidential and Proprietary
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
Other Technologies Considered

 • Paxos
   – Elegant-but-complex consensus-based
     messaging protocol
   – Used in Google Megastore, Bing metadata
 • Java Query Caching
   – Queries as serialized objects
   – Not yet working
 • Multiple Ring Architectures
   – Even more complicated = no way


                                     Confidential and Proprietary
Intro: Globalizing NDB

          Proposed Architecture

             What We Learned

                         Q&A



Global In-memory MySQL            Confidential and Proprietary   16
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 < 10ms worldwide




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

                                            Confidential and Proprietary
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
Commit Ordering

 • Why does commit ordering matter?
 • Write operators are non-commutative

    [W(d,t1),W(d,t2)] != 0 unless t1=t2

   – Can lead to inconsistency
   – Can lead to timestamp corruption
   – Forcing sequential writes defeats Amdahl‟s
     rul
 • Can show up in GSLB scenarios

                                   Confidential and Proprietary
Dark Side of AWS

 • Deploying NDB at scale on AWS is hard
   – Dynamic IPs (use hostfile)
   – DNS issues
   – Security groups (ec2-authorize)
   – Inconsistent EC2 deployments
      • Are availability zones independent
        network segments?
   – No GSLB (!) (rent or buy)
   Be Prepared to struggle a bit!


                                   Confidential and Proprietary
NOTES ON GLOBAL LOAD BALANCING

• Don‟t try this at home
   – Rent or buy a
      solution
   – BGP-based solutions
      are best
• Deployment and config
  for AWS are tough
• We tried both Zeus and
  Dyn
   – Liked Dyn better, $$
      & ease of use
• Absolutely crucial part
  of infrastructure!


                            Graphics courtesy http://www.oes.co.th

                                            Confidential and Proprietary
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
 • NDB 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 simple key-value models
    – Better for very high volumes


                                           Confidential and Proprietary
Summing Up on v0.7


• It works!
• Very fast, very reliable
• Very complicated!
• 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
Future Directions

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

                                   Confidential and Proprietary
“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, and everyone else!

Contenu connexe

Tendances

Netflix web-adrian-qcon
Netflix web-adrian-qconNetflix web-adrian-qcon
Netflix web-adrian-qcon
Yiwei Ma
 

Tendances (20)

Conference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQLConference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQL
 
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with CrowbarWicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
 
Netflix web-adrian-qcon
Netflix web-adrian-qconNetflix web-adrian-qcon
Netflix web-adrian-qcon
 
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scaleHow LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
How LinkedIn uses memcached, a spoonful of SOA, and a sprinkle of SQL to scale
 
High Performance Cloud Computing
High Performance Cloud ComputingHigh Performance Cloud Computing
High Performance Cloud Computing
 
Select Stars: A DBA's Guide to Azure Cosmos DB (Chicago Suburban SQL Server U...
Select Stars: A DBA's Guide to Azure Cosmos DB (Chicago Suburban SQL Server U...Select Stars: A DBA's Guide to Azure Cosmos DB (Chicago Suburban SQL Server U...
Select Stars: A DBA's Guide to Azure Cosmos DB (Chicago Suburban SQL Server U...
 
Data Stores @ Netflix
Data Stores @ NetflixData Stores @ Netflix
Data Stores @ Netflix
 
The Wix Microservice Stack
The Wix Microservice StackThe Wix Microservice Stack
The Wix Microservice Stack
 
New life inside monolithic application
New life inside monolithic applicationNew life inside monolithic application
New life inside monolithic application
 
Structor - Automated Building of Virtual Hadoop Clusters
Structor - Automated Building of Virtual Hadoop ClustersStructor - Automated Building of Virtual Hadoop Clusters
Structor - Automated Building of Virtual Hadoop Clusters
 
MySQL NDB Cluster 101
MySQL NDB Cluster 101MySQL NDB Cluster 101
MySQL NDB Cluster 101
 
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source EffortsCassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
 
Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012
 
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
 
Novell Identity Manager Tips, Tricks and Best Practices
Novell Identity Manager Tips, Tricks and Best PracticesNovell Identity Manager Tips, Tricks and Best Practices
Novell Identity Manager Tips, Tricks and Best Practices
 
Working with XSLT, XPath and ECMA Scripts: Make It Simpler with Novell Identi...
Working with XSLT, XPath and ECMA Scripts: Make It Simpler with Novell Identi...Working with XSLT, XPath and ECMA Scripts: Make It Simpler with Novell Identi...
Working with XSLT, XPath and ECMA Scripts: Make It Simpler with Novell Identi...
 
End of RAID as we know it with Ceph Replication
End of RAID as we know it with Ceph ReplicationEnd of RAID as we know it with Ceph Replication
End of RAID as we know it with Ceph Replication
 
Cloud stack overview
Cloud stack overviewCloud stack overview
Cloud stack overview
 
Cassandra Core Concepts - Cassandra Day Toronto
Cassandra Core Concepts - Cassandra Day TorontoCassandra Core Concepts - Cassandra Day Toronto
Cassandra Core Concepts - Cassandra Day Toronto
 
09 yong.luo-ceph in-ctrip
09 yong.luo-ceph in-ctrip09 yong.luo-ceph in-ctrip
09 yong.luo-ceph in-ctrip
 

Similaire à A Global In-memory Data System for MySQL

A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
Qian Lin
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DB
Heriyadi Janwar
 

Similaire à A Global In-memory Data System for MySQL (20)

PayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL ClusterPayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL Cluster
 
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInJay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
 
Five Years of EC2 Distilled
Five Years of EC2 DistilledFive Years of EC2 Distilled
Five Years of EC2 Distilled
 
My sql tutorial-oscon-2012
My sql tutorial-oscon-2012My sql tutorial-oscon-2012
My sql tutorial-oscon-2012
 
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
A Survey of Advanced Non-relational Database Systems: Approaches and Applicat...
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DB
 
NoSQL overview #phptostart turin 11.07.2011
NoSQL overview #phptostart turin 11.07.2011NoSQL overview #phptostart turin 11.07.2011
NoSQL overview #phptostart turin 11.07.2011
 
Applications in the Cloud
Applications in the CloudApplications in the Cloud
Applications in the Cloud
 
MySQL Cluster no PayPal
MySQL Cluster no PayPalMySQL Cluster no PayPal
MySQL Cluster no PayPal
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
NoSQL_Night
NoSQL_NightNoSQL_Night
NoSQL_Night
 
Run Cloud Native MySQL NDB Cluster in Kubernetes
Run Cloud Native MySQL NDB Cluster in KubernetesRun Cloud Native MySQL NDB Cluster in Kubernetes
Run Cloud Native MySQL NDB Cluster in Kubernetes
 
Cosmos db
Cosmos dbCosmos db
Cosmos db
 
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless DreamsRainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
 
Drop acid
Drop acidDrop acid
Drop acid
 
Select Stars: A DBA's Guide to Azure Cosmos DB (SQL Saturday Oslo 2018)
Select Stars: A DBA's Guide to Azure Cosmos DB (SQL Saturday Oslo 2018)Select Stars: A DBA's Guide to Azure Cosmos DB (SQL Saturday Oslo 2018)
Select Stars: A DBA's Guide to Azure Cosmos DB (SQL Saturday Oslo 2018)
 
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
 
Apache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and BasicsApache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and Basics
 
High Scalability Toronto: Meetup #2
High Scalability Toronto: Meetup #2High Scalability Toronto: Meetup #2
High Scalability Toronto: Meetup #2
 
How and when to use NoSQL
How and when to use NoSQLHow and when to use NoSQL
How and when to use NoSQL
 

Plus de Daniel Austin

Plus de Daniel Austin (20)

Next generation web protocols
Next generation web protocolsNext generation web protocols
Next generation web protocols
 
Always Offline: Delay-Tolerant Networking for the Internet of Things
Always Offline: Delay-Tolerant Networking for the Internet of ThingsAlways Offline: Delay-Tolerant Networking for the Internet of Things
Always Offline: Delay-Tolerant Networking for the Internet of Things
 
Performance: How Fast is Fast Enough?
Performance: How Fast is Fast Enough?Performance: How Fast is Fast Enough?
Performance: How Fast is Fast Enough?
 
Big Data and the Future of Money 2014
Big Data and the Future of Money 2014Big Data and the Future of Money 2014
Big Data and the Future of Money 2014
 
Big data comes in small packages v1.2
Big data comes in small packages v1.2Big data comes in small packages v1.2
Big data comes in small packages v1.2
 
Designing Delay-tolerant Data Services for the Network of Things
Designing Delay-tolerant Data Services for the Network of ThingsDesigning Delay-tolerant Data Services for the Network of Things
Designing Delay-tolerant Data Services for the Network of Things
 
Web Performance Bootcamp 2014
Web Performance Bootcamp 2014Web Performance Bootcamp 2014
Web Performance Bootcamp 2014
 
HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1HTML5, HTTP2, and You 1.1
HTML5, HTTP2, and You 1.1
 
Managing Performance Globally with MySQL
Managing Performance Globally with MySQLManaging Performance Globally with MySQL
Managing Performance Globally with MySQL
 
Web Performance BootCamp 2013
Web Performance BootCamp 2013Web Performance BootCamp 2013
Web Performance BootCamp 2013
 
Perspectives on the Evolution of HTML
Perspectives on the Evolution of HTMLPerspectives on the Evolution of HTML
Perspectives on the Evolution of HTML
 
The Fastest Possible Search Algorithm: Grover's Search and the World of Quant...
The Fastest Possible Search Algorithm: Grover's Search and the World of Quant...The Fastest Possible Search Algorithm: Grover's Search and the World of Quant...
The Fastest Possible Search Algorithm: Grover's Search and the World of Quant...
 
Quantum Computing in a Nutshell: Grover's Search and the World of Quantum Com...
Quantum Computing in a Nutshell: Grover's Search and the World of Quantum Com...Quantum Computing in a Nutshell: Grover's Search and the World of Quantum Com...
Quantum Computing in a Nutshell: Grover's Search and the World of Quantum Com...
 
Reconceiving the Web as a Distributed (NoSQL) Data System
Reconceiving the Web as a Distributed (NoSQL) Data SystemReconceiving the Web as a Distributed (NoSQL) Data System
Reconceiving the Web as a Distributed (NoSQL) Data System
 
Big data and the Future of Money (World Big Data Congress 2013)
Big data and the Future of Money (World Big Data Congress 2013)Big data and the Future of Money (World Big Data Congress 2013)
Big data and the Future of Money (World Big Data Congress 2013)
 
Big Data is a Big Scam Most of the Time! (MySQL Connect Keynote 2012)
Big Data is a Big Scam Most of the Time! (MySQL Connect Keynote 2012)Big Data is a Big Scam Most of the Time! (MySQL Connect Keynote 2012)
Big Data is a Big Scam Most of the Time! (MySQL Connect Keynote 2012)
 
Performance analysisclass
Performance analysisclassPerformance analysisclass
Performance analysisclass
 
The Fastest Possible Search Algorithm
The Fastest Possible Search AlgorithmThe Fastest Possible Search Algorithm
The Fastest Possible Search Algorithm
 
Notes on a High-Performance JSON Protocol
Notes on a High-Performance JSON ProtocolNotes on a High-Performance JSON Protocol
Notes on a High-Performance JSON Protocol
 
Wrestling Large Data Volumes to the Ground
Wrestling Large Data Volumes to the GroundWrestling Large Data Volumes to the Ground
Wrestling Large Data Volumes to the Ground
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
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
 
"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 ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

A Global In-memory Data System for MySQL

  • 1. A Global In-memory Data System for MySQL Daniel Austin, PayPal Technical Staff Percona Live! London, Oct. 25, 2011 v1.1
  • 2. AGENDA Intro: Globalizing NDB Proposed Architecture What We Learned Q&A Global In-memory MySQL Confidential and Proprietary 2
  • 3. Our Mission “UserBase: Develop a globally distributed DB For User-related data” • Must Not Fail (99.999%) • Must Not Lose Data. Period. • Must Support Transactions • Must Be FAST • Must Support (some) SQL • May Be Buzzword-compliant (RFC 2119) Confidential and Proprietary
  • 4. THE FUNDAMENTAL PROBLEM IN DISTRIBUTED DATA SYSTEMS “How Do We Manage Reliable Distribution of Data Across Geographical Distances?” Confidential and Proprietary
  • 5. To SQL or Not to SQL,’Tis the Query • Modern NoSQL Systems as solutions – Hive, Cassandra, Mongo, 120+ more – Mostly designed for „Big Data‟ problems – Low levels of maturity • Trade-offs: – Consistency vs. Availability, Fault Tolerance (dreaded CAP theorem) – Relational Model & X-actions dropped Confidential and Proprietary
  • 6. SYSTEM AVAILABILITY DEFINED • Availability of the entire system: n m Asys = 1 – P(1-Pri)j i=1 j=1 V I P • Number of Parallel Components Needed to Parallel Achieve Availability Amin: Serial Nmin = [ln(1-Amin)/ln(1-r)] Confidential and Proprietary
  • 7. 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
  • 8. Intro: Globalizing NDB Proposed Architecture What We Learned Q&A Global In-memory MySQL Confidential and Proprietary 8
  • 9. WHY NDB? 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 • In-memory also architecture = high • Higher cost/byte performance • Requires reasonable • Disk storage for data partitioning non-indexed data • Higher complexity (since 5.1) • APIs, APIs, APIs Confidential and Proprietary
  • 10. How NDB Works in One Slide Graphics courtesy dev.mysql.com Confidential and Proprietary
  • 11. CIRCULAR REPLICATION/FAILOVER Graphics courtesy O’Reilly OnLamp.com Confidential and Proprietary
  • 12. AWS Meets NDB • Why AWS? – Cheap and easy infrastructure-in-a-box (Or so we 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
  • 13. 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 • Dynamic IPs • ELB sticky sessions !reliable Confidential and Proprietary
  • 14. 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
  • 15. Other Technologies Considered • Paxos – Elegant-but-complex consensus-based messaging protocol – Used in Google Megastore, Bing metadata • Java Query Caching – Queries as serialized objects – Not yet working • Multiple Ring Architectures – Even more complicated = no way Confidential and Proprietary
  • 16. Intro: Globalizing NDB Proposed Architecture What We Learned Q&A Global In-memory MySQL Confidential and Proprietary 16
  • 17. 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 < 10ms worldwide 06/19/2011 06/20/2011 06/21/2011 06/22/2011 06/23/2011 Confidential and Proprietary
  • 18. 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
  • 19. Commit Ordering • Why does commit ordering matter? • Write operators are non-commutative [W(d,t1),W(d,t2)] != 0 unless t1=t2 – Can lead to inconsistency – Can lead to timestamp corruption – Forcing sequential writes defeats Amdahl‟s rul • Can show up in GSLB scenarios Confidential and Proprietary
  • 20. Dark Side of AWS • Deploying NDB at scale on AWS is hard – Dynamic IPs (use hostfile) – DNS issues – Security groups (ec2-authorize) – Inconsistent EC2 deployments • Are availability zones independent network segments? – No GSLB (!) (rent or buy) Be Prepared to struggle a bit! Confidential and Proprietary
  • 21. NOTES ON GLOBAL LOAD BALANCING • Don‟t try this at home – Rent or buy a solution – BGP-based solutions are best • Deployment and config for AWS are tough • We tried both Zeus and Dyn – Liked Dyn better, $$ & ease of use • Absolutely crucial part of infrastructure! Graphics courtesy http://www.oes.co.th Confidential and Proprietary
  • 22. 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 • NDB 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 simple key-value models – Better for very high volumes Confidential and Proprietary
  • 23. Summing Up on v0.7 • It works! • Very fast, very reliable • Very complicated! • 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
  • 24. Future Directions • Alternate solution using Pacemaker, Heartbeat – From Yves Trudeau @ Percona – Uses InnoDB, not NDB • Implement Memcached plugin – To test NoSQL functionality, APIs • Add simple connection-based persistence to preserve connections during failover • Better data node distribution • Better testing & monitoring Confidential and Proprietary
  • 25. “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, and everyone else!

Notes de l'éditeur

  1. Service Reliability.
  2. This is really the problem we want to solve. It’s one of the fundamental problems in computer science and doesn’t have a completely satisfactory solution.
  3. Performance is response time.
  4. NDB has a much higher maturity level than most NoSQL systems
  5. “Conservation of timestamps”