Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo

1

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL High Availability
InnoDB Cluster and NDB Cluster
Mario Beck
mario.beck@oracle.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

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. |
InnoDB Cluster
4

5

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
InnoDB Cluster
5
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
“High Availability becomes a core
first class feature of MySQL!”

6

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 6
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.”

7

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
– Homogenous 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
7
MySQL InnoDB Cluster: Goals

8

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
…

9

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL
Group Replication
Natively distributed and highly available replica sets

10

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication: What Is It?
• Group Replication library
– 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.”
10
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate

11

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
11

12

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
12

13

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
Transparent application connection routing

14

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
14
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
labs.mysql.com

15

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
Single tool for development, setup,
management, orchestration, and monitoring

16

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
16
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!”

17

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

18

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’)
18

19

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')
19

20

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
20

21

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 21
MySQL Document Store
Relational & Document Models
MySQL HA
Out-Of-Box HA
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

22

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
22

23

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
NDB Cluster
23

24

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Driving Database Requirements
9th April 2015 Copyright 2015, oracle and/or its affiliates. All rights reserved 24
Rock Solid
Availability
In-Memory
Real-Time
Performance
Extreme
Read & Write
Scalability
Elasticity

25

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 $
• Extremly cost sensitive market
MySQL Cluster in Action: http://bit.ly/oRI5tF
No Trade-Offs: Cellular Network

26

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
User Session
Session
management
Session
management
Location Updates,
Character movements, ...
• Massive volumes of write traffic
• < 3ms database response
• Downtime & lost transactions = lost $
• Extremly sensitive crowd
No Trade-Offs: Massive Parallel Online Games

27

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 27
No Trade-offs: Hadoop
NameNodes
Leader
HDFS Client
DataNodes
Hops.io
MySQL NDB Cluster Data Nodes
ClusterJ
NDB Cluster powering the
world‘s fastest and most
scalable Hadoop
filesystem.
Scaling Hadoop 20x!

28

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Overview
• Memory optimized tables with durability
• Predictable Low-Latency, Bounded Access Time
REAL-TIME
• Auto-Sharding, Active-Active
• ACID Compliant, OLTP + Real-Time Analytics
HIGH SCALE, READS + WRITES
FULLY ELASTIC
• 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. All rights reserved 28
• Add and remove storage and performance capacity in seconds
• Fully cloud enabled

29

Copyright © 2016, Oracle and/or its affiliates. All rights 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++)
MySQL Cluster Data Nodes

30

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Architecture
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
9th April 2015 Copyright 2015, oracle and/or its affiliates. All rights reserved 30

31

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Data Partitioning / Auto-sharding
25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 31
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

32

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Data Partitioning / Auto-sharding
25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 32
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

33

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Data Partitioning / Auto-sharding
25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 33
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

34

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Node Group
Data 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
25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 34
Data Node 2
Node Group
Data Node 3 Data Node 4
Data Partitioning / Auto-sharding

35

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
25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights 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
Shard Key
Node Group
Data Node 1 Data Node 2
Node Group
Data Node 3 Data Node 4

36

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.
25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 36
Node Group
Data Node 1 Data Node 2
Node Group
Data Node 3 Data Node 4
Node Group
Data Node 5 Data Node 6
On-line Scaling and Elasticity
Re-partioning

37

Copyright © 2016, Oracle and/or its affiliates. All rights 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. All rights reserved 37

38

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
25/11/2016 38
MySQL Cluster 7.4 NoSQL Performance
200 Million NoSQL Reads/Second
Copyright 2015, oracle and/or its affiliates. All rights 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

39

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
25/11/2016 39
MySQL Cluster 7.4 SQL Performance
2.5M SQL Statements/Second
Copyright 2015, oracle and/or its affiliates. All rights 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

40

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 40
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

41

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
Confidential – Oracle Internal/Restricted/Highly Restricted 41
MySQL NDB 7.5: Reading from backup
Node Group
Data Node 1 Data Node 2

42

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
Confidential – Oracle Internal/Restricted/Highly Restricted 42
Node Group
Data Node 1 Data Node 2
Node Group
Data Node 3 Data Node 4

43

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/
• 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. All rights reserved 43

44

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
InnoDB Cluster
44
or
NDB Cluster

45

Copyright © 2016, Oracle and/or its affiliates. All rights 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

46

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
How Do The Two Compare II
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
Arbitration No Yes
Load Balancing No Yes
NoSQL APIs MySQL Document Store Native NDB API
Operational Complexity Medium High
Administration Standard (MySQL) Custom (MySQL + NDB)

47

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Thank you!

More Related Content

MySQL InnoDB Cluster and NDB Cluster

  • 1. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL High Availability InnoDB Cluster and NDB Cluster Mario Beck mario.beck@oracle.com Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
  • 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. | InnoDB Cluster 4
  • 5. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | InnoDB Cluster 5 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate “High Availability becomes a core first class feature of MySQL!”
  • 6. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 6 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.”
  • 7. 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 – Homogenous 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 7 MySQL InnoDB Cluster: Goals
  • 8. 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 …
  • 9. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication Natively distributed and highly available replica sets
  • 10. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication: What Is It? • Group Replication library – 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.” 10 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate
  • 11. 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 11
  • 12. 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 12
  • 13. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Router Transparent application connection routing
  • 14. 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 14 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate labs.mysql.com
  • 15. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Shell Single tool for development, setup, management, orchestration, and monitoring
  • 16. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Shell 16 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!”
  • 17. 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
  • 18. 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’) 18
  • 19. 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') 19
  • 20. 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 20
  • 21. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 21 MySQL Document Store Relational & Document Models MySQL HA Out-Of-Box HA 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
  • 22. 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 22
  • 23. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | NDB Cluster 23
  • 24. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Driving Database Requirements 9th April 2015 Copyright 2015, oracle and/or its affiliates. All rights reserved 24 Rock Solid Availability In-Memory Real-Time Performance Extreme Read & Write Scalability Elasticity
  • 25. 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 $ • Extremly cost sensitive market MySQL Cluster in Action: http://bit.ly/oRI5tF No Trade-Offs: Cellular Network
  • 26. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | User Session Session management Session management Location Updates, Character movements, ... • Massive volumes of write traffic • < 3ms database response • Downtime & lost transactions = lost $ • Extremly sensitive crowd No Trade-Offs: Massive Parallel Online Games
  • 27. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 27 No Trade-offs: Hadoop NameNodes Leader HDFS Client DataNodes Hops.io MySQL NDB Cluster Data Nodes ClusterJ NDB Cluster powering the world‘s fastest and most scalable Hadoop filesystem. Scaling Hadoop 20x!
  • 28. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Overview • Memory optimized tables with durability • Predictable Low-Latency, Bounded Access Time REAL-TIME • Auto-Sharding, Active-Active • ACID Compliant, OLTP + Real-Time Analytics HIGH SCALE, READS + WRITES FULLY ELASTIC • 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. All rights reserved 28 • Add and remove storage and performance capacity in seconds • Fully cloud enabled
  • 29. Copyright © 2016, Oracle and/or its affiliates. All rights 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++) MySQL Cluster Data Nodes
  • 30. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Architecture MySQL Cluster Data Nodes Clients Application Layer Data Layer 9th April 2015 Copyright 2015, oracle and/or its affiliates. All rights reserved 30
  • 31. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Data Partitioning / Auto-sharding 25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 31 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
  • 32. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Data Partitioning / Auto-sharding 25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 32 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
  • 33. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Data Partitioning / Auto-sharding 25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 33 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
  • 34. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Node Group Data 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 25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 34 Data Node 2 Node Group Data Node 3 Data Node 4 Data Partitioning / Auto-sharding
  • 35. 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 25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights 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 Shard Key Node Group Data Node 1 Data Node 2 Node Group Data Node 3 Data Node 4
  • 36. 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. 25/11/2016 Copyright 2015, oracle and/or its affiliates. All rights reserved 36 Node Group Data Node 1 Data Node 2 Node Group Data Node 3 Data Node 4 Node Group Data Node 5 Data Node 6 On-line Scaling and Elasticity Re-partioning
  • 37. Copyright © 2016, Oracle and/or its affiliates. All rights 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. All rights reserved 37
  • 38. 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 25/11/2016 38 MySQL Cluster 7.4 NoSQL Performance 200 Million NoSQL Reads/Second Copyright 2015, oracle and/or its affiliates. All rights 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
  • 39. 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 25/11/2016 39 MySQL Cluster 7.4 SQL Performance 2.5M SQL Statements/Second Copyright 2015, oracle and/or its affiliates. All rights 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
  • 40. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 40 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
  • 41. 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 Confidential – Oracle Internal/Restricted/Highly Restricted 41 MySQL NDB 7.5: Reading from backup Node Group Data Node 1 Data Node 2
  • 42. 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 Confidential – Oracle Internal/Restricted/Highly Restricted 42 Node Group Data Node 1 Data Node 2 Node Group Data Node 3 Data Node 4
  • 43. 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/ • 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. All rights reserved 43
  • 44. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | InnoDB Cluster 44 or NDB Cluster
  • 45. Copyright © 2016, Oracle and/or its affiliates. All rights 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
  • 46. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | How Do The Two Compare II 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 Arbitration No Yes Load Balancing No Yes NoSQL APIs MySQL Document Store Native NDB API Operational Complexity Medium High Administration Standard (MySQL) Custom (MySQL + NDB)
  • 47. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Thank you!