Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL High Availability
InnoDB Cluster and NDB Cluster
Olivier Dasini
MySQL Principal Solutions Architect EMEA
olivier.dasini@oracle.com
@freshdaz
Copyright © 2016, Oracle and/or its affiliates. All rights 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 commitment to 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
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Almost all organizations require
their most critical systems to be
highly available
3
100%
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
High Availability
Protecting business critical data.
Servers can crash, hardware can fail - but
business must go on.
Existing solutions are complex, incomplete
and hard to use.
4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Scale-Out
Allow database to grow with your business.
Be prepared for major success.
Scale-out without sacrificing transactional
guarantees is hard.
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL High-Availability & Scale-Out Solutions
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
InnoDB Cluster
7
or
NDB Cluster
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• MySQL InnoDB Cluster
– Easy HA built into MySQL 5.7+
– InnoDB storage engine
– Write consistency
– Read Scalability
– App failover using MySQL Router
– Management via MySQL shell
(mysqlsh)
• MySQL NDB Cluster
– In memory distributed database
– NDB storage engine
– Automatic sharding
– Native access via several API
– Read/write consistency
– Read/write scalability
– Management via MCM/mgm-tool
How do the 2 compare ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
How do the 2 compare ? (cont.)
MySQL InnoDB Cluster MySQL NDB Cluster
Storage Engine InnoDB NDBCLUSTER
Distributed Architecture Shared nothing Shared nothing
Consistency Model Weak Consistency Strong Consistency
Sharding No* Yes
Network failure protection Quorum Arbitration
Load Balancing No* Yes
NoSQL APIs MySQL Document Store Native NDB APIs
Operational Complexity Medium High
Administration Standard (MySQL) Custom (MySQL + NDB)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
InnoDB Cluster
10
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
InnoDB Cluster
11
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
“High Availability becomes a core
first class feature of MySQL!”
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• One Product: MySQL
– All components created together
– Tested together
– Packaged together
• Easy to Use
– One client: MySQL Shell
– Easy packaging
– Integrated orchestration
– Homogeneous servers
• Flexible and Modern
– SQL and NoSQL together
– Protocol Buffers
– Developer friendly
• Support Read/Write Scale Out
– Sharded clusters
– Federated system of N replica sets
– Each replica set manages a shard
12
MySQL InnoDB Cluster: Goals
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 13
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, Oracle and/or its affiliates. All rights reserved. | 14
Scale-Out
High Performance
Ease-of-Use
Built-in HA
Out-of-Box Solution
Everything Integrated
MySQL
InnoDB
cluster
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15
Read Scale-Out
Async Replication + Auto Failover
Write Scale-Out
Sharding
S1
S2
S3
S4
MySQL Vision – 4 Steps
Timeline
MySQL Document Store
Relational & Document Model
MySQL HA
Out-Of-Box HA
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL
InnoDB
cluster
MySQL InnoDB Cluster – Architecture - S2
M
M M
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL Shell
HA
Group Replication
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
S1 S2 S3 S4 S…
M
M M
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL Shell
HA
MySQL InnoDB Cluster – Architecture - S3 MySQL
InnoDB
cluster
Read-Only Slaves
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
S1 S2 S3 S4 S…
M
M M
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL Shell
HA
ReplicaSet(Shard1)
S1 S2 S3 S4 S…
M
M M
MySQL Connector
Application
MySQL Router
HA
ReplicaSet(Shard2)
S1 S2 S3 S4 S…
M
M M
HA
ReplicaSet(Shard3)
MySQL Connector
Application
MySQL Router
MySQL InnoDB Cluster – Architecture - S4
…
MySQL
InnoDB
cluster
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL Shell
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL InnoDB Cluster: High Level Architecture
MySQL
InnoDB
cluster
MySQL Enterprise Monitor
…
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL InnoDB Cluster: The End Goal
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication
Natively distributed and highly available replica sets
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication: What Is It?
• Group Replication plugin
– Implementation of Replicated Database State Machine theory
• MySQL GCS is based on Paxos (variant of Mencius)
– Provides virtually 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.”
22
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
RC
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication: What Does It Provide?
• A highly available distributed MySQL database service
– Removes the need for manually handling server fail-over
– Provides distributed fault tolerance
– Enables Active/Active update anywhere setups
– Automates reconfiguration (adding/removing nodes, crashes, failures)
– Automatically detects and handles conflicts
23
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication: Architecture
Node Types
R: Traffic routers/proxies: mysqlrouter, haproxy, sqlproxy, ...
M: mysqld nodes participating in Group Replication
24
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication: Performance
26
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
Transparent application connection routing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Router: 2.1
• Native support 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
28
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
labs.mysql.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
Single tool for development, setup,
management, orchestration, and monitoring
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
30
A single unified client for all administrative and operations tasks
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
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, Oracle and/or its affiliates. All rights 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
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
Copyright © 2016, Oracle and/or its affiliates. All rights 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’)
  shell> mysqlsh
  mysql­js> dba.deployLocalInstance(3306)
  mysql­js> dba.deployInstance(‘hanode2:3306’)
  mysql­js> dba.deployInstance(‘hanode3:3306’)
32
https://www.youtube.com/watch?v=JWy7ZLXxtZ4
Copyright © 2016, Oracle and/or its affiliates. All rights 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')
  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')
33
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell – Add a MySQL Router
  shell> mysqlrouter ­­bootstrap hanode1:3306
  shell> mysqlrouter &
  shell> mysqlsh ­­uri root@localhost:6446
  shell> mysqlrouter ­­bootstrap hanode1:3306
  shell> mysqlrouter &
  shell> mysqlsh ­­uri root@localhost:6446
34
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Enterprise Monitor
• Native holistic support for InnoDB clusters
– Topology views
– Detailed metrics and graphs
– Best Practice advice
• Monitoring of MySQL Routers
• Monitoring of Group Replication
35
https://www.mysql.com/products/enterprise/monitor.html
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Sharded InnoDB Clusters
• Group Replication
– Each shard is a highly available replica set
• MySQL Router
– Manages shard mappings and related metadata
– Manages client routing
– Provides cross shard execution framework
• MySQL Shell
–Exposes management and orchestration features
36
* Download InnoDB Cluster Preview Release from labs.mysql.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
NDB Cluster
37
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Driving Database Requirements
38
Rock Solid
Availability
In-Memory
Real-Time
Performance
Extreme
Read & Write
Scalability
Elasticity
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
HLR / HSS
Billing, AuC, VLR
AuC, Call
Routing, Billing
Location
Updates
Pre & Post Paid
• Massive volumes of write traffic
• < 3ms database response
• Downtime & lost transactions = lost $
• Extremely cost sensitive market
MySQL Cluster in Action: http://bit.ly/oRI5tF
No Trade-Offs: Cellular Network
MySQL Cluster Overview
42
FULLY ELASTICFULLY ELASTIC
• Add and remove storage and performance capacity in seconds
• Fully cloud enabled
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++)
MySQL Cluster Data Nodes
MySQL Cluster Architecture
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
44
Management Layer
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Data Partitioning / Auto-sharding
45
User-id (PK) Service (PK) Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
MySQL Cluster Data Nodes
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Data Partitioning / Auto-sharding
46
User-id (PK) Service (PK) Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
MySQL Cluster Data Nodes
Shard Key
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Data Partitioning / Auto-sharding
47
User-id (PK) Service (PK) Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
MySQL Cluster Data Nodes
Shard Key
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Node GroupNode Group
Data Node 1Data Node 1
• Data transparently sharded between Node Groups
• Each fragment active in one Data Node with synchronous replication to 2nd
Data Node in same Node Group
48
Data Node 2Data Node 2
Node GroupNode Group
Data Node 3Data Node 3 Data Node 4Data Node 4
Data Partitioning / Auto-sharding
Copyright © 2016, Oracle and/or its affiliates. All rights 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
49
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
Node GroupNode Group
Data Node 1Data Node 1 Data Node 2Data Node 2
Node GroupNode Group
Data Node 3Data Node 3 Data Node 4Data Node 4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• Data automatically rearranged to use new capacity
• Designed to be a slow background process not impacting real-time
performance.
50
Node GroupNode Group
Data Node 1Data Node 1 Data Node 2Data Node 2
Node GroupNode Group
Data Node 3Data Node 3 Data Node 4Data Node 4
Node GroupNode Group
Data Node 5Data Node 5 Data Node 6Data Node 6
On-line Scaling and Elasticity
Re-partioning
Copyright © 2016, Oracle and/or its affiliates. All rights 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
52
MySQL Cluster 7.4 SQL Performance
2.5M SQL Statements/Second
-
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
DataNodes
DBT2SQLStatementsperSecond
Copyright © 2016, Oracle and/or its affiliates. All rights 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
53
MySQL Cluster 7.4 NoSQL Performance
200 Million NoSQL Reads/Second
-
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
DataNodes
FlexAsyncReads
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 54
MySQL NDB Cluster 7.5
• Read Optimized Tables
• Fully Replicated
Capacity and
Scale Out
• MySQL 5.7
• JSON Data Type
• Generated Columns
• Records-Per-Key
Optimization
Improved SQL
• Improved Reporting
• Improved Logging
• Improved Visibility
• Improved Restore
Management
GA
http://mikaelronstrom.blogspot.fr/2016/10/mysql-cluster-75-is-ga-best-cluster.html
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• Reading from backup allows to
read from any copy
• Previously all reads were directed
towards the primary fragment only
• Ideal for read-mostly tables
55
MySQL NDB 7.5: Reading from backup
Node GroupNode Group
Data Node 1Data Node 1 Data Node 2Data Node 2
http://mikaelronstrom.blogspot.fr/2016/10/read-any-replica-in-mysql-cluster-75.html
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL NDB Cluster 7.5: Fully replicated
• Fully replicated allows a table to be read/written locally on any node
• Ideal for static data, faster join performance
56
Node GroupNode Group
Data Node 1Data Node 1 Data Node 2Data Node 2
Node GroupNode Group
Data Node 3Data Node 3 Data Node 4Data Node 4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Next Steps
Learn More
• www.mysql.com/cluster
• https://dev.mysql.com/doc/mysql-innodb-cluster/en/
• http://mikaelronstrom.blogspot.fr/
• Authentic MySQL Curriculum: http://oracle.com/education/mysql
Learn More
• www.mysql.com/cluster
• https://dev.mysql.com/doc/mysql-innodb-cluster/en/
• http://mikaelronstrom.blogspot.fr/
• Authentic MySQL Curriculum: http://oracle.com/education/mysql
Try it Out
• http://dev.mysql.com/downloads/cluster/
• https://labs.mysql.com/
Try it Out
• http://dev.mysql.com/downloads/cluster/
• https://labs.mysql.com/
Let us know what you think
• http://mysqlhighavailability.com/
• forums.mysql.com/list.php?25
Let us know what you think
• http://mysqlhighavailability.com/
• forums.mysql.com/list.php?25
57
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Thank you!
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster

More Related Content

MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster

  • 1. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL High Availability InnoDB Cluster and NDB Cluster Olivier Dasini MySQL Principal Solutions Architect EMEA olivier.dasini@oracle.com @freshdaz
  • 2. Copyright © 2016, Oracle and/or its affiliates. All rights 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 commitment to 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 functionality described for Oracle’s products remains at the sole discretion of Oracle. 2
  • 3. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Almost all organizations require their most critical systems to be highly available 3 100%
  • 4. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | High Availability Protecting business critical data. Servers can crash, hardware can fail - but business must go on. Existing solutions are complex, incomplete and hard to use. 4
  • 5. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Scale-Out Allow database to grow with your business. Be prepared for major success. Scale-out without sacrificing transactional guarantees is hard. 5
  • 6. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL High-Availability & Scale-Out Solutions
  • 7. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | InnoDB Cluster 7 or NDB Cluster
  • 8. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | • MySQL InnoDB Cluster – Easy HA built into MySQL 5.7+ – InnoDB storage engine – Write consistency – Read Scalability – App failover using MySQL Router – Management via MySQL shell (mysqlsh) • MySQL NDB Cluster – In memory distributed database – NDB storage engine – Automatic sharding – Native access via several API – Read/write consistency – Read/write scalability – Management via MCM/mgm-tool How do the 2 compare ?
  • 9. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | How do the 2 compare ? (cont.) MySQL InnoDB Cluster MySQL NDB Cluster Storage Engine InnoDB NDBCLUSTER Distributed Architecture Shared nothing Shared nothing Consistency Model Weak Consistency Strong Consistency Sharding No* Yes Network failure protection Quorum Arbitration Load Balancing No* Yes NoSQL APIs MySQL Document Store Native NDB APIs Operational Complexity Medium High Administration Standard (MySQL) Custom (MySQL + NDB)
  • 10. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | InnoDB Cluster 10
  • 11. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | InnoDB Cluster 11 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate “High Availability becomes a core first class feature of MySQL!”
  • 12. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | • One Product: MySQL – All components created together – Tested together – Packaged together • Easy to Use – One client: MySQL Shell – Easy packaging – Integrated orchestration – Homogeneous servers • Flexible and Modern – SQL and NoSQL together – Protocol Buffers – Developer friendly • Support Read/Write Scale Out – Sharded clusters – Federated system of N replica sets – Each replica set manages a shard 12 MySQL InnoDB Cluster: Goals
  • 13. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 13 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.”
  • 14. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14 Scale-Out High Performance Ease-of-Use Built-in HA Out-of-Box Solution Everything Integrated MySQL InnoDB cluster
  • 15. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15 Read Scale-Out Async Replication + Auto Failover Write Scale-Out Sharding S1 S2 S3 S4 MySQL Vision – 4 Steps Timeline MySQL Document Store Relational & Document Model MySQL HA Out-Of-Box HA
  • 16. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL InnoDB cluster MySQL InnoDB Cluster – Architecture - S2 M M M MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL Shell HA Group Replication
  • 17. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | S1 S2 S3 S4 S… M M M MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL Shell HA MySQL InnoDB Cluster – Architecture - S3 MySQL InnoDB cluster Read-Only Slaves
  • 18. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | S1 S2 S3 S4 S… M M M MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL Shell HA ReplicaSet(Shard1) S1 S2 S3 S4 S… M M M MySQL Connector Application MySQL Router HA ReplicaSet(Shard2) S1 S2 S3 S4 S… M M M HA ReplicaSet(Shard3) MySQL Connector Application MySQL Router MySQL InnoDB Cluster – Architecture - S4 … MySQL InnoDB cluster
  • 19. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL Shell MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL InnoDB Cluster: High Level Architecture MySQL InnoDB cluster MySQL Enterprise Monitor …
  • 20. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL InnoDB Cluster: The End Goal
  • 21. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication Natively distributed and highly available replica sets
  • 22. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication: What Is It? • Group Replication plugin – Implementation of Replicated Database State Machine theory • MySQL GCS is based on Paxos (variant of Mencius) – Provides virtually 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.” 22 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate RC
  • 23. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication: What Does It Provide? • A highly available distributed MySQL database service – Removes the need for manually handling server fail-over – Provides distributed fault tolerance – Enables Active/Active update anywhere setups – Automates reconfiguration (adding/removing nodes, crashes, failures) – Automatically detects and handles conflicts 23
  • 24. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication: Architecture Node Types R: Traffic routers/proxies: mysqlrouter, haproxy, sqlproxy, ... M: mysqld nodes participating in Group Replication 24
  • 25. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication: Performance 26
  • 26. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Router Transparent application connection routing
  • 27. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Router: 2.1 • Native support 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 28 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate labs.mysql.com
  • 28. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Shell Single tool for development, setup, management, orchestration, and monitoring
  • 29. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Shell 30 A single unified client for all administrative and operations tasks App Servers with MySQL Router MySQL Group Replication MySQL Shell 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!”
  • 30. Copyright © 2016, Oracle and/or its affiliates. All rights 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 MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate
  • 31. Copyright © 2016, Oracle and/or its affiliates. All rights 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’)   shell> mysqlsh   mysql­js> dba.deployLocalInstance(3306)   mysql­js> dba.deployInstance(‘hanode2:3306’)   mysql­js> dba.deployInstance(‘hanode3:3306’) 32 https://www.youtube.com/watch?v=JWy7ZLXxtZ4
  • 32. Copyright © 2016, Oracle and/or its affiliates. All rights 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')   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') 33
  • 33. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Shell – Add a MySQL Router   shell> mysqlrouter ­­bootstrap hanode1:3306   shell> mysqlrouter &   shell> mysqlsh ­­uri root@localhost:6446   shell> mysqlrouter ­­bootstrap hanode1:3306   shell> mysqlrouter &   shell> mysqlsh ­­uri root@localhost:6446 34
  • 34. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Enterprise Monitor • Native holistic support for InnoDB clusters – Topology views – Detailed metrics and graphs – Best Practice advice • Monitoring of MySQL Routers • Monitoring of Group Replication 35 https://www.mysql.com/products/enterprise/monitor.html
  • 35. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Sharded InnoDB Clusters • Group Replication – Each shard is a highly available replica set • MySQL Router – Manages shard mappings and related metadata – Manages client routing – Provides cross shard execution framework • MySQL Shell –Exposes management and orchestration features 36 * Download InnoDB Cluster Preview Release from labs.mysql.com
  • 36. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | NDB Cluster 37
  • 37. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Driving Database Requirements 38 Rock Solid Availability In-Memory Real-Time Performance Extreme Read & Write Scalability Elasticity
  • 38. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | HLR / HSS Billing, AuC, VLR AuC, Call Routing, Billing Location Updates Pre & Post Paid • Massive volumes of write traffic • < 3ms database response • Downtime & lost transactions = lost $ • Extremely cost sensitive market MySQL Cluster in Action: http://bit.ly/oRI5tF No Trade-Offs: Cellular Network
  • 39. MySQL Cluster Overview 42 FULLY ELASTICFULLY ELASTIC • Add and remove storage and performance capacity in seconds • Fully cloud enabled
  • 40. 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++) MySQL Cluster Data Nodes
  • 41. MySQL Cluster Architecture MySQL Cluster Data Nodes Clients Application Layer Data Layer 44 Management Layer
  • 42. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Data Partitioning / Auto-sharding 45 User-id (PK) Service (PK) Data 1773467253 chat xxx 6257346892 chat xxx 1773467253 photos xxx 7234782739 photos xxx 8235602099 reminders xxx 8437829249 location xxx MySQL Cluster Data Nodes
  • 43. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Data Partitioning / Auto-sharding 46 User-id (PK) Service (PK) Data 1773467253 chat xxx 6257346892 chat xxx 1773467253 photos xxx 7234782739 photos xxx 8235602099 reminders xxx 8437829249 location xxx MySQL Cluster Data Nodes Shard Key
  • 44. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Data Partitioning / Auto-sharding 47 User-id (PK) Service (PK) Data 1773467253 chat xxx 6257346892 chat xxx 1773467253 photos xxx 7234782739 photos xxx 8235602099 reminders xxx 8437829249 location xxx MySQL Cluster Data Nodes Shard Key
  • 45. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Node GroupNode Group Data Node 1Data Node 1 • Data transparently sharded between Node Groups • Each fragment active in one Data Node with synchronous replication to 2nd Data Node in same Node Group 48 Data Node 2Data Node 2 Node GroupNode Group Data Node 3Data Node 3 Data Node 4Data Node 4 Data Partitioning / Auto-sharding
  • 46. Copyright © 2016, Oracle and/or its affiliates. All rights 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 49 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 Node GroupNode Group Data Node 1Data Node 1 Data Node 2Data Node 2 Node GroupNode Group Data Node 3Data Node 3 Data Node 4Data Node 4
  • 47. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | • Data automatically rearranged to use new capacity • Designed to be a slow background process not impacting real-time performance. 50 Node GroupNode Group Data Node 1Data Node 1 Data Node 2Data Node 2 Node GroupNode Group Data Node 3Data Node 3 Data Node 4Data Node 4 Node GroupNode Group Data Node 5Data Node 5 Data Node 6Data Node 6 On-line Scaling and Elasticity Re-partioning
  • 48. Copyright © 2016, Oracle and/or its affiliates. All rights 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 52 MySQL Cluster 7.4 SQL Performance 2.5M SQL Statements/Second - 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 DataNodes DBT2SQLStatementsperSecond
  • 49. Copyright © 2016, Oracle and/or its affiliates. All rights 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 53 MySQL Cluster 7.4 NoSQL Performance 200 Million NoSQL Reads/Second - 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 DataNodes FlexAsyncReads
  • 50. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 54 MySQL NDB Cluster 7.5 • Read Optimized Tables • Fully Replicated Capacity and Scale Out • MySQL 5.7 • JSON Data Type • Generated Columns • Records-Per-Key Optimization Improved SQL • Improved Reporting • Improved Logging • Improved Visibility • Improved Restore Management GA http://mikaelronstrom.blogspot.fr/2016/10/mysql-cluster-75-is-ga-best-cluster.html
  • 51. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | • Reading from backup allows to read from any copy • Previously all reads were directed towards the primary fragment only • Ideal for read-mostly tables 55 MySQL NDB 7.5: Reading from backup Node GroupNode Group Data Node 1Data Node 1 Data Node 2Data Node 2 http://mikaelronstrom.blogspot.fr/2016/10/read-any-replica-in-mysql-cluster-75.html
  • 52. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL NDB Cluster 7.5: Fully replicated • Fully replicated allows a table to be read/written locally on any node • Ideal for static data, faster join performance 56 Node GroupNode Group Data Node 1Data Node 1 Data Node 2Data Node 2 Node GroupNode Group Data Node 3Data Node 3 Data Node 4Data Node 4
  • 53. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Next Steps Learn More • www.mysql.com/cluster • https://dev.mysql.com/doc/mysql-innodb-cluster/en/ • http://mikaelronstrom.blogspot.fr/ • Authentic MySQL Curriculum: http://oracle.com/education/mysql Learn More • www.mysql.com/cluster • https://dev.mysql.com/doc/mysql-innodb-cluster/en/ • http://mikaelronstrom.blogspot.fr/ • Authentic MySQL Curriculum: http://oracle.com/education/mysql Try it Out • http://dev.mysql.com/downloads/cluster/ • https://labs.mysql.com/ Try it Out • http://dev.mysql.com/downloads/cluster/ • https://labs.mysql.com/ Let us know what you think • http://mysqlhighavailability.com/ • forums.mysql.com/list.php?25 Let us know what you think • http://mysqlhighavailability.com/ • forums.mysql.com/list.php?25 57
  • 54. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Thank you!