SlideShare uma empresa Scribd logo
1 de 107
MySQL Cluster
Scaling to Billion Database Queries with MySQL Cluster
Bernd Ocklin
MySQL Cluster Engineering
bernd.ocklin@oracle.com
Servicing the Most Performance-Intensive Workloads
Program Agenda

                                    <Insert Picture Here>
• Databases Are Exciting Again!!!
• Overview of MySQL Cluster
• MySQL Cluster - What’s New
• How is it used?
A converging world ...
             Information   Banking




                                  Social
        Messaging
                                Networking




               Multi-
                           Gaming
               Media
2.1BN USERS
                          8X DATA GROWTH IN 5 YRS                  850M USERS
                     70+ NEW DOMAINS EVERY 60 SECONDS 20M APPS PER DAY
   40% DATA
 GROWTH PER YEAR
                                                            1 TR VIDEO
                                                            PLAYBACKS




                                                           $1TR BY 2014
250m TWEETS
  PER DAY                                                $700BN IN 2011




       5.9BN MOBILE SUBS IN 2011
       1 BILLION iOS & ANDROID APPS              370K CALL MINUTES
                                                    EVERY 60 SECONDS
       DOWNLOADED PER WEEK
Driving new Database Requirements




EXTREME WRITE SCALABILITY   REAL TIME USER EXPERIENCE




 ROCK SOLID RELIABILITY     RAPID SERVICE INNOVATION
No Trade-Offs: Cellular Network

  HLR / HSS
                                                  Location
                                                  Updates

                                                AuC, Call
                                                Routing, Billing


                Pre & Post Paid


                           • Massive volumes of write traffic
                           • <3ms database response
                           • Downtime & lost transactions = lost $

Billing, AuC,              MySQL Cluster in Action: http://bit.ly/oRI5tF
VLR
No Trade-Offs



         Transactional Integrity
              Complex REAL TIME USER EXPERIENCE
EXTREME WRITE SCALABILITY Queries
          Standards & Skillsets


 ROCK SOLID RELIABILITY   ELIMNATE BARRIERS TO ENTRY
MySQL Cluster – Users & Applications
       Extreme Scalability, Availability and Affordability

• Web
   •   High volume OLTP
   •   eCommerce
   •   User Profile Management
   •   Session Management & Caching
   •   Content Management
   •   On-Line Gaming

• Telecoms
   •   Subscriber Databases (HLR / HSS)
   •   Service Delivery Platforms
   •   VAS: VoIP, IPTV & VoD
   •   Mobile Content Delivery
   •   Mobile Payments
   •   LTE Access                                      http://www.mysql.com/customers/cluster/
Key Benefits
Scaling          Auto-sharding + Multi-master
Reads & Writes
                 Transactional, ACID-compliant relational database

99.999%          Shared-nothing design, no Single Point of Failure
Availability
                 On-Line operations: Scale, Upgrade Schema, etc.

Real-Time        High-load, real-time performance
Responsiveness   Predictable low latency, bounded access times

                 Complex, relational queries + Key/Value Access
SQL & NoSQL
APIs             MySQL, Memcached, C++, Java, JPA, HTTP / REST


Low TCO,         GPL & Commercial editions
Open platform    Commodity hardware, management & monitoring tools
Basic architectures
     2-tier




Data access
Application Logic
Front-End

Data
Indexes
Basic architectures
     3-tier


                    SQL, JDBC,
Front-End           ADO, ...
Application Logic

Data access
(e.g. SQL engine)


Data
Indexes
Basic architectures
     4-tier
Front-End

Application
Logic

Data access
(e.g. SQL engine)


Data
Indexes
All services share the same data view




 native ClusterJ REST/JSON   LDAP memcached   SQL, JDBC,
                                              ADO, ...

                         NDB API




                  MySQL Cluster Data Nodes
C++ example


      NdbOperation *op = trx­>getNdbOperation(myTable);

      op­>insertTuple();
      op­>equal("key", i);
      op­>setValue("value", &value);

      trx­>execute( NdbTransaction::Commit );
Java example



     Character newCharacter = 
         session.newInstance(Character.class);

     newCharacter.setName(„Yoda“);
     newCharacter.setAttributes(„Force“);

     Session.persist(newCharacter);
SQL example
  (requires MySQL Server)


       Mysql> INSERT INTO Charaters (Name, Attributes) 
           VALUES („Yoda“, „Force“);
High performance and Scalability

Cluster is
• Distributed
• Event Driven
• Asynchronous
• Parallel
• Non-locking
Your friends / Your enemies

•
  Disks (life-saver)   •
                         Disks (slow fsync)
•
  CPU cache            •
                         Network latency
•
  RAM                  •
                         Heap allocation
•
  Many cores           •
                         NUMA
                       •
                         Context switching
Use your friends

Disks (your job saver)
      – Log your data to disk (asynchrounsly)
CPU cache
      – Align to to it
RAM
      – Preallocate!
Many cores
      – Distribute to cores (have a model that supports this)
Avoid your enemies

Disks
        – Reduce fsyncs
        – no swapping
Network latency
        – Reduce network round trips
Slow heap allocation
        – Pre-allocate all memory, avoid using it
NUMA
        – Disable it
Context switching
        – Lock to cores
        – Get network interrupts out of your way
MySQL Cluster
  – A distributed hash table

               17        Yoda
               143       Albert
               12        Bernd
               42        Ernest

                                md5() % <no of nodes>




                    MySQL Cluster Data Nodes

17    Yoda                          12       Bernd
143   Ernest                        143      Albert
Best Practice : Primary Keys

• ALWAYS DEFINE A PRIMARY KEY ON THE TABLE!
  • A hidden PRIMARY KEY is added if no PK is specified. BUT..
     • .. NOT recommended
     • The hidden primary key is for example not replicated
       (between Clusters)!!
     • There are problems in this area, so avoid the problems!
• So always, at least have
 id BIGINT AUTO_INCREMENT PRIMARY KEY
  • Even if you don't “need” it for you applications
Auto-Sharding (distribution)


                                            Application

      [ {id: 12, name: Bernd}, {id: 143, name: Albert},
       {id: 42, name: Ernest}, …, {id: 17, name: Yoda}]



    {id: 17, … } {id: 143, … }   {id: 42, … }   {id: 12, … }




                    MySQL Cluster Data Nodes
Auto-Sharding (distribution)
  – Application “knows“ the data location
                                Application


              find({id: 12})




                                              {id: 12, name: Bernd}




            MySQL Cluster Data Nodes
Auto-Sharding

• Transparent to the application and data access layer
  • No need for application-layer sharding logic – build into the API & kernel
  • Partitioning based on hashing all or part of the primary key
  • Each node stores primary fragment for 1 partition and back-up fragment for another
• Transparency maintained during failover, upgrades and scale-out
• No need to limit application to single-shard transactions
Adding High Availability
  – Introducing Node Groups
                                            Application

      [ {id: 12, name: Bernd}, {id: 143, name: Albert},
       {id: 42, name: Ernest}, …, {id: 17, name: Yoda}]



    {id: 17, … } {id: 143, … }   {id: 42, … }   {id: 12, … }




                    MySQL Cluster Data Nodes
Adding High Availability
  - Synchronous Replication
                                           Application

     [ {id: 12, name: Bernd}, {id: 143, name: Albert},
      {id: 42, name: Ernest}, …, {id: 17, name: Yoda}]



   {id: 17, … } {id: 143, … }   {id: 42, … }   {id: 12, … }




                   MySQL Cluster Data Nodes
Adding High Availability
  – Synchronous Replication




 17    Yoda         12    Bernd
 42    Ernest       143   Albert
 12    Bernd        17    Yoda
 143   Albert       42    Ernest
Handling Scheduled Maintenance
    On-Line Operations

•   Scale the cluster (add & remove nodes on-line)
•   Repartition tables
•   Upgrade / patch servers & OS
•   Upgrade / patch MySQL Cluster
•   Back-Up
•   Evolve the schema on-line, in real-time
Adding disk durability

                      Memory

       {id: 17, … }             In-memory tables
                                   Data kept in memory but
                                     complemented by logging
                                     to disk.

                         Disk
                                Disk based tables
                                   Data kept on disk but
                                     cached in memory.
Logging to disk is
  decoupled from
  transaction writing.
Shared Nothing

   SQL, JDBC,
   ADO, ...

                 No shared components.
                   Cheap commodity
                   hardware.
                 Proper SAN acceptable
                   but expensive.
Adding High Availability
  – Extreme resilience
                                Application


               Service continuing




            MySQL Cluster Data Nodes
Event driven & asynchronous




 find(17, {});   {id: 17, name: Albert}




                                          {id: 17}   {name: Albert}
           TC                      LQH    ACC             TUP
Doing things in parallel




        find(17, {});          find([12, 17], {});




                  MySQL Cluster Data Nodes
Doing things in parallel




 find(17, {});   {id: 17, name: Albert}




    TC                             LQH     {id: 17}   {name: Albert}
    TC
     TC                            LQH
                                    LQH
     TC
      TC                            LQH
                                     LQH    ACC            TUP
             x16                       x16
Doing things in parallel

• Primary key reads can be directed to the correct
  shard on the API application level
    – No waste of resources by doing same operation
      on all
• Each data node can handle up to 16 operations in
  parallel
• One data node can fully utilize up to 51 physical CPU
  cores
Scaleable & Elastic
  – Increasing capacity in seconds
                        Application




         Data Nodes
Basic Deployments
     1 Data Node


                    SQL, JDBC,
Front-End           ADO, ...
Application Logic
Data Access




Data
Indexes
Basic Deployments
     Start scaling with 2 Data Nodes


                    SQL, JDBC,
Front-End           ADO, ...
Application Logic
Data Access
                                 ●
                                   Shared Data View
                                 ●
                                   Automated Load
                                 Balancing

Data
Indexes
Basic Deployments
     Continue Scaling
                    SQL, JDBC,
                    ADO, ...
                    SQL, JDBC,
Front-End           ADO, ...
Application Logic                OS, App or
                                 Hardware Load
Data access                      Balancing
(e.g. SQL engine)
                                 Automated
                                 Load Balancing
Data
Indexes
Basic Deployments
     Scale on 3 levels
                           SQL, JDBC,
                           ADO, ...
Front-End           SQL, JDBC,
Application Logic   ADO, ...



Data access
(e.g. SQL engine)


Data
Indexes
Typical Deployments
  2 Server
                                 Application
                  SQL, JDBC,
                  ADO, ...



                                 Web Server


                                 MySQL Server




                                 Data Nodes


           Server 1   Server 2
Typical Deployments
  4 Server
                                 Application
                  SQL, JDBC,
                  ADO, ...
           Server 3   Server 4

                                 Web Server


                                 MySQL Server




                                 Data Nodes


           Server 1   Server 2
Typical Deployments
  Geo Replication
                      SQL, JDBC,
                      ADO, ...
Server 3   Server 4                Server 3   Server 4




Server 1   Server 2                Server 1   Server 2
MySQL Cluster 7.2 GA
READS
Million / minute




                   1.200
                                               1.056
                   1.000

                    800
                                                        • 8 x Commodity Intel Servers
                    600                                   • 2 x 6-core processors 2.93GHz
                    400

                    200
                                                          • x5670 processors (24 threads
                      0                                     per total)
                             2 node   4 node   8 node
                                                          • 48GB RAM
                           UPDATE                         • Linux
Million / minute




                    120
                                                109
                    100                                 • Infiniband networking
                     80

                     60                                 • flexAsynch benchmark
                     40
                                                          • C++ NoSQL API (NDB API)
                     20

                      0
                                      4 node   8 node
Adaptive Query Localization
   Scaling Distributed Joins                               70x
                                                           More
                                                        Performance


                               • Perform Complex Queries
mysqld                           across Shards
                                  • JOINs pushed down to data nodes
         A       Data Nodes
                                  • Executed in parallel
         Q                        • Returns single result set to MySQL
         L
                               • Opens Up New Use-Cases
                                  • Real-time analytics
                                  • Recommendations engines
mysqld
                                  • Analyze click-streams

                 Data Nodes         DON’T COMPROMISE
                               FUNCTIONALITY TO SCALE-OUT !!
MySQL Cluster 7.2 AQL Test Query
          Web-Based Content Management System




                                                   MySQL
                                                   Server




                                                 Data    Data
                                                Node1   Node2




Copyright 2011 Oracle Corporation                           49
Web-Based CMS
                                              70x
                                               More
                                            Performance


                   87.23 seconds




                                       1.26 seconds

Must Analyze tables for best results
mysql> ANALYZE TABLE <tab-name>;
Memcached Key-Value API
                     • Persistent, Scalable, HA
                       Back-End to memcached
                       • No application changes: re-
                         uses standard memcached
                         clients & libraries
                     • Consolidate Caching &
                       Database Tiers
                       • Eliminate cache invalidation
                       • Simpler re-use of data across
                         services
                       • Improved service levels

 New                 • Flexible Deployment
NoSQL                  • Schema or Schema-less
Access                   storage
Schema-Free apps
                                    • Rapid application
                                      evolution
                                      • New types of data
                                        constantly added
                                      • No time to get schema
                                        extended
                                      • Missing skills to extend
                                        schema
                                      • Initially roll out to just a
                                        few users
                                      • Constantly adding to live
                                        system



Copyright 2011 Oracle Corporation                               52
Cluster & Memcached – Schema-Free



                          key        value

                   <town:maidenhead,SL6>
Application view

SQL view                  key        value

                   <town:maidenhead,SL6>




                          generic table
Cluster & Memcached –
Configured Schema



                                  key         value

                    <town:maidenhead,SL6>
Application view

SQL view                 prefix         key   value

                    <town:maidenhead,SL6>




         Config tables                                map.zip
SQL & NoSQL

                                            Clients


                                                JDBC / ODBC
                                                 PHP / PERL
  Native   memcached   HTTP/REST                Python / Ruby


                               NDB API



                               Data Nodes

 Mix         • SQL: Complex, relational queries
  &          • Memcached: Key-Value web services
Match        • Java: Enterprise Apps
             • NDB API: Real-time services
MySQL 5.5 Server Integration
             • Configure storage engine per-table
             • Choose the right tool for the job
               • InnoDB: Foreign Keys, XA Transactions,
                 Large Rows
               • MySQL Cluster: HA, High Write Rates, Real-
                 Time
             • Reduces Complexity, Simplifies
               DevOps
             • Take advantage of MySQL 5.5
               • 3x higher performance
               • Improved partitioning, diagnostics, availability,
                 etc.
Cross Data Center Scalability
Multi-Site Clustering

                                             • Split data nodes across
                                               data centers
                                               • Synchronous replication
              Node Group 1                       and auto-failover between
Data Node 1                    Data Node 2       sites
               Synchronous
                Synchronous
                Replication
                 Replication
                                               • Improved heartbeating to
                                                 handle network partitions
              Node Group 2                   • Extends HA Options
Data Node 3                    Data Node 4   • Active/Active with no
                                               need for conflict
                                               handling
Active/Active Geographic Replication

                       •Replicating complete
                       clusters across data
                       centers
                         • DR & data locality
                         • No passive resources
     Geographic
     Replication       •Simplified Active /
                       Active Replication
                         • Eliminates requirement
                           for application & schema
                           changes
                         • Transaction-level
                           rollback
Ease of Use
Simplified Provisioning & Maintenance
             User Privilege Consolidation




The existence, content and timing of future releases described here is included for information only and may be changed at Oracles discretion.
October 3rd, 2011
MySQL Cluster Manager
                Reducing TCO and creating a more agile, highly
                       available database environment



                                            Automated
                                           Management



                            Monitoring &                  High
                             Recovery                   Availability
                                                        Operation




Copyright 2011 Oracle Corporation                                      62
How Does MySQL Cluster Manager Help?
               Example: Initiating upgrade from MySQL Cluster 7.0 to 7.2


          Before MySQL Cluster Manager                     With MySQL Cluster Manager
        • 1 x preliminary check of cluster state           upgrade cluster --package=7.1 mycluster;
        • 8 x ssh commands per server
        • 8 x per-process stop commands
        • 4 x scp of configuration files (2 x mgmd & 2 x            Total: 1 Command -
          mysqld)
        • 8 x per-process start commands
                                                                   Unattended Operation
        • 8 x checks for started and re-joined processes   • Results
        • 8 x process completion verifications
        • 1 x verify completion of the whole cluster.          •   Reduces the overhead and complexity
        • Excludes manual editing of each configuration            of managing database clusters
          file.                                                •   Reduces the risk of downtime resulting
                                                                   from administrator error
               Total: 46 commands -                            •   Automates best practices in database
          2.5 hours of attended operation                          cluster management




Copyright 2011 Oracle Corporation                                                                      63
Bootstrap single host Cluster
       1. Download MCM from edelivery.oracle.com:
             •       Package including Cluster
       1. Unzip
       2. Run agent, define, create & start Cluster!
             $> binmcmd –bootstrap
             MySQL Cluster Manager 1.1.2 started
             Connect to MySQL Cluster Manager by running "D:AndrewDocumentsMySQLmcmbinmcm" -a NOVA:1862
             Configuring default cluster 'mycluster'...
             Starting default cluster 'mycluster'...
             Cluster 'mycluster' started successfully
              ndb_mgmd NOVA:1186
              ndbd NOVA
              ndbd NOVA
              mysqld NOVA:3306
              mysqld NOVA:3307
              ndbapi *
             Connect to the database by running "D:AndrewDocumentsMySQLmcmclusterbinmysql" -h NOVA -P 3306
                   -u root

       • Connect to Cluster & start using database
       To bootstrap with Cluster 7.2 replace contents of mcm/cluster directory
                 http://www.clusterdb.com/mysql-cluster/mysql-cluster-manager-1-1-2-creating-a-cluster-is-now-trivial




Copyright 2011 Oracle Corporation                                                                                       64
MySQL Enterprise Monitor 2.3




Copyright 2011 Oracle Corporation        65
Evaluate MySQL Cluster CGE
30-Day Trial
                 • Navigate to
                   http://edelivery.oracle.com/
                   and step through (selecting
                   “MySQL Database” as the
                   Product Pack)

                 • Select MySQL Cluster
                   Manager
Operational Best Practices




Copyright 2011 Oracle Corporation      67
When to Consider MySQL Cluster

    What are the consequences of downtime or failing to meet
    performance requirements?

    How much effort and $ is spent in developing and managing HA in
    your applications?

    Are you considering sharding your database to scale write
    performance? How does that impact your application and
    developers?

    Do your services need to be real-time?

    Will your services have unpredictable scalability demands,
    especially for writes ?

    Do you want the flexibility to manage your data
    with more than just SQL ?
Where would I not Use MySQL Cluster?
• “Hot” data sets >3TB
    • Replicate cold data to InnoDB
• Long running transactions
• Large rows, without using BLOBs
• Foreign Keys
    • Can use triggers to emulate:
    • http://dev.mysql.com/tech-resources/articles/mysql-enforcing-foreign-keys.html

•   Full table scans
•   Savepoints
•   Geo-Spatial indexes
•   InnoDB storage engine would be the right choice
                  MySQL Cluster Evaluation Guide
    http://mysql.com/why-mysql/white-papers/mysql_cluster_eval_guide.php
MySQL Cluster in Action
                   Web Reference Architectures
Session Management                                eCommerce                     Data       Content Management
                                                                               Refinery              Memcache / Application Servers




                MySQL Servers                         MySQL Servers
                                                                                                       MySQL Master

   Node Group 1           Node Group 2     Node Group 1         Node Group 2

                  F1               F2                   F1               F2                                                           Slave N
                                                                         F4


                                                              Node 3
                                                        F3
                                         Node 3




                                   F4
                        Node 3




                  F3
  Node 3




                  F1               F2                   F1               F2
                                                        F3               F4
                                                              Node 4

                                   F4
                                         Node 4




                  F3
                                                                                                               Slave 8 Slave 9 Slave 10
                        Node 4
  Node 4




                                                                                          Slave 6   Slave 7
            MySQL Cluster Data Nodes              MySQL Cluster Data Nodes


                                                                                          Slave 1   Slave 2    Slave 3 Slave 4        Slave 5

• 4 x Data Nodes: 6k                                  Analytics
page hits per second                                MySQL Master                                              XOR
• Each page hit
generating 8 – 12
database operations

                                                                                                                       Distributed
                                                  Slave 1 Slave 2 Slave 3
                                                                                                                        Storage

           Whitepaper: http://www.mysql.com/why-mysql/white-papers/mysql_wp_high-availability_webrefarchs.php
World wide use
Case Studies
CUSTOMER PERSPECTIVE
                                                 “MySQL Cluster won the performance test hands-
   COMPANY OVERVIEW
                                                 down, and it fitted our needs perfectly. We
   • Leading provider of communications          evaluated shared-disk clustered databases, but the
     platforms, solutions & services             cost would have been at least 10x more.”
   • €15.2bn Revenues (2009), 77k employees                   -- François Leygues, Systems Manager
     across 130 countries


   CHALLENGES / OPPORTUNITIES
   • Converged services driving migration to       RESULTS
     next generation HLR / HSS systems             • Scale out on standard ATCA hardware to
   • New IMS platforms for Unified                   support 60m+ subscribers on a single
     Communications                                  platform
   • Reduce cost per subscriber and accelerate     • Low latency, high throughput with
     time to value                                   99.999%+ availability
                                                   • Enabled customers to reduce cost per
                                                     subscriber and improve margins
   SOLUTIONS                                       • Delivered data management solution at
   • MySQL Cluster Carrier Grade Edition             10x less cost than alternatives
   • MySQL Support & Consulting Services
http://www.mysql.com/why-mysql/case-studies/mysql-alcatel-casestudy.php
 http://www.mysql.com/why-mysql/case-studies/mysql-alcatel-casestudy.php
Shopatron: eCommerce Platform
                                       • Applications
                                            – Ecommerce back-end, user authentication,
                                              order data & fulfilment, payment data &
                                              inventory tracking. Supports several
                                              thousand queries per second

                                       • Key business benefits
                                            – Scale quickly and at low cost to meet
                                              demand
                                            – Self-healing architecture, reducing TCO

                                       • Why MySQL?
                                            – Low cost scalability
                                            – High read and write throughput
                                            – Extreme availability

“Since deploying MySQL Cluster as our eCommerce database, we have had
 continuous uptime with linear scalability enabling us to exceed our most stringent SLAs”
                                        — Sean Collier, CIO & COO, Shopatron Inc


          http://www.mysql.com/why-mysql/case-studies/mysql_cs_shopatron.php
           http://www.mysql.com/why-mysql/case-studies/mysql_cs_shopatron.php           76
COMPANY OVERVIEW                               CUSTOMER PERSPECTIVE
• Pyro provide comms technology solutions      ”MySQL Cluster 7.1 gave us the perfect combination
  in Core Network, OSS/BSS & VAS               of extreme levels of transaction throughput, low
• Deployed in 120+ networks worldwide          latency & carrier-grade availability. We also reduced
• Cell C, one of the largest mobile            TCO by being able to scale out on commodity server
  operators in South Africa                    blades and eliminate costly shared storage”
• 560 roaming partners in 186 countries        -- Phani Naik, Head of Technology at Pyro Group


CHALLENGES / OPPORTUNITIES
• FIFA 2010 world cup opens up network
  services to millions of mobile subscribers      RESULTS
• International roaming SDP to support up         • Supported subscriber and traffic volumes
  to 7m roaming subscribers per day               • Delivered continuous availability
• Offer local pricing with home network           • Implemented in 25% of the time of typical
  functionality                                     SDP solutions
• Minimize cost and time to market                • Choice in deployment platforms to eliminate
                                                    vendor lock-in (migrated from Microsoft)

SOLUTIONS
• MySQL Cluster 7.1 & Services
CUSTOMER PERSPECTIVE
                                            “Telenor has been using MySQL for fixed IP
COMPANY OVERVIEW                            management since 2003 and are extremely
• Leading telecoms provider across Europe   satisfied with its speed, availability and
  and Asia. Largest Nordic provider         flexibility. Now we also support mobile
• 184m subscribers (Q2, 2010)               and LTE IP management with our solution.
                                            Telenor has found MySQL Cluster to be
                                            the best performing database in the world
CHALLENGES / OPPORTUNITIES                  for our applications.”
• Extend OSS & BSS platforms for new
  mobile services and evolution to LTE      - Peter Eriksson, Manager, Network Provisioning
• OSS: IP Management & AAA
                                              RESULTS
• BSS: Subscriber Data Management &
  Customer Support                            • Launch new services with no downtime,
                                                due to on-line operations of MySQL
                                                Cluster
                                              • Consolidated database supports
SOLUTIONS                                       Subscriber Data Management initiatives
• MySQL Cluster                               • MySQL Cluster selected due to 99.999%
• MySQL Support Services                        availability, real time performance and
                                                linear scalability on commodity hardware
COMPANY OVERVIEW                              CUSTOMER PERSPECTIVE
• UK-based retail and wholesale ISP &         “Since deploying our latest AAA platform, the
  Hosting Services                            MySQL environment has delivered continuous
• 2010 awards for best home broadband         uptime, enabling us to exceed our most stringent
  and customer service                        SLAs”
• Acquired by BT in 2007                      -- Geoff Mitchell Network Engineer



CHALLENGES / OPPORTUNITIES
• Enter market for wholesale services,
  demanding more stringent SLAs
• Re-architect AAA systems for data             RESULTS
  integrity & continuous availability to        • Continuous system availability, exceeding
  support billing sytems                          wholesale SLAs
• Consolidate data to for ease of reporting     • 2x faster time to market for new services
  and operating efficiency
                                                • Agility and scale by separating database
• Fast time to market                             from applications
                                                • Improved management & infrastructure
                                                  efficiency through database consolidation
SOLUTIONS
• MySQL Cluster
• MySQL Server with InnoDB
COMPANY OVERVIEW                                  USER PERSPECTIVE
• Division of Docudesk                            “MySQL Cluster exceeds our requirements for low
                                                  latency, high throughput performance with
• Deliver Document Management SaaS
                                                  continuous availability, in a single solution that
                                                  minimizes complexity and overall cost.”
CHALLENGES / OPPORTUNITIES                          -- Casey Brown, Manager of Dev & DBA Services,
                                                                                               Docudesk
• Provide a single repository for customers to
  manage, archive, and distribute documents
• Implement scalable, fault tolerant, real time
  data management back-end                            RESULTS
• PHP session state cached for in-service             • Successfully deployed document
  personalization                                       management solution, eliminating paper
• Store document meta-data, text (as                    trails from legal processes
  BLOBs), ACL, job queues and billing data            • Integrate caching and database into one
• Data volumes growing at 2% per day                    layer, reducing complexity & cost
                                                      • Support workload with 50:50 read/write
                                                        ratio
SOLUTION                                              • Low latency for real-time user experience
• MySQL Cluster deployed on EC2                         and document time-stamping
                                                      • Continuous database availability
Getting Started
                                                     Learn More
                                    Scaling Web
                                    Databases
                                    Guide

                                    www.mysql.com/cluster/



           Evaluate MySQL Cluster 7.2                                    Bootstrap a Cluster!

                                                             Download, No
     Download Today                                          Obligation
     http://www.mysql.com/                                   https://edelivery.oracl
     downloads/cluster/                                      e.com/




Copyright 2011 Oracle Corporation                                                               81
Summary


                            Scale Web Services with
                                   Carrier-Grade Availability



                                    Don’t Trade Functionality for Scale



                                              Try it out Today!




Copyright 2011 Oracle Corporation                                         82
Tech Slide Back-up
Multi-threaded Data Node Extensions

                                                        • Scaling out on commodity
                                                          hardware is the standard
                     Application Nodes                    way to increase
                                                          performance
                                                           • Add more data nodes and




                                         Node 3
                                                             API nodes as required
                                                        • MySQL Cluster 7.2
Node 1




                                                          increases the ability to also
                                                          scale-up each data node
                                                           • Increases maximum
                                                             number of utilised threads
                                                             from 8 to 59
            Node 2




                                         Node 4




                                                           • Can deliver aX single
                                                             thread performance with
                                                             bX cores
          Node Group 1                   Node Group 2
Multi-threaded Data Node Extensions

                                         • Threads (post GA!):
                                           • recv: <= 8 Receive threads
         Application Nodes
                                           • tc: <= 24 Transaction
                                             Coordinator threads
                                           • ldm: <= 16 Local Query
                                             Handler threads
                                           • send: <= 8 Send threads
                                           • main: 1 Main thread
recv                   send    main        • rep: 1 Replication thread
                                           • io: 1 I/O thread
                                         • Engineering guidelines
                                           provided to find the best
 tc                     ldm   rep   io     configuration: ZXZX
Multi-threaded Data Node Extensions
ThreadConfig :=<entry> [ ,<entry> ] +

entry :=<type>={ [<param>   ]+ }
                                        • Note that extra send,
param := count = N   |
         cpubind = L |
                                          recv & tc threads
         cpuset = L                       will be part of post-
type := ldm | main | recv | rep |         GA maintenance
maint | send | tc | io                    release.
Example:
ThreadConfig=ldm={count=2,cpubind=1,2},
ldm={count=2,cpuset=6-9},
main={cpubind=12},rep={cpubind=11}
NoSQL with Memcached




• Flexible:                       set maidenhead 0 0 3
                                  SL6
  • Deployment options
                                     STORED
  • Multiple Clusters
  • Simultaneous SQL Access       get maidenhead
  • Can still cache in               VALUE maidenhead 0 3
    Memcached server                 SL6
  • Flat key-value store or map      END
    to multiple tables/columns
Multi-Site Clustering – changes to
 STONITH algorithm
• When heartbeat not received, all data nodes will be asked to
  ping all other data nodes
• Each node establishes its list of ‘suspect’ data nodes from whom
  they don’t receive a ping response within
  ConnectCheckIntervalDelay msecs
• If second period of ConnectCheckIntervalDelay passes
  without a ping response then each data node will send a Fail
  report to all data nodes naming its suspected node(s)
• On receipt of a Fail message from a suspect node, the receiving
  node will consider the originating node as failed rather than the
  requested target
• Leaves each side of the temporarily partitioned network with a
  viable set of data nodes and arbitration is used to select the
  surviving side if there is no longer a clear majority
Multi-Site Clustering – WAN engineering
 recommendations based on user experience

• (Obviously) the longer the latency between sites, the
  higher the impact to performance
• Target latency should be <= 10 ms; 20 ms
  acceptable
  • Test with 1000 byte packet, under load
• Bandwidth requirements dependent on traffic but aim
  for 1 Gbps+ (100 Mbps for low traffic Cluster)
• Simplest WAN topology possible (fewer points of
  failure/failover latency)
• Typical WAN failover times should be short enough
  not to trigger STONITH in Cluster
Active-Active Replication -   Detecting Conflicts
Active-Active Replication -   Detecting Conflicts
Active-Active Replication -   Detecting Conflicts
Active-Active Replication -   Detecting Conflicts
Active-Active Replication -   Detecting Conflicts
Geographic Replication – what’s
     changed in conflict resolution
• Reflecting GCI (Global Checkpoint Index) removes requirement for
  applications to maintain timestamp field in each potentially conflicting
  table
   • One of the two masters acts as the ‘primary’ and monitors all received
     replication events from the ‘secondary’ (including its own ‘reflected GCI’) to
     establish when changes not applied in same order on primary and secondary
     Clusters
   • Primary will then overwrite all conflicting transactions (or optionally just the
     conflicting rows) on the secondary – as well as subsequent transactions
     influenced by the conflict
• To use, set the function in mysql.ndb_replication to NDB$EPOCH()
  or NDB$EPOCH_TRANS()
• Overview & worked example: http://bit.ly/activeactive
• Gory details: http://bit.ly/refcgci
How to Push Privilege Data into Data
 Nodes
mysql> SOURCE /usr/local/mysql/share/mysql/ndb_dist_priv.sql;
mysql> CALL mysql.mysql_cluster_move_privileges();

mysql> SHOW CREATE TABLE mysql.userG
*************************** 1. row ***************************
Table: userCreate Table: CREATE TABLE `user` (
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
....
....
) ENGINE=ndbcluster DEFAULT CHARSET=utf8 COLLATE=utf8_bin
COMMENT='Users and global privileges‘


•Fully worked example:
http://www.clusterdb.com/mysql-cluster/sharing-user-credential
 (http://bit.ly/userpriv)
General Back-up Slides
Scale the Cluster
Capacity & Performance



                             Application Nodes



          Data Node 1                            Data Node2


Cluster                 F1                                    F2
Mgmt                    F2                                    F1


                                 Data Nodes
Scale the Cluster
Capacity & Performance



                          Application Nodes



           Node Group 1                       Node Group 2
          Node 1




                                              Node 3
Cluster              F1                                 F2   Cluster
Mgmt                 F3                                 F4   Mgmt
          Node 2




                                              Node 4
                     F3                                 F4
                     F1                                 F2
                              Data Nodes
Node Failure Detection & Self-Healing Recovery
On-Line Scaling & Maintenance
                                 1. New node group added
                                 2. Data is re-partitioned
                                 3. Redundant data is deleted
                                 4. Distribution is switched to share
                                    load with new node group




•   Can also update schema on-
    line
•   Upgrade hardware &
    software with no downtime
•   Perform back-ups on-line
Only MySQL Can…..

blend the agility & innovation of the web….




….with the trust & capability of the network.
No Trade-Offs: eCommerce
                        • Integrated Service Provider
                          platform
                           • eCommerce
                           • Payment processing
                           • Fulfillment
                        • Supports 1k+ manufacturers &
                          18k retail partners
                        • Requirements
                           •   Scaling, On-Demand
                           •   HA: failures & on-line upgrades
                           •   High batch & real time loads
                           •   Low TCO: capex and opex
      http://mysql.com/customers/view/?id=1080
No Trade-Offs: Flight Control
                             • US Navy aircraft carriers
                             • Consolidated flight operations
                               management system
                                •   Maintenance records
                                •   Fuel loads
                                •   Weather conditions
                                •   Flight deck plans
                             • Requirements
                                • No Single Points of Failure
                                • Complete redundancy
                                • Small footprint, harsh environment
                             • 4 x MySQL Cluster nodes,
                               Linux and Windows

   MySQL User Conference Session: http://bit.ly/ogeid3
Creating & running your first Cluster
           - the “manual” way (without MCM)




• Up & running in 10-15 minutes using Quick Start guides from
  http://dev.mysql.com/downloads/cluster/
    • Versions for Linux, Windows & Solaris



 Copyright 2011 Oracle Corporation                              106
ACID Compliant Relational Database
 • SQL & NoSQL interfaces



Write-Scalable & Real-Time
 • Distributed, multi-master, auto-sharding, optimized in-memory structures & indices



99.999% Availability
 • Shared-nothing, integrated clustering & sub-second recovery, local & geographic
   replication, on-line operations



Low Barriers to Entry
 • Open-source, elastic, multiple APIs, management tools, commodity hardware

Mais conteúdo relacionado

Mais procurados

MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
 
ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022René Cannaò
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQLMydbops
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기NeoClova
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat
WebSphere App Server vs JBoss vs WebLogic vs TomcatWebSphere App Server vs JBoss vs WebLogic vs Tomcat
WebSphere App Server vs JBoss vs WebLogic vs TomcatWASdev Community
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)Mydbops
 
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Miguel Araújo
 
Concurrency Control in MongoDB 3.0
Concurrency Control in MongoDB 3.0Concurrency Control in MongoDB 3.0
Concurrency Control in MongoDB 3.0MongoDB
 
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11Kenny Gryp
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxNeoClova
 
Security Patterns for Microservice Architectures
Security Patterns for Microservice ArchitecturesSecurity Patterns for Microservice Architectures
Security Patterns for Microservice ArchitecturesVMware Tanzu
 
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...Amazon Web Services
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestI Goo Lee
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례I Goo Lee
 
OpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesOpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesSamuel Terburg
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centersMariaDB plc
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityOSSCube
 
MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetesrockplace
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 

Mais procurados (20)

MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기Maria db 이중화구성_고민하기
Maria db 이중화구성_고민하기
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat
WebSphere App Server vs JBoss vs WebLogic vs TomcatWebSphere App Server vs JBoss vs WebLogic vs Tomcat
WebSphere App Server vs JBoss vs WebLogic vs Tomcat
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)
 
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
 
Automated master failover
Automated master failoverAutomated master failover
Automated master failover
 
Concurrency Control in MongoDB 3.0
Concurrency Control in MongoDB 3.0Concurrency Control in MongoDB 3.0
Concurrency Control in MongoDB 3.0
 
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
 
Security Patterns for Microservice Architectures
Security Patterns for Microservice ArchitecturesSecurity Patterns for Microservice Architectures
Security Patterns for Microservice Architectures
 
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software Test
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례
 
OpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetesOpenShift Enterprise 3.1 vs kubernetes
OpenShift Enterprise 3.1 vs kubernetes
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetes
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 

Destaque

MySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinarMySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinarAndrew Morgan
 
Oracle my sql cluster cge
Oracle my sql cluster cgeOracle my sql cluster cge
Oracle my sql cluster cgeseungdon1
 
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous AvailabilityRamp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous AvailabilityPythian
 
MySQL Cluster performance best practices
MySQL Cluster performance best practicesMySQL Cluster performance best practices
MySQL Cluster performance best practicesMat Keep
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMatt Lord
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High AvailabilityColin Charles
 
eBay Architecture
eBay Architecture eBay Architecture
eBay Architecture Tony Ng
 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksPhill Sparks
 
Building a Big Data & Analytics Platform using AWS
Building a Big Data & Analytics Platform using AWS Building a Big Data & Analytics Platform using AWS
Building a Big Data & Analytics Platform using AWS Amazon Web Services
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environmentDavid Landgren
 

Destaque (12)

MySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinarMySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinar
 
Oracle my sql cluster cge
Oracle my sql cluster cgeOracle my sql cluster cge
Oracle my sql cluster cge
 
MySQL overview
MySQL overviewMySQL overview
MySQL overview
 
MySQL cluster 7.4
MySQL cluster 7.4 MySQL cluster 7.4
MySQL cluster 7.4
 
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous AvailabilityRamp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
Ramp-Tutorial for MYSQL Cluster - Scaling with Continuous Availability
 
MySQL Cluster performance best practices
MySQL Cluster performance best practicesMySQL Cluster performance best practices
MySQL Cluster performance best practices
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an Overview
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
eBay Architecture
eBay Architecture eBay Architecture
eBay Architecture
 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill Sparks
 
Building a Big Data & Analytics Platform using AWS
Building a Big Data & Analytics Platform using AWS Building a Big Data & Analytics Platform using AWS
Building a Big Data & Analytics Platform using AWS
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environment
 

Semelhante a MySQL Cluster Scaling to a Billion Queries

MySQL NDB Cluster 101
MySQL NDB Cluster 101MySQL NDB Cluster 101
MySQL NDB Cluster 101Bernd Ocklin
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerSQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerMichael Rys
 
NewSQL - Deliverance from BASE and back to SQL and ACID
NewSQL - Deliverance from BASE and back to SQL and ACIDNewSQL - Deliverance from BASE and back to SQL and ACID
NewSQL - Deliverance from BASE and back to SQL and ACIDTony Rogerson
 
Experience sql server on l inux and docker
Experience sql server on l inux and dockerExperience sql server on l inux and docker
Experience sql server on l inux and dockerBob Ward
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydbDaniel Austin
 
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 KubernetesBernd Ocklin
 
CodeFutures - Scaling Your Database in the Cloud
CodeFutures - Scaling Your Database in the CloudCodeFutures - Scaling Your Database in the Cloud
CodeFutures - Scaling Your Database in the CloudRightScale
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Javasunnygleason
 
My Sql And Search At Craigslist
My Sql And Search At CraigslistMy Sql And Search At Craigslist
My Sql And Search At CraigslistMySQLConference
 
Clustrix Database Percona Ruby on Rails benchmark
Clustrix Database Percona Ruby on Rails benchmarkClustrix Database Percona Ruby on Rails benchmark
Clustrix Database Percona Ruby on Rails benchmarkClustrix
 
NoSQL Intro with cassandra
NoSQL Intro with cassandraNoSQL Intro with cassandra
NoSQL Intro with cassandraBrian Enochson
 
Aruman Cassandra database
Aruman Cassandra databaseAruman Cassandra database
Aruman Cassandra databaseUmesh Dande
 
Deliver Big Data, Database and AI/ML as-a-Service anywhere
Deliver Big Data, Database and AI/ML as-a-Service anywhereDeliver Big Data, Database and AI/ML as-a-Service anywhere
Deliver Big Data, Database and AI/ML as-a-Service anywhereRavikumar Alluboyina
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityNOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityIvan Zoratti
 
Streaming Analytics with Spark, Kafka, Cassandra and Akka by Helena Edelson
Streaming Analytics with Spark, Kafka, Cassandra and Akka by Helena EdelsonStreaming Analytics with Spark, Kafka, Cassandra and Akka by Helena Edelson
Streaming Analytics with Spark, Kafka, Cassandra and Akka by Helena EdelsonSpark Summit
 
Kafka spark cassandra webinar feb 16 2016
Kafka spark cassandra   webinar feb 16 2016 Kafka spark cassandra   webinar feb 16 2016
Kafka spark cassandra webinar feb 16 2016 Hiromitsu Komatsu
 
Kafka spark cassandra webinar feb 16 2016
Kafka spark cassandra   webinar feb 16 2016 Kafka spark cassandra   webinar feb 16 2016
Kafka spark cassandra webinar feb 16 2016 Hiromitsu Komatsu
 
Pythian: My First 100 days with a Cassandra Cluster
Pythian: My First 100 days with a Cassandra ClusterPythian: My First 100 days with a Cassandra Cluster
Pythian: My First 100 days with a Cassandra ClusterDataStax Academy
 

Semelhante a MySQL Cluster Scaling to a Billion Queries (20)

MySQL NDB Cluster 101
MySQL NDB Cluster 101MySQL NDB Cluster 101
MySQL NDB Cluster 101
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerSQL and NoSQL in SQL Server
SQL and NoSQL in SQL Server
 
NewSQL - Deliverance from BASE and back to SQL and ACID
NewSQL - Deliverance from BASE and back to SQL and ACIDNewSQL - Deliverance from BASE and back to SQL and ACID
NewSQL - Deliverance from BASE and back to SQL and ACID
 
Experience sql server on l inux and docker
Experience sql server on l inux and dockerExperience sql server on l inux and docker
Experience sql server on l inux and docker
 
BigData Developers MeetUp
BigData Developers MeetUpBigData Developers MeetUp
BigData Developers MeetUp
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
 
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
 
CodeFutures - Scaling Your Database in the Cloud
CodeFutures - Scaling Your Database in the CloudCodeFutures - Scaling Your Database in the Cloud
CodeFutures - Scaling Your Database in the Cloud
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
My Sql And Search At Craigslist
My Sql And Search At CraigslistMy Sql And Search At Craigslist
My Sql And Search At Craigslist
 
Clustrix Database Percona Ruby on Rails benchmark
Clustrix Database Percona Ruby on Rails benchmarkClustrix Database Percona Ruby on Rails benchmark
Clustrix Database Percona Ruby on Rails benchmark
 
NoSQL Intro with cassandra
NoSQL Intro with cassandraNoSQL Intro with cassandra
NoSQL Intro with cassandra
 
MYSQL
MYSQLMYSQL
MYSQL
 
Aruman Cassandra database
Aruman Cassandra databaseAruman Cassandra database
Aruman Cassandra database
 
Deliver Big Data, Database and AI/ML as-a-Service anywhere
Deliver Big Data, Database and AI/ML as-a-Service anywhereDeliver Big Data, Database and AI/ML as-a-Service anywhere
Deliver Big Data, Database and AI/ML as-a-Service anywhere
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityNOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
 
Streaming Analytics with Spark, Kafka, Cassandra and Akka by Helena Edelson
Streaming Analytics with Spark, Kafka, Cassandra and Akka by Helena EdelsonStreaming Analytics with Spark, Kafka, Cassandra and Akka by Helena Edelson
Streaming Analytics with Spark, Kafka, Cassandra and Akka by Helena Edelson
 
Kafka spark cassandra webinar feb 16 2016
Kafka spark cassandra   webinar feb 16 2016 Kafka spark cassandra   webinar feb 16 2016
Kafka spark cassandra webinar feb 16 2016
 
Kafka spark cassandra webinar feb 16 2016
Kafka spark cassandra   webinar feb 16 2016 Kafka spark cassandra   webinar feb 16 2016
Kafka spark cassandra webinar feb 16 2016
 
Pythian: My First 100 days with a Cassandra Cluster
Pythian: My First 100 days with a Cassandra ClusterPythian: My First 100 days with a Cassandra Cluster
Pythian: My First 100 days with a Cassandra Cluster
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

MySQL Cluster Scaling to a Billion Queries

  • 1. MySQL Cluster Scaling to Billion Database Queries with MySQL Cluster Bernd Ocklin MySQL Cluster Engineering bernd.ocklin@oracle.com
  • 2. Servicing the Most Performance-Intensive Workloads
  • 3. Program Agenda <Insert Picture Here> • Databases Are Exciting Again!!! • Overview of MySQL Cluster • MySQL Cluster - What’s New • How is it used?
  • 4. A converging world ... Information Banking Social Messaging Networking Multi- Gaming Media
  • 5. 2.1BN USERS 8X DATA GROWTH IN 5 YRS 850M USERS 70+ NEW DOMAINS EVERY 60 SECONDS 20M APPS PER DAY 40% DATA GROWTH PER YEAR 1 TR VIDEO PLAYBACKS $1TR BY 2014 250m TWEETS PER DAY $700BN IN 2011 5.9BN MOBILE SUBS IN 2011 1 BILLION iOS & ANDROID APPS 370K CALL MINUTES EVERY 60 SECONDS DOWNLOADED PER WEEK
  • 6. Driving new Database Requirements EXTREME WRITE SCALABILITY REAL TIME USER EXPERIENCE ROCK SOLID RELIABILITY RAPID SERVICE INNOVATION
  • 7. No Trade-Offs: Cellular Network HLR / HSS Location Updates AuC, Call Routing, Billing Pre & Post Paid • Massive volumes of write traffic • <3ms database response • Downtime & lost transactions = lost $ Billing, AuC, MySQL Cluster in Action: http://bit.ly/oRI5tF VLR
  • 8. No Trade-Offs Transactional Integrity Complex REAL TIME USER EXPERIENCE EXTREME WRITE SCALABILITY Queries Standards & Skillsets ROCK SOLID RELIABILITY ELIMNATE BARRIERS TO ENTRY
  • 9. MySQL Cluster – Users & Applications Extreme Scalability, Availability and Affordability • Web • High volume OLTP • eCommerce • User Profile Management • Session Management & Caching • Content Management • On-Line Gaming • Telecoms • Subscriber Databases (HLR / HSS) • Service Delivery Platforms • VAS: VoIP, IPTV & VoD • Mobile Content Delivery • Mobile Payments • LTE Access http://www.mysql.com/customers/cluster/
  • 10. Key Benefits Scaling Auto-sharding + Multi-master Reads & Writes Transactional, ACID-compliant relational database 99.999% Shared-nothing design, no Single Point of Failure Availability On-Line operations: Scale, Upgrade Schema, etc. Real-Time High-load, real-time performance Responsiveness Predictable low latency, bounded access times Complex, relational queries + Key/Value Access SQL & NoSQL APIs MySQL, Memcached, C++, Java, JPA, HTTP / REST Low TCO, GPL & Commercial editions Open platform Commodity hardware, management & monitoring tools
  • 11. Basic architectures 2-tier Data access Application Logic Front-End Data Indexes
  • 12. Basic architectures 3-tier SQL, JDBC, Front-End ADO, ... Application Logic Data access (e.g. SQL engine) Data Indexes
  • 13. Basic architectures 4-tier Front-End Application Logic Data access (e.g. SQL engine) Data Indexes
  • 14. All services share the same data view native ClusterJ REST/JSON LDAP memcached SQL, JDBC, ADO, ... NDB API MySQL Cluster Data Nodes
  • 15. C++ example     NdbOperation *op = trx­>getNdbOperation(myTable);     op­>insertTuple();     op­>equal("key", i);     op­>setValue("value", &value);     trx­>execute( NdbTransaction::Commit );
  • 16. Java example Character newCharacter =  session.newInstance(Character.class); newCharacter.setName(„Yoda“); newCharacter.setAttributes(„Force“); Session.persist(newCharacter);
  • 17. SQL example (requires MySQL Server) Mysql> INSERT INTO Charaters (Name, Attributes)  VALUES („Yoda“, „Force“);
  • 18. High performance and Scalability Cluster is • Distributed • Event Driven • Asynchronous • Parallel • Non-locking
  • 19. Your friends / Your enemies • Disks (life-saver) • Disks (slow fsync) • CPU cache • Network latency • RAM • Heap allocation • Many cores • NUMA • Context switching
  • 20. Use your friends Disks (your job saver) – Log your data to disk (asynchrounsly) CPU cache – Align to to it RAM – Preallocate! Many cores – Distribute to cores (have a model that supports this)
  • 21. Avoid your enemies Disks – Reduce fsyncs – no swapping Network latency – Reduce network round trips Slow heap allocation – Pre-allocate all memory, avoid using it NUMA – Disable it Context switching – Lock to cores – Get network interrupts out of your way
  • 22. MySQL Cluster – A distributed hash table 17 Yoda 143 Albert 12 Bernd 42 Ernest md5() % <no of nodes> MySQL Cluster Data Nodes 17 Yoda 12 Bernd 143 Ernest 143 Albert
  • 23. Best Practice : Primary Keys • ALWAYS DEFINE A PRIMARY KEY ON THE TABLE! • A hidden PRIMARY KEY is added if no PK is specified. BUT.. • .. NOT recommended • The hidden primary key is for example not replicated (between Clusters)!! • There are problems in this area, so avoid the problems! • So always, at least have id BIGINT AUTO_INCREMENT PRIMARY KEY • Even if you don't “need” it for you applications
  • 24. Auto-Sharding (distribution) Application [ {id: 12, name: Bernd}, {id: 143, name: Albert}, {id: 42, name: Ernest}, …, {id: 17, name: Yoda}] {id: 17, … } {id: 143, … } {id: 42, … } {id: 12, … } MySQL Cluster Data Nodes
  • 25. Auto-Sharding (distribution) – Application “knows“ the data location Application find({id: 12}) {id: 12, name: Bernd} MySQL Cluster Data Nodes
  • 26. Auto-Sharding • Transparent to the application and data access layer • No need for application-layer sharding logic – build into the API & kernel • Partitioning based on hashing all or part of the primary key • Each node stores primary fragment for 1 partition and back-up fragment for another • Transparency maintained during failover, upgrades and scale-out • No need to limit application to single-shard transactions
  • 27. Adding High Availability – Introducing Node Groups Application [ {id: 12, name: Bernd}, {id: 143, name: Albert}, {id: 42, name: Ernest}, …, {id: 17, name: Yoda}] {id: 17, … } {id: 143, … } {id: 42, … } {id: 12, … } MySQL Cluster Data Nodes
  • 28. Adding High Availability - Synchronous Replication Application [ {id: 12, name: Bernd}, {id: 143, name: Albert}, {id: 42, name: Ernest}, …, {id: 17, name: Yoda}] {id: 17, … } {id: 143, … } {id: 42, … } {id: 12, … } MySQL Cluster Data Nodes
  • 29. Adding High Availability – Synchronous Replication 17 Yoda 12 Bernd 42 Ernest 143 Albert 12 Bernd 17 Yoda 143 Albert 42 Ernest
  • 30. Handling Scheduled Maintenance On-Line Operations • Scale the cluster (add & remove nodes on-line) • Repartition tables • Upgrade / patch servers & OS • Upgrade / patch MySQL Cluster • Back-Up • Evolve the schema on-line, in real-time
  • 31. Adding disk durability Memory {id: 17, … } In-memory tables Data kept in memory but complemented by logging to disk. Disk Disk based tables Data kept on disk but cached in memory. Logging to disk is decoupled from transaction writing.
  • 32. Shared Nothing SQL, JDBC, ADO, ... No shared components. Cheap commodity hardware. Proper SAN acceptable but expensive.
  • 33. Adding High Availability – Extreme resilience Application Service continuing MySQL Cluster Data Nodes
  • 34. Event driven & asynchronous find(17, {}); {id: 17, name: Albert} {id: 17} {name: Albert} TC LQH ACC TUP
  • 35. Doing things in parallel find(17, {}); find([12, 17], {}); MySQL Cluster Data Nodes
  • 36. Doing things in parallel find(17, {}); {id: 17, name: Albert} TC LQH {id: 17} {name: Albert} TC TC LQH LQH TC TC LQH LQH ACC TUP x16 x16
  • 37. Doing things in parallel • Primary key reads can be directed to the correct shard on the API application level – No waste of resources by doing same operation on all • Each data node can handle up to 16 operations in parallel • One data node can fully utilize up to 51 physical CPU cores
  • 38. Scaleable & Elastic – Increasing capacity in seconds Application Data Nodes
  • 39. Basic Deployments 1 Data Node SQL, JDBC, Front-End ADO, ... Application Logic Data Access Data Indexes
  • 40. Basic Deployments Start scaling with 2 Data Nodes SQL, JDBC, Front-End ADO, ... Application Logic Data Access ● Shared Data View ● Automated Load Balancing Data Indexes
  • 41. Basic Deployments Continue Scaling SQL, JDBC, ADO, ... SQL, JDBC, Front-End ADO, ... Application Logic OS, App or Hardware Load Data access Balancing (e.g. SQL engine) Automated Load Balancing Data Indexes
  • 42. Basic Deployments Scale on 3 levels SQL, JDBC, ADO, ... Front-End SQL, JDBC, Application Logic ADO, ... Data access (e.g. SQL engine) Data Indexes
  • 43. Typical Deployments 2 Server Application SQL, JDBC, ADO, ... Web Server MySQL Server Data Nodes Server 1 Server 2
  • 44. Typical Deployments 4 Server Application SQL, JDBC, ADO, ... Server 3 Server 4 Web Server MySQL Server Data Nodes Server 1 Server 2
  • 45. Typical Deployments Geo Replication SQL, JDBC, ADO, ... Server 3 Server 4 Server 3 Server 4 Server 1 Server 2 Server 1 Server 2
  • 47. READS Million / minute 1.200 1.056 1.000 800 • 8 x Commodity Intel Servers 600 • 2 x 6-core processors 2.93GHz 400 200 • x5670 processors (24 threads 0 per total) 2 node 4 node 8 node • 48GB RAM UPDATE • Linux Million / minute 120 109 100 • Infiniband networking 80 60 • flexAsynch benchmark 40 • C++ NoSQL API (NDB API) 20 0 4 node 8 node
  • 48. Adaptive Query Localization Scaling Distributed Joins 70x More Performance • Perform Complex Queries mysqld across Shards • JOINs pushed down to data nodes A Data Nodes • Executed in parallel Q • Returns single result set to MySQL L • Opens Up New Use-Cases • Real-time analytics • Recommendations engines mysqld • Analyze click-streams Data Nodes DON’T COMPROMISE FUNCTIONALITY TO SCALE-OUT !!
  • 49. MySQL Cluster 7.2 AQL Test Query Web-Based Content Management System MySQL Server Data Data Node1 Node2 Copyright 2011 Oracle Corporation 49
  • 50. Web-Based CMS 70x More Performance 87.23 seconds 1.26 seconds Must Analyze tables for best results mysql> ANALYZE TABLE <tab-name>;
  • 51. Memcached Key-Value API • Persistent, Scalable, HA Back-End to memcached • No application changes: re- uses standard memcached clients & libraries • Consolidate Caching & Database Tiers • Eliminate cache invalidation • Simpler re-use of data across services • Improved service levels New • Flexible Deployment NoSQL • Schema or Schema-less Access storage
  • 52. Schema-Free apps • Rapid application evolution • New types of data constantly added • No time to get schema extended • Missing skills to extend schema • Initially roll out to just a few users • Constantly adding to live system Copyright 2011 Oracle Corporation 52
  • 53. Cluster & Memcached – Schema-Free key value <town:maidenhead,SL6> Application view SQL view key value <town:maidenhead,SL6> generic table
  • 54. Cluster & Memcached – Configured Schema key value <town:maidenhead,SL6> Application view SQL view prefix key value <town:maidenhead,SL6> Config tables map.zip
  • 55. SQL & NoSQL Clients JDBC / ODBC PHP / PERL Native memcached HTTP/REST Python / Ruby NDB API Data Nodes Mix • SQL: Complex, relational queries & • Memcached: Key-Value web services Match • Java: Enterprise Apps • NDB API: Real-time services
  • 56. MySQL 5.5 Server Integration • Configure storage engine per-table • Choose the right tool for the job • InnoDB: Foreign Keys, XA Transactions, Large Rows • MySQL Cluster: HA, High Write Rates, Real- Time • Reduces Complexity, Simplifies DevOps • Take advantage of MySQL 5.5 • 3x higher performance • Improved partitioning, diagnostics, availability, etc.
  • 57. Cross Data Center Scalability
  • 58. Multi-Site Clustering • Split data nodes across data centers • Synchronous replication Node Group 1 and auto-failover between Data Node 1 Data Node 2 sites Synchronous Synchronous Replication Replication • Improved heartbeating to handle network partitions Node Group 2 • Extends HA Options Data Node 3 Data Node 4 • Active/Active with no need for conflict handling
  • 59. Active/Active Geographic Replication •Replicating complete clusters across data centers • DR & data locality • No passive resources Geographic Replication •Simplified Active / Active Replication • Eliminates requirement for application & schema changes • Transaction-level rollback
  • 61. Simplified Provisioning & Maintenance User Privilege Consolidation The existence, content and timing of future releases described here is included for information only and may be changed at Oracles discretion. October 3rd, 2011
  • 62. MySQL Cluster Manager Reducing TCO and creating a more agile, highly available database environment Automated Management Monitoring & High Recovery Availability Operation Copyright 2011 Oracle Corporation 62
  • 63. How Does MySQL Cluster Manager Help? Example: Initiating upgrade from MySQL Cluster 7.0 to 7.2 Before MySQL Cluster Manager With MySQL Cluster Manager • 1 x preliminary check of cluster state upgrade cluster --package=7.1 mycluster; • 8 x ssh commands per server • 8 x per-process stop commands • 4 x scp of configuration files (2 x mgmd & 2 x Total: 1 Command - mysqld) • 8 x per-process start commands Unattended Operation • 8 x checks for started and re-joined processes • Results • 8 x process completion verifications • 1 x verify completion of the whole cluster. • Reduces the overhead and complexity • Excludes manual editing of each configuration of managing database clusters file. • Reduces the risk of downtime resulting from administrator error Total: 46 commands - • Automates best practices in database 2.5 hours of attended operation cluster management Copyright 2011 Oracle Corporation 63
  • 64. Bootstrap single host Cluster 1. Download MCM from edelivery.oracle.com: • Package including Cluster 1. Unzip 2. Run agent, define, create & start Cluster! $> binmcmd –bootstrap MySQL Cluster Manager 1.1.2 started Connect to MySQL Cluster Manager by running "D:AndrewDocumentsMySQLmcmbinmcm" -a NOVA:1862 Configuring default cluster 'mycluster'... Starting default cluster 'mycluster'... Cluster 'mycluster' started successfully ndb_mgmd NOVA:1186 ndbd NOVA ndbd NOVA mysqld NOVA:3306 mysqld NOVA:3307 ndbapi * Connect to the database by running "D:AndrewDocumentsMySQLmcmclusterbinmysql" -h NOVA -P 3306 -u root • Connect to Cluster & start using database To bootstrap with Cluster 7.2 replace contents of mcm/cluster directory http://www.clusterdb.com/mysql-cluster/mysql-cluster-manager-1-1-2-creating-a-cluster-is-now-trivial Copyright 2011 Oracle Corporation 64
  • 65. MySQL Enterprise Monitor 2.3 Copyright 2011 Oracle Corporation 65
  • 66. Evaluate MySQL Cluster CGE 30-Day Trial • Navigate to http://edelivery.oracle.com/ and step through (selecting “MySQL Database” as the Product Pack) • Select MySQL Cluster Manager
  • 67. Operational Best Practices Copyright 2011 Oracle Corporation 67
  • 68. When to Consider MySQL Cluster  What are the consequences of downtime or failing to meet performance requirements?  How much effort and $ is spent in developing and managing HA in your applications?  Are you considering sharding your database to scale write performance? How does that impact your application and developers?  Do your services need to be real-time?  Will your services have unpredictable scalability demands, especially for writes ?  Do you want the flexibility to manage your data with more than just SQL ?
  • 69. Where would I not Use MySQL Cluster? • “Hot” data sets >3TB • Replicate cold data to InnoDB • Long running transactions • Large rows, without using BLOBs • Foreign Keys • Can use triggers to emulate: • http://dev.mysql.com/tech-resources/articles/mysql-enforcing-foreign-keys.html • Full table scans • Savepoints • Geo-Spatial indexes • InnoDB storage engine would be the right choice MySQL Cluster Evaluation Guide http://mysql.com/why-mysql/white-papers/mysql_cluster_eval_guide.php
  • 70. MySQL Cluster in Action Web Reference Architectures Session Management eCommerce Data Content Management Refinery Memcache / Application Servers MySQL Servers MySQL Servers MySQL Master Node Group 1 Node Group 2 Node Group 1 Node Group 2 F1 F2 F1 F2 Slave N F4 Node 3 F3 Node 3 F4 Node 3 F3 Node 3 F1 F2 F1 F2 F3 F4 Node 4 F4 Node 4 F3 Slave 8 Slave 9 Slave 10 Node 4 Node 4 Slave 6 Slave 7 MySQL Cluster Data Nodes MySQL Cluster Data Nodes Slave 1 Slave 2 Slave 3 Slave 4 Slave 5 • 4 x Data Nodes: 6k Analytics page hits per second MySQL Master XOR • Each page hit generating 8 – 12 database operations Distributed Slave 1 Slave 2 Slave 3 Storage Whitepaper: http://www.mysql.com/why-mysql/white-papers/mysql_wp_high-availability_webrefarchs.php
  • 72.
  • 73.
  • 75. CUSTOMER PERSPECTIVE “MySQL Cluster won the performance test hands- COMPANY OVERVIEW down, and it fitted our needs perfectly. We • Leading provider of communications evaluated shared-disk clustered databases, but the platforms, solutions & services cost would have been at least 10x more.” • €15.2bn Revenues (2009), 77k employees -- François Leygues, Systems Manager across 130 countries CHALLENGES / OPPORTUNITIES • Converged services driving migration to RESULTS next generation HLR / HSS systems • Scale out on standard ATCA hardware to • New IMS platforms for Unified support 60m+ subscribers on a single Communications platform • Reduce cost per subscriber and accelerate • Low latency, high throughput with time to value 99.999%+ availability • Enabled customers to reduce cost per subscriber and improve margins SOLUTIONS • Delivered data management solution at • MySQL Cluster Carrier Grade Edition 10x less cost than alternatives • MySQL Support & Consulting Services http://www.mysql.com/why-mysql/case-studies/mysql-alcatel-casestudy.php http://www.mysql.com/why-mysql/case-studies/mysql-alcatel-casestudy.php
  • 76. Shopatron: eCommerce Platform • Applications – Ecommerce back-end, user authentication, order data & fulfilment, payment data & inventory tracking. Supports several thousand queries per second • Key business benefits – Scale quickly and at low cost to meet demand – Self-healing architecture, reducing TCO • Why MySQL? – Low cost scalability – High read and write throughput – Extreme availability “Since deploying MySQL Cluster as our eCommerce database, we have had continuous uptime with linear scalability enabling us to exceed our most stringent SLAs” — Sean Collier, CIO & COO, Shopatron Inc http://www.mysql.com/why-mysql/case-studies/mysql_cs_shopatron.php http://www.mysql.com/why-mysql/case-studies/mysql_cs_shopatron.php 76
  • 77. COMPANY OVERVIEW CUSTOMER PERSPECTIVE • Pyro provide comms technology solutions ”MySQL Cluster 7.1 gave us the perfect combination in Core Network, OSS/BSS & VAS of extreme levels of transaction throughput, low • Deployed in 120+ networks worldwide latency & carrier-grade availability. We also reduced • Cell C, one of the largest mobile TCO by being able to scale out on commodity server operators in South Africa blades and eliminate costly shared storage” • 560 roaming partners in 186 countries -- Phani Naik, Head of Technology at Pyro Group CHALLENGES / OPPORTUNITIES • FIFA 2010 world cup opens up network services to millions of mobile subscribers RESULTS • International roaming SDP to support up • Supported subscriber and traffic volumes to 7m roaming subscribers per day • Delivered continuous availability • Offer local pricing with home network • Implemented in 25% of the time of typical functionality SDP solutions • Minimize cost and time to market • Choice in deployment platforms to eliminate vendor lock-in (migrated from Microsoft) SOLUTIONS • MySQL Cluster 7.1 & Services
  • 78. CUSTOMER PERSPECTIVE “Telenor has been using MySQL for fixed IP COMPANY OVERVIEW management since 2003 and are extremely • Leading telecoms provider across Europe satisfied with its speed, availability and and Asia. Largest Nordic provider flexibility. Now we also support mobile • 184m subscribers (Q2, 2010) and LTE IP management with our solution. Telenor has found MySQL Cluster to be the best performing database in the world CHALLENGES / OPPORTUNITIES for our applications.” • Extend OSS & BSS platforms for new mobile services and evolution to LTE - Peter Eriksson, Manager, Network Provisioning • OSS: IP Management & AAA RESULTS • BSS: Subscriber Data Management & Customer Support • Launch new services with no downtime, due to on-line operations of MySQL Cluster • Consolidated database supports SOLUTIONS Subscriber Data Management initiatives • MySQL Cluster • MySQL Cluster selected due to 99.999% • MySQL Support Services availability, real time performance and linear scalability on commodity hardware
  • 79. COMPANY OVERVIEW CUSTOMER PERSPECTIVE • UK-based retail and wholesale ISP & “Since deploying our latest AAA platform, the Hosting Services MySQL environment has delivered continuous • 2010 awards for best home broadband uptime, enabling us to exceed our most stringent and customer service SLAs” • Acquired by BT in 2007 -- Geoff Mitchell Network Engineer CHALLENGES / OPPORTUNITIES • Enter market for wholesale services, demanding more stringent SLAs • Re-architect AAA systems for data RESULTS integrity & continuous availability to • Continuous system availability, exceeding support billing sytems wholesale SLAs • Consolidate data to for ease of reporting • 2x faster time to market for new services and operating efficiency • Agility and scale by separating database • Fast time to market from applications • Improved management & infrastructure efficiency through database consolidation SOLUTIONS • MySQL Cluster • MySQL Server with InnoDB
  • 80. COMPANY OVERVIEW USER PERSPECTIVE • Division of Docudesk “MySQL Cluster exceeds our requirements for low latency, high throughput performance with • Deliver Document Management SaaS continuous availability, in a single solution that minimizes complexity and overall cost.” CHALLENGES / OPPORTUNITIES -- Casey Brown, Manager of Dev & DBA Services, Docudesk • Provide a single repository for customers to manage, archive, and distribute documents • Implement scalable, fault tolerant, real time data management back-end RESULTS • PHP session state cached for in-service • Successfully deployed document personalization management solution, eliminating paper • Store document meta-data, text (as trails from legal processes BLOBs), ACL, job queues and billing data • Integrate caching and database into one • Data volumes growing at 2% per day layer, reducing complexity & cost • Support workload with 50:50 read/write ratio SOLUTION • Low latency for real-time user experience • MySQL Cluster deployed on EC2 and document time-stamping • Continuous database availability
  • 81. Getting Started Learn More Scaling Web Databases Guide www.mysql.com/cluster/ Evaluate MySQL Cluster 7.2 Bootstrap a Cluster! Download, No Download Today Obligation http://www.mysql.com/ https://edelivery.oracl downloads/cluster/ e.com/ Copyright 2011 Oracle Corporation 81
  • 82. Summary Scale Web Services with Carrier-Grade Availability Don’t Trade Functionality for Scale Try it out Today! Copyright 2011 Oracle Corporation 82
  • 83.
  • 85. Multi-threaded Data Node Extensions • Scaling out on commodity hardware is the standard Application Nodes way to increase performance • Add more data nodes and Node 3 API nodes as required • MySQL Cluster 7.2 Node 1 increases the ability to also scale-up each data node • Increases maximum number of utilised threads from 8 to 59 Node 2 Node 4 • Can deliver aX single thread performance with bX cores Node Group 1 Node Group 2
  • 86. Multi-threaded Data Node Extensions • Threads (post GA!): • recv: <= 8 Receive threads Application Nodes • tc: <= 24 Transaction Coordinator threads • ldm: <= 16 Local Query Handler threads • send: <= 8 Send threads • main: 1 Main thread recv send main • rep: 1 Replication thread • io: 1 I/O thread • Engineering guidelines provided to find the best tc ldm rep io configuration: ZXZX
  • 87. Multi-threaded Data Node Extensions ThreadConfig :=<entry> [ ,<entry> ] + entry :=<type>={ [<param> ]+ } • Note that extra send, param := count = N | cpubind = L | recv & tc threads cpuset = L will be part of post- type := ldm | main | recv | rep | GA maintenance maint | send | tc | io release. Example: ThreadConfig=ldm={count=2,cpubind=1,2}, ldm={count=2,cpuset=6-9}, main={cpubind=12},rep={cpubind=11}
  • 88. NoSQL with Memcached • Flexible: set maidenhead 0 0 3 SL6 • Deployment options STORED • Multiple Clusters • Simultaneous SQL Access get maidenhead • Can still cache in VALUE maidenhead 0 3 Memcached server SL6 • Flat key-value store or map END to multiple tables/columns
  • 89. Multi-Site Clustering – changes to STONITH algorithm • When heartbeat not received, all data nodes will be asked to ping all other data nodes • Each node establishes its list of ‘suspect’ data nodes from whom they don’t receive a ping response within ConnectCheckIntervalDelay msecs • If second period of ConnectCheckIntervalDelay passes without a ping response then each data node will send a Fail report to all data nodes naming its suspected node(s) • On receipt of a Fail message from a suspect node, the receiving node will consider the originating node as failed rather than the requested target • Leaves each side of the temporarily partitioned network with a viable set of data nodes and arbitration is used to select the surviving side if there is no longer a clear majority
  • 90. Multi-Site Clustering – WAN engineering recommendations based on user experience • (Obviously) the longer the latency between sites, the higher the impact to performance • Target latency should be <= 10 ms; 20 ms acceptable • Test with 1000 byte packet, under load • Bandwidth requirements dependent on traffic but aim for 1 Gbps+ (100 Mbps for low traffic Cluster) • Simplest WAN topology possible (fewer points of failure/failover latency) • Typical WAN failover times should be short enough not to trigger STONITH in Cluster
  • 91. Active-Active Replication - Detecting Conflicts
  • 92. Active-Active Replication - Detecting Conflicts
  • 93. Active-Active Replication - Detecting Conflicts
  • 94. Active-Active Replication - Detecting Conflicts
  • 95. Active-Active Replication - Detecting Conflicts
  • 96. Geographic Replication – what’s changed in conflict resolution • Reflecting GCI (Global Checkpoint Index) removes requirement for applications to maintain timestamp field in each potentially conflicting table • One of the two masters acts as the ‘primary’ and monitors all received replication events from the ‘secondary’ (including its own ‘reflected GCI’) to establish when changes not applied in same order on primary and secondary Clusters • Primary will then overwrite all conflicting transactions (or optionally just the conflicting rows) on the secondary – as well as subsequent transactions influenced by the conflict • To use, set the function in mysql.ndb_replication to NDB$EPOCH() or NDB$EPOCH_TRANS() • Overview & worked example: http://bit.ly/activeactive • Gory details: http://bit.ly/refcgci
  • 97. How to Push Privilege Data into Data Nodes mysql> SOURCE /usr/local/mysql/share/mysql/ndb_dist_priv.sql; mysql> CALL mysql.mysql_cluster_move_privileges(); mysql> SHOW CREATE TABLE mysql.userG *************************** 1. row *************************** Table: userCreate Table: CREATE TABLE `user` ( `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', .... .... ) ENGINE=ndbcluster DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges‘ •Fully worked example: http://www.clusterdb.com/mysql-cluster/sharing-user-credential (http://bit.ly/userpriv)
  • 99. Scale the Cluster Capacity & Performance Application Nodes Data Node 1 Data Node2 Cluster F1 F2 Mgmt F2 F1 Data Nodes
  • 100. Scale the Cluster Capacity & Performance Application Nodes Node Group 1 Node Group 2 Node 1 Node 3 Cluster F1 F2 Cluster Mgmt F3 F4 Mgmt Node 2 Node 4 F3 F4 F1 F2 Data Nodes
  • 101. Node Failure Detection & Self-Healing Recovery
  • 102. On-Line Scaling & Maintenance 1. New node group added 2. Data is re-partitioned 3. Redundant data is deleted 4. Distribution is switched to share load with new node group • Can also update schema on- line • Upgrade hardware & software with no downtime • Perform back-ups on-line
  • 103. Only MySQL Can….. blend the agility & innovation of the web…. ….with the trust & capability of the network.
  • 104. No Trade-Offs: eCommerce • Integrated Service Provider platform • eCommerce • Payment processing • Fulfillment • Supports 1k+ manufacturers & 18k retail partners • Requirements • Scaling, On-Demand • HA: failures & on-line upgrades • High batch & real time loads • Low TCO: capex and opex http://mysql.com/customers/view/?id=1080
  • 105. No Trade-Offs: Flight Control • US Navy aircraft carriers • Consolidated flight operations management system • Maintenance records • Fuel loads • Weather conditions • Flight deck plans • Requirements • No Single Points of Failure • Complete redundancy • Small footprint, harsh environment • 4 x MySQL Cluster nodes, Linux and Windows MySQL User Conference Session: http://bit.ly/ogeid3
  • 106. Creating & running your first Cluster - the “manual” way (without MCM) • Up & running in 10-15 minutes using Quick Start guides from http://dev.mysql.com/downloads/cluster/ • Versions for Linux, Windows & Solaris Copyright 2011 Oracle Corporation 106
  • 107. ACID Compliant Relational Database • SQL & NoSQL interfaces Write-Scalable & Real-Time • Distributed, multi-master, auto-sharding, optimized in-memory structures & indices 99.999% Availability • Shared-nothing, integrated clustering & sub-second recovery, local & geographic replication, on-line operations Low Barriers to Entry • Open-source, elastic, multiple APIs, management tools, commodity hardware