Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL High Availability
InnoDB Cluster and NDB Cluster
Ted Wennmark
ted.wennmark@oracle.com
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved.
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitmentto deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionalitydescribed for Oracle’s products remains at the sole discretion of Oracle.
2
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Almost all organizations require their most
critical systems to be highly available
3
100%
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
InnoDB Cluster
4
or
NDB Cluster
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
• MySQL InnoDB Cluster
– Easy HA built into MySQL 5.7+
– Write consistency
– Read Scalability
– App failover using MySQL Router
– Management via mysqlsh
– InnoDB storage engine
• MySQL NDB Cluster
– In memory database
– Automatic sharding
– Native access via several API
– Read/write consistency
– Read/write scalability
– NDB storage engine
How Do The Two Compare I
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
How Do The Two Compare II
MySQLInnoDBCluster MySQLNDBCluster
StorageEngine InnoDB NDBCLUSTER
DistributedArchitecture Sharednothing Sharednothing
ConsistencyModel Weak Consistency StrongConsistency
Sharding No Yes
Arbitration No Yes
LoadBalancing No Yes
NoSQLAPIs MySQLDocumentStore NativeNDB API
OperationalComplexity Medium High
Administration Standard(MySQL) Custom(MySQL+ NDB)
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
InnoDB Cluster
7
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
InnoDB Cluster
8
App Servers with
MySQLRouter
MySQLGroupReplication
MySQLShell
Setup,Manage,
Orchestrate
“High Availability becomes a core
first class feature of MySQL!”
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. | 9
MySQL InnoDB Cluster: Vision
“A single product — MySQL — with high availability and scaling
features baked in; providing an integrated end-to-end solution
that is easy to use.”
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
• One Product: MySQL
– All componentscreated together
– Tested together
– Packaged together
• Easy to Use
– One client: MySQL Shell
– Easy packaging
– Integrated orchestration
– Homogenousservers
• Flexible and Modern
– SQL and NoSQL together
– ProtocolBuffers
– Developer friendly
• Support Read/Write Scale Out
– Sharded clusters
– Federated system of N replica sets
– Each replica set manages a shard
10
MySQL InnoDB Cluster: Goals
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQLConnector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL Shell
MySQLConnector
Application
MySQL Router
MySQLConnector
Application
MySQL Router
MySQL InnoDB Cluster: High Level Architecture
MySQL
InnoDB
cluster
MySQL Enterprise Monitor
…
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL
Group Replication
Natively distributed and highly available replica sets
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Group Replication: What Is It?
• Group Replication library
– Implementationof Replicated Database State Machine
theory
• MySQL GCS is based on Paxos (variant of Mencius)
– Providesvirtually synchronous replication for MySQL 5.7+
– Supported on all MySQL platforms
• Linux,Windows, Solaris, OSX, FreeBSD
“Multi-master update anywhere replication plugin for MySQL with
built-in conflict detection and resolution, automatic distributed
recovery, and group membership.”
13
App Servers with
MySQLRouter
MySQLGroupReplication
MySQLShell
Setup,Manage,
Orchestrate
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Group Replication: What Does It Provide?
• A highly available distributed MySQL database service
– Removes the need for manually handling server fail-over
– Providesdistributed fault tolerance
– Enables Active/Active update anywhere setups
– Automates reconfiguration (adding/removing nodes, crashes, failures)
– Automaticallydetects and handles conflicts
14
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Group Replication: Architecture
Node Types
R: Trafficrouters/proxies:mysqlrouter,haproxy,sqlproxy,...
M:mysqld nodes participatingin Group Replication
15
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. | 16
MySQL Server: Full Stack
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Router
Transparent application connection routing
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Router: 2.1
• Nativesupport for InnoDB clusters
– Understands Group Replication topology
– Utilizes metadata schema stored on each member
• Bootstraps itself and sets up client routing for the InnoDB cluster
• Allows for intelligent client routing into the InnoDB cluster
• Supports multi-master and single primary modes
• Core improvements
– Logging
– Monitoring
– Performance
– Security
18
App Servers with
MySQLRouter
MySQLGroupReplication
MySQLShell
Setup,Manage,
Orchestrate
labs.mysql.com
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Shell
Single tool for development, setup,
management, orchestration, and monitoring
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Shell
20
A single unified client for all administrative and operations tasks
App Servers with
MySQLRouter
MySQLGroupReplication
MySQLShell
Setup,Manage,
Orchestrate
• Multi-Language: JavaScript, Python, and SQL
– Naturally scriptable
• Supports both Document and Relational models
• Exposes full Development and Admin API
”MySQL Shell provides the developer and DBA with a single intuitive,
flexible, and powerfull interface for all MySQL related tasks!”
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Shell: Admin API
• mysql-js> dba.help()
• The global variable 'dba' is used to access the
MySQL AdminAPI
• Perform DBA operations
– Manage MySQL InnoDB clusters
• Create clusters
• Deploy MySQL instances
• Get cluster info
• Start/Stop MySQL Instances
• Validate MySQL instances …
Database Administration Interface
labs.mysql.com
App Servers with
MySQLRouter
MySQLGroupReplication
MySQLShell
Setup,Manage,
Orchestrate
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Shell – Deploy MySQL Instances
shell> mysqlsh
mysql-js> dba.deployLocalInstance(3306)
mysql-js> dba.deployInstance(‘hanode2:3306’)
mysql-js> dba.deployInstance(‘hanode3:3306’)
22
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Shell – Create an InnoDB Cluster
mysql-js> connect root@hanode1:3306
mysql-js> cluster = dba.createCluster(‘NewAppCluster')
mysql-js> cluster.addInstance('root@hanode2:3306')
mysql-js> cluster.addInstance('root@hanode3:3306')
23
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Shell – Add a MySQL Router
shell> mysqlrouter --bootstrap hanode1:3306
shell> mysqlrouter &
shell> mysqlsh --uri root@localhost:6446
24
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. | 25
MySQLDocumentStore
Relational & Document Models
MySQLHA
Out-Of-BoxHA
Read Scale-Out
Async Replication+ Auto Failover
Write Scale-Out
Sharding
S1
S2
S3
S4
* Download InnoDB Cluster Preview Release from labs.mysql.com
What’s Next
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Enterprise Monitor
• Nativeholistic support for InnoDB clusters
– Topologyviews
– Detailed metrics and graphs
– Best Practice advice
• Monitoring of MySQL Routers
• Monitoring of Group Replication
26
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
NDB Cluster
27
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Driving Database Requirements
9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 28
RockSolid
Availability
In-Memory
Real-Time
Performance
Extreme
Read & Write
Scalability
Elasticity
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
HLR/ HSS
Billing,AuC,VLR
AuC, Call
Routing,Billing
Location
Updates
Pre& PostPaid
• Massive volumes of write traffic
• < 3ms database response
• Downtime & lost transactions = lost $
• Extremly cost sensitive market
MySQL Cluster in Action: http://bit.ly/oRI5tF
No Trade-Offs: Cellular Network
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
UserSession
Session
management
Session
management
LocationUpdates,
Charactermovements,...
• Massive volumes of write traffic
• < 3ms database response
• Downtime & lost transactions = lost $
• Extremly sensitive crowd
No Trade-Offs: Massive Parallel Online Games
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. | Confidential –OracleInternal/Restricted/Highly Restricted 31
No Trade-offs: Hadoop
NameNodes
Leader
HDFS Client
DataNodes
Hops.io
MySQLNDB ClusterData Nodes
ClusterJ
NDB Cluster powering the
world‘s fastest and most
scalable Hadoop
filesystem.
Scaling Hadoop 20x!
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Cluster Overview
• Memoryoptimizedtables with durability
• PredictableLow-Latency,BoundedAccessTime
REAL-TIME
• Auto-Sharding,Active-Active
• ACIDCompliant,OLTP+ Real-TimeAnalyticsHIGH SCALE, READS + WRITES
FULLYELASTIC
• Active-Active, Shared nothing, no Single Point of Failure
• Self Healing + On-Line Operations
99.999% AVAILABILITY
• Key/Value + Complex, Relational Queries
• SQL + Memcached + JavaScript + Java + HTTP/REST & C++
SQL + NoSQL
• Open Source + Commercial Editions, Easy to use and deploy
• Commodity hardware + Management, Monitoring Tools
LOW TCO
9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 32
• Add and remove storage and performance capacity in seconds
• Fully cloud enabled
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
NoSQL Access to MySQL Cluster data
Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps
JPA
Cluster JPA
PHP Perl Python Ruby JDBC Cluster J JS Apache Memcached
MySQL JNI Node.JS mod_ndb ndb_eng
NDB API (C++)
MySQLCluster Data Nodes
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Cluster Architecture
MySQLCluster DataNodes
Clients
ApplicationLayer
Data Layer
9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 34
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Data Partitioning / Auto-sharding
28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 35
User-id(PK) Service(PK) Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
MySQLClusterDataNodes
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Data Partitioning / Auto-sharding
28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 36
User-id(PK) Service(PK) Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
MySQLClusterDataNodes
Shard Key
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Data Partitioning / Auto-sharding
28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 37
User-id(PK) Service(PK) Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
MySQLClusterDataNodes
Shard Key
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
NodeGroup
DataNode 1
• Datatransparently sharded between Node Groups
• Each fragment active in one Data Node with synchronous replication to
2nd Data Node in same Node Group
28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 38
DataNode 2
NodeGroup
DataNode 3 DataNode 4
Data Partitioning / Auto-sharding
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Data Partitioning / Auto-sharding
• DBA chooses which part of
Primary Key to use as shard
key
• Fragment for each row
decided by hashing the
sharding key
28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 39
User-id(PK) Service(PK) Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
Shard Key
NodeGroup
DataNode 1 DataNode 2
NodeGroup
DataNode 3 DataNode 4
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
• Dataautomatically rearranged to use new capacity
• Designed to be a slow background process not impacting real-time
performance.
28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 40
NodeGroup
Data Node 1 Data Node 2
NodeGroup
Data Node 3 Data Node 4
NodeGroup
Data Node 5 Data Node 6
On-line Scaling and Elasticity
Re-partioning
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL Cluster 7.2: 1.2 Billion UPDATEs per Minute
• NoSQL C++ API,
flexaSynch benchmark
• 30 x Intel E5-2600 Intel
Servers, 2 socket, 64GB
• ACID Transactions, with
Synchronous Replication
http://www.mysql.com/why-
mysql/white-papers/mysql-cluster-
benchmarks-1-billion-writes-per-minute/0
5
10
15
20
25
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
MillionsofUPDATEsperSecond
MySQL Cluster Data Nodes
9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 41
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
• Memory optimized tables
– Durable
– Mix with disk-based tables
• Massively concurrent OLTP
• Distributed Joins for analytics
• Parallel table scans for non-indexed
searches
• MySQL Cluster 7.4 FlexAsych
– 200M NoSQL Reads/Second
28/09/2016 42
MySQL Cluster 7.4 NoSQL Performance
200 Million NoSQL Reads/Second
Copyright 2015,oracle and/or its affiliates. Allrights reserved
-
50,000,000
100,000,000
150,000,000
200,000,000
250,000,000
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32
Readspersecond
Data Nodes
FlexAsync Reads
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
• Memory optimized tables
– Durable
– Mix with disk-based tables
• Massively concurrent OLTP
• Distributed Joins for analytics
• Parallel table scans for non-indexed
searches
• MySQL Cluster 7.4 DBT2 BM
– 2.5M SQL Statements/Second
28/09/2016 43
MySQL Cluster 7.4 SQL Performance
2.5M SQL Statements/Second
Copyright 2015,oracle and/or its affiliates. Allrights reserved
-
500,000
1,000,000
1,500,000
2,000,000
2,500,000
3,000,000
2 4 6 8 10 12 14 16
SQLStatements/sec
Data Nodes
DBT2 SQL Statements per Second
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. | 44
MySQL NDB Cluster 7.5
• Read Optimized
Tables
• Fully Replicated
Capacity and
Scale Out
• MySQL 5.7
• JSONData Type
• Generated Columns
• Records-Per-Key
Optimization
Improved
SQL
• Improved Reporting
• Improved Logging
• Improved Visibility
• Improved Restore
Management
RC
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
• Reading from backup allows to read
from any copy
• Previously all reads were directed
towards the primary fragment only
Confidential –OracleInternal/Restricted/Highly Restricted 45
MySQL NDB 7.5: Reading from backup
NodeGroup
DataNode 1 DataNode 2
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
MySQL NDB Cluster 7.5: Fully replicated
• Fully replicated allows a table to be read/written locally on any node
• Ideal for staticdata, faster join performance
Confidential –OracleInternal/Restricted/Highly Restricted 46
NodeGroup
DataNode 1 DataNode 2
NodeGroup
DataNode 3 DataNode 4
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Next Steps
Learn More
• www.mysql.com/cluster
• https://dev.mysql.com/doc/mysql-innodb-cluster/en/
• Authentic MySQL Curriculum: http://oracle.com/education/mysql
Try it Out
• dev.mysql.com/downloads/cluster/
7.4 GA and 7.5 DMR 1
• https://labs.mysql.com/
Let us know what you think
• http://mysqlhighavailability.com/
• forums.mysql.com/list.php?25
9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 47
Copyright © 2016, Oracleand/orits affiliates. Allrights reserved. |
Thank you!

MySQL HA

  • 1.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL High Availability InnoDB Cluster and NDB Cluster Ted Wennmark ted.wennmark@oracle.com Copyright © 2016, Oracleand/orits affiliates. Allrights reserved.
  • 2.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitmentto deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionalitydescribed for Oracle’s products remains at the sole discretion of Oracle. 2
  • 3.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Almost all organizations require their most critical systems to be highly available 3 100%
  • 4.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | InnoDB Cluster 4 or NDB Cluster
  • 5.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | • MySQL InnoDB Cluster – Easy HA built into MySQL 5.7+ – Write consistency – Read Scalability – App failover using MySQL Router – Management via mysqlsh – InnoDB storage engine • MySQL NDB Cluster – In memory database – Automatic sharding – Native access via several API – Read/write consistency – Read/write scalability – NDB storage engine How Do The Two Compare I
  • 6.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | How Do The Two Compare II MySQLInnoDBCluster MySQLNDBCluster StorageEngine InnoDB NDBCLUSTER DistributedArchitecture Sharednothing Sharednothing ConsistencyModel Weak Consistency StrongConsistency Sharding No Yes Arbitration No Yes LoadBalancing No Yes NoSQLAPIs MySQLDocumentStore NativeNDB API OperationalComplexity Medium High Administration Standard(MySQL) Custom(MySQL+ NDB)
  • 7.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | InnoDB Cluster 7
  • 8.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | InnoDB Cluster 8 App Servers with MySQLRouter MySQLGroupReplication MySQLShell Setup,Manage, Orchestrate “High Availability becomes a core first class feature of MySQL!”
  • 9.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | 9 MySQL InnoDB Cluster: Vision “A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use.”
  • 10.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | • One Product: MySQL – All componentscreated together – Tested together – Packaged together • Easy to Use – One client: MySQL Shell – Easy packaging – Integrated orchestration – Homogenousservers • Flexible and Modern – SQL and NoSQL together – ProtocolBuffers – Developer friendly • Support Read/Write Scale Out – Sharded clusters – Federated system of N replica sets – Each replica set manages a shard 10 MySQL InnoDB Cluster: Goals
  • 11.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQLConnector Application MySQL Router MySQL Connector Application MySQL Router MySQL Shell MySQLConnector Application MySQL Router MySQLConnector Application MySQL Router MySQL InnoDB Cluster: High Level Architecture MySQL InnoDB cluster MySQL Enterprise Monitor …
  • 12.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Group Replication Natively distributed and highly available replica sets
  • 13.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Group Replication: What Is It? • Group Replication library – Implementationof Replicated Database State Machine theory • MySQL GCS is based on Paxos (variant of Mencius) – Providesvirtually synchronous replication for MySQL 5.7+ – Supported on all MySQL platforms • Linux,Windows, Solaris, OSX, FreeBSD “Multi-master update anywhere replication plugin for MySQL with built-in conflict detection and resolution, automatic distributed recovery, and group membership.” 13 App Servers with MySQLRouter MySQLGroupReplication MySQLShell Setup,Manage, Orchestrate
  • 14.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Group Replication: What Does It Provide? • A highly available distributed MySQL database service – Removes the need for manually handling server fail-over – Providesdistributed fault tolerance – Enables Active/Active update anywhere setups – Automates reconfiguration (adding/removing nodes, crashes, failures) – Automaticallydetects and handles conflicts 14
  • 15.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Group Replication: Architecture Node Types R: Trafficrouters/proxies:mysqlrouter,haproxy,sqlproxy,... M:mysqld nodes participatingin Group Replication 15
  • 16.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | 16 MySQL Server: Full Stack
  • 17.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Router Transparent application connection routing
  • 18.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Router: 2.1 • Nativesupport for InnoDB clusters – Understands Group Replication topology – Utilizes metadata schema stored on each member • Bootstraps itself and sets up client routing for the InnoDB cluster • Allows for intelligent client routing into the InnoDB cluster • Supports multi-master and single primary modes • Core improvements – Logging – Monitoring – Performance – Security 18 App Servers with MySQLRouter MySQLGroupReplication MySQLShell Setup,Manage, Orchestrate labs.mysql.com
  • 19.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Shell Single tool for development, setup, management, orchestration, and monitoring
  • 20.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Shell 20 A single unified client for all administrative and operations tasks App Servers with MySQLRouter MySQLGroupReplication MySQLShell Setup,Manage, Orchestrate • Multi-Language: JavaScript, Python, and SQL – Naturally scriptable • Supports both Document and Relational models • Exposes full Development and Admin API ”MySQL Shell provides the developer and DBA with a single intuitive, flexible, and powerfull interface for all MySQL related tasks!”
  • 21.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Shell: Admin API • mysql-js> dba.help() • The global variable 'dba' is used to access the MySQL AdminAPI • Perform DBA operations – Manage MySQL InnoDB clusters • Create clusters • Deploy MySQL instances • Get cluster info • Start/Stop MySQL Instances • Validate MySQL instances … Database Administration Interface labs.mysql.com App Servers with MySQLRouter MySQLGroupReplication MySQLShell Setup,Manage, Orchestrate
  • 22.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Shell – Deploy MySQL Instances shell> mysqlsh mysql-js> dba.deployLocalInstance(3306) mysql-js> dba.deployInstance(‘hanode2:3306’) mysql-js> dba.deployInstance(‘hanode3:3306’) 22
  • 23.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Shell – Create an InnoDB Cluster mysql-js> connect root@hanode1:3306 mysql-js> cluster = dba.createCluster(‘NewAppCluster') mysql-js> cluster.addInstance('root@hanode2:3306') mysql-js> cluster.addInstance('root@hanode3:3306') 23
  • 24.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Shell – Add a MySQL Router shell> mysqlrouter --bootstrap hanode1:3306 shell> mysqlrouter & shell> mysqlsh --uri root@localhost:6446 24
  • 25.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | 25 MySQLDocumentStore Relational & Document Models MySQLHA Out-Of-BoxHA Read Scale-Out Async Replication+ Auto Failover Write Scale-Out Sharding S1 S2 S3 S4 * Download InnoDB Cluster Preview Release from labs.mysql.com What’s Next
  • 26.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Enterprise Monitor • Nativeholistic support for InnoDB clusters – Topologyviews – Detailed metrics and graphs – Best Practice advice • Monitoring of MySQL Routers • Monitoring of Group Replication 26
  • 27.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | NDB Cluster 27
  • 28.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Driving Database Requirements 9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 28 RockSolid Availability In-Memory Real-Time Performance Extreme Read & Write Scalability Elasticity
  • 29.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | HLR/ HSS Billing,AuC,VLR AuC, Call Routing,Billing Location Updates Pre& PostPaid • Massive volumes of write traffic • < 3ms database response • Downtime & lost transactions = lost $ • Extremly cost sensitive market MySQL Cluster in Action: http://bit.ly/oRI5tF No Trade-Offs: Cellular Network
  • 30.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | UserSession Session management Session management LocationUpdates, Charactermovements,... • Massive volumes of write traffic • < 3ms database response • Downtime & lost transactions = lost $ • Extremly sensitive crowd No Trade-Offs: Massive Parallel Online Games
  • 31.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Confidential –OracleInternal/Restricted/Highly Restricted 31 No Trade-offs: Hadoop NameNodes Leader HDFS Client DataNodes Hops.io MySQLNDB ClusterData Nodes ClusterJ NDB Cluster powering the world‘s fastest and most scalable Hadoop filesystem. Scaling Hadoop 20x!
  • 32.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Cluster Overview • Memoryoptimizedtables with durability • PredictableLow-Latency,BoundedAccessTime REAL-TIME • Auto-Sharding,Active-Active • ACIDCompliant,OLTP+ Real-TimeAnalyticsHIGH SCALE, READS + WRITES FULLYELASTIC • Active-Active, Shared nothing, no Single Point of Failure • Self Healing + On-Line Operations 99.999% AVAILABILITY • Key/Value + Complex, Relational Queries • SQL + Memcached + JavaScript + Java + HTTP/REST & C++ SQL + NoSQL • Open Source + Commercial Editions, Easy to use and deploy • Commodity hardware + Management, Monitoring Tools LOW TCO 9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 32 • Add and remove storage and performance capacity in seconds • Fully cloud enabled
  • 33.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | NoSQL Access to MySQL Cluster data Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps Apps JPA Cluster JPA PHP Perl Python Ruby JDBC Cluster J JS Apache Memcached MySQL JNI Node.JS mod_ndb ndb_eng NDB API (C++) MySQLCluster Data Nodes
  • 34.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Cluster Architecture MySQLCluster DataNodes Clients ApplicationLayer Data Layer 9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 34
  • 35.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Data Partitioning / Auto-sharding 28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 35 User-id(PK) Service(PK) Data 1773467253 chat xxx 6257346892 chat xxx 1773467253 photos xxx 7234782739 photos xxx 8235602099 reminders xxx 8437829249 location xxx MySQLClusterDataNodes
  • 36.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Data Partitioning / Auto-sharding 28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 36 User-id(PK) Service(PK) Data 1773467253 chat xxx 6257346892 chat xxx 1773467253 photos xxx 7234782739 photos xxx 8235602099 reminders xxx 8437829249 location xxx MySQLClusterDataNodes Shard Key
  • 37.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Data Partitioning / Auto-sharding 28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 37 User-id(PK) Service(PK) Data 1773467253 chat xxx 6257346892 chat xxx 1773467253 photos xxx 7234782739 photos xxx 8235602099 reminders xxx 8437829249 location xxx MySQLClusterDataNodes Shard Key
  • 38.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | NodeGroup DataNode 1 • Datatransparently sharded between Node Groups • Each fragment active in one Data Node with synchronous replication to 2nd Data Node in same Node Group 28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 38 DataNode 2 NodeGroup DataNode 3 DataNode 4 Data Partitioning / Auto-sharding
  • 39.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Data Partitioning / Auto-sharding • DBA chooses which part of Primary Key to use as shard key • Fragment for each row decided by hashing the sharding key 28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 39 User-id(PK) Service(PK) Data 1773467253 chat xxx 6257346892 chat xxx 1773467253 photos xxx 7234782739 photos xxx 8235602099 reminders xxx 8437829249 location xxx Shard Key NodeGroup DataNode 1 DataNode 2 NodeGroup DataNode 3 DataNode 4
  • 40.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | • Dataautomatically rearranged to use new capacity • Designed to be a slow background process not impacting real-time performance. 28/09/2016 Copyright 2015,oracle and/or its affiliates. Allrights reserved 40 NodeGroup Data Node 1 Data Node 2 NodeGroup Data Node 3 Data Node 4 NodeGroup Data Node 5 Data Node 6 On-line Scaling and Elasticity Re-partioning
  • 41.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL Cluster 7.2: 1.2 Billion UPDATEs per Minute • NoSQL C++ API, flexaSynch benchmark • 30 x Intel E5-2600 Intel Servers, 2 socket, 64GB • ACID Transactions, with Synchronous Replication http://www.mysql.com/why- mysql/white-papers/mysql-cluster- benchmarks-1-billion-writes-per-minute/0 5 10 15 20 25 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 MillionsofUPDATEsperSecond MySQL Cluster Data Nodes 9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 41
  • 42.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | • Memory optimized tables – Durable – Mix with disk-based tables • Massively concurrent OLTP • Distributed Joins for analytics • Parallel table scans for non-indexed searches • MySQL Cluster 7.4 FlexAsych – 200M NoSQL Reads/Second 28/09/2016 42 MySQL Cluster 7.4 NoSQL Performance 200 Million NoSQL Reads/Second Copyright 2015,oracle and/or its affiliates. Allrights reserved - 50,000,000 100,000,000 150,000,000 200,000,000 250,000,000 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 Readspersecond Data Nodes FlexAsync Reads
  • 43.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | • Memory optimized tables – Durable – Mix with disk-based tables • Massively concurrent OLTP • Distributed Joins for analytics • Parallel table scans for non-indexed searches • MySQL Cluster 7.4 DBT2 BM – 2.5M SQL Statements/Second 28/09/2016 43 MySQL Cluster 7.4 SQL Performance 2.5M SQL Statements/Second Copyright 2015,oracle and/or its affiliates. Allrights reserved - 500,000 1,000,000 1,500,000 2,000,000 2,500,000 3,000,000 2 4 6 8 10 12 14 16 SQLStatements/sec Data Nodes DBT2 SQL Statements per Second
  • 44.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | 44 MySQL NDB Cluster 7.5 • Read Optimized Tables • Fully Replicated Capacity and Scale Out • MySQL 5.7 • JSONData Type • Generated Columns • Records-Per-Key Optimization Improved SQL • Improved Reporting • Improved Logging • Improved Visibility • Improved Restore Management RC
  • 45.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | • Reading from backup allows to read from any copy • Previously all reads were directed towards the primary fragment only Confidential –OracleInternal/Restricted/Highly Restricted 45 MySQL NDB 7.5: Reading from backup NodeGroup DataNode 1 DataNode 2
  • 46.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | MySQL NDB Cluster 7.5: Fully replicated • Fully replicated allows a table to be read/written locally on any node • Ideal for staticdata, faster join performance Confidential –OracleInternal/Restricted/Highly Restricted 46 NodeGroup DataNode 1 DataNode 2 NodeGroup DataNode 3 DataNode 4
  • 47.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Next Steps Learn More • www.mysql.com/cluster • https://dev.mysql.com/doc/mysql-innodb-cluster/en/ • Authentic MySQL Curriculum: http://oracle.com/education/mysql Try it Out • dev.mysql.com/downloads/cluster/ 7.4 GA and 7.5 DMR 1 • https://labs.mysql.com/ Let us know what you think • http://mysqlhighavailability.com/ • forums.mysql.com/list.php?25 9th April 2015 Copyright 2015,oracle and/or its affiliates. Allrights reserved 47
  • 48.
    Copyright © 2016,Oracleand/orits affiliates. Allrights reserved. | Thank you!