SlideShare a Scribd company logo
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster
Introduction and latest news from OOW
Ted Wennmark
ted.wennmark@oracle.com
Osaka (2nd) and Tokyo (4th) of December 2014
Copyright © 2014, 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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Today’s Database Requirements
Extreme Write Scalability Real-Time User Experience
Rock Solid Reliability Rapid Service Innovation
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Today’s Database Requirements
Extreme Write Scalability Real-Time User Experience
Rock Solid Reliability Rapid Service Innovation
Transactional Integrity
OLTP + Real-Time Analytics
Standards & Skillsets
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Who’s Using MySQL Cluster
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Overview
• Auto-Sharding, Multi-Master
• ACID Compliant, OLTP + Real-Time Analytics
HIGH SCALE, READS +
WRITES
• Shared nothing, no Single Point of Failure
• Self Healing + On-Line Operations
99.999% AVAILABILITY
• In-Memory Optimization + Disk-Data
• Predictable Low-Latency, Bounded Access Time
REAL-TIME
• Key/Value + Complex, Relational Queries
• SQL + Memcached + JavaScript + Java + HTTP/REST & C++
SQL + NoSQL
• Open Source + Commercial Editions
• Commodity hardware + Management, Monitoring Tools
LOW TCO
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Architecture
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Scaling
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster HA
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
On-Line
Operations
Scale
Backup
Evolve
Upgrade
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster 7.3: 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
0
5
10
15
20
25
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
Millions
of
UPDATEs
per
Second
MySQL Cluster Data Nodes
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
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++)
NoSQL Access to MySQL Cluster data
MySQL Cluster Data Nodes
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Cluster & Memcached – Schema-Free
<town:maidenhead,SL6>
key value
<town:maidenhead,SL6>
key value
Key Value
town:maidenhead SL6
generic table
Application view
SQL view
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Cluster & Memcached - Configured Schema
<town:maidenhead,SL6>
prefix key value
<town:maidenhead,SL6>
key value
Prefix Table Key-col Val-col policy
town: map.zip town code cluster
Config tables
town ... code ...
maidenhead ... SL6 ...
map.zip
Application view
SQL view
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Node.js NoSQL API • Native JavaScript access to MySQL Cluster
– End-to-End JavaScript: browser to the app & DB
– Storing and retrieving JavaScript objects
directly in MySQL Cluster
– Eliminate SQL transformation
• Implemented as a module for node.js
– Integrates Cluster API library within the web
app
• Couple high performance, distributed apps,
with high performance distributed database
• Optionally routes through MySQL Server
V8 JavaScript Engine
MySQL Cluster Node.js Module
MySQL Cluster Data Nodes
Clients
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster 7.4.1 DMR
Available Now!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Better performance and operational simplicity
MySQL Cluster 7.4.1 DMR
• Performance gain over 7.3
– 47% (Read-Only)
– 38% (Read-Write)
• Faster maintenance operations
– Nodal & Rolling restarts
– Upgrades
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
• Asynchronous replication between
MySQL Clusters
• Active-Active
– Update anywhere
– Conflict detection
• Application notified through exception tables
• Can opt to have conflicts resolved
automatically
– Auto-conflict-resolution
• NDB$EPOCH, conflicting rows are rolled back
• NDB$EPOCH_TRANS, conflicting transactions
are rolled back
Active-Active Geo-Replication
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
What is a conflict?
John.balance==$100
John.balance-=$40
John.balance==$60
John.balance==$200
John.balance==$100
John.balance+= $100
John.balance==$200
John.balance==$60
Spend $40 Add $100
$60
$200
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
• Primary store logical timestamp (GCI)
against updated row
– Window for conflict opens
• GCI replicated with updated row to
Secondary
• The same row and GCI is replicated back
(reflected) from Secondary to Primary
after it has been applied
– Closing window for conflict
• Primary checks every event originating
from the Secondary to ensure it isn’t for a
‘conflictable’ row
Detecting Conflicts - Reflected GCI
John.balance==$100
John.balance-=$40
John.balance==$60
John.balance==$200
John.balance==$100
John.balance+= $100
John.balance==$200
John.balance==$60
Spend $40 Add $100
$60
$200
Primary Secondary
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster 7.4.1 DMR
• Rolling back of transactions that
read conflicted data.
• Entire transactions (and dependent
ones) rolled back.
• Information of conflict's type,
cause, and originating transaction.
Later in MySQL Cluster 7.4
• Conflicting deletes
Handling of Conflicts
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
How to Use Conflict Detection/Resolution
Decide which
tables need
protecting
For each table,
specify what to
do on conflicts
Just record in
exception table
Application or
DBA acts on
content
Rollback the
conflicting row
Rollback the
conflicting
transaction
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Restart Times
• Restarting data node with locally checkpointed data
– Major improvement
• Restarting data node which must recover data from peer
– Major improvement
– Further speedups to come in 7.4.X (greater parallelization)
• Upgrade/rolling restarts
– Major improvement
• Cluster shutdown and restart
– Minor improvement
What operations benefit?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Enhanced Memory Reporting
mysql> CREATE DATABASE clusterdb;USE clusterdb;
mysql> CREATE TABLE simples (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=NDB;
mysql> select node_id AS node, fragment_num AS frag, fixed_elem_alloc_bytes alloc_bytes,
fixed_elem_free_bytes AS free_bytes, fixed_elem_free_rows AS spare_rows from
memory_per_fragment where fq_name like '%simples%';
+------+------+-------------+------------+------------+
| node | frag | alloc_bytes | free_bytes | spare_rows |
+------+------+-------------+------------+------------+
| 1 | 0 | 131072 | 5504 | 172 |
| 1 | 2 | 131072 | 1280 | 40 |
| 2 | 0 | 131072 | 5504 | 172 |
| 2 | 2 | 131072 | 1280 | 40 |
| 3 | 1 | 131072 | 3104 | 97 |
| 3 | 3 | 131072 | 4256 | 133 |
| 4 | 1 | 131072 | 3104 | 97 |
| 4 | 3 | 131072 | 4256 | 133 |
+------+------+-------------+------------+------------+
See how much memory a table is using
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Enhanced Memory Reporting
+------+------+-------------+------------+------------+
| node | frag | alloc_bytes | free_bytes | spare_rows |
+------+------+-------------+------------+------------+
| 1 | 0 | 131072 | 5504 | 172 |
| 1 | 2 | 131072 | 1280 | 40 |
| 2 | 0 | 131072 | 5504 | 172 |
| 2 | 2 | 131072 | 1280 | 40 |
| 3 | 1 | 131072 | 3104 | 97 |
| 3 | 3 | 131072 | 4256 | 133 |
| 4 | 1 | 131072 | 3104 | 97 |
| 4 | 3 | 131072 | 4256 | 133 |
+------+------+-------------+------------+------------+
mysql> DELETE FROM clusterdb.simples LIMIT 1;
+------+------+-------------+------------+------------+
| node | frag | alloc_bytes | free_bytes | spare_rows |
+------+------+-------------+------------+------------+
| 1 | 0 | 131072 | 5504 | 172 |
| 1 | 2 | 131072 | 1312 | 41 |
| 2 | 0 | 131072 | 5504 | 172 |
| 2 | 2 | 131072 | 1312 | 41 |
| 3 | 1 | 131072 | 3104 | 97 |
| 3 | 3 | 131072 | 4288 | 134 |
| 4 | 1 | 131072 | 3104 | 97 |
| 4 | 3 | 131072 | 4288 | 134 |
+------+------+-------------+------------+------------+
See how memory is made available after deleting rows
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Enhanced Memory Reporting
mysql> CREATE TABLE simples (id INT NOT NULL AUTO_INCREMENT, species VARCHAR(20) DEFAULT "Human",
PRIMARY KEY(id, species)) engine=ndb PARTITION BY KEY(species);
// Add some data
mysql> select node_id AS node, fragment_num AS frag, fixed_elem_alloc_bytes alloc_bytes,
fixed_elem_free_bytes AS free_bytes, fixed_elem_free_rows AS spare_rows from ndbinfo.memory_per_fragment
where fq_name like '%simples%';
+------+------+-------------+------------+------------+
| node | frag | alloc_bytes | free_bytes | spare_rows |
+------+------+-------------+------------+------------+
| 1 | 0 | 0 | 0 | 0 |
| 1 | 2 | 196608 | 11732 | 419 |
| 2 | 0 | 0 | 0 | 0 |
| 2 | 2 | 196608 | 11732 | 419 |
| 3 | 1 | 0 | 0 | 0 |
| 3 | 3 | 0 | 0 | 0 |
| 4 | 1 | 0 | 0 | 0 |
| 4 | 3 | 0 | 0 | 0 |
+------+------+-------------+------------+------------+
Check how well partitioned/sharded a table is
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle MySQL HA & Scaling Solutions
MySQL
Replication
MySQL
Fabric
Oracle VM
Template
Oracle
Clusterware
Solaris
Cluster
Windows
Cluster
DRBD
MySQL
Cluster
App Auto-Failover ✖ ✔ ✔ ✔ ✔ ✔ ✔ ✔
Data Layer Auto-Failover ✖ ✔ ✔ ✔ ✔ ✔ ✔ ✔
Zero Data Loss MySQL 5.7 MySQL 5.7 ✔ ✔ ✔ ✔ ✔ ✔
Platform Support All All Linux Linux Solaris Windows Linux All
Clustering Mode
Master +
Slaves
Master +
Slaves
Active/Pas
sive
Active/Passi
ve
Active/P
assive
Active/Pas
sive
Active/P
assive
Multi-
Master
Failover Time N/A Secs Secs + Secs + Secs + Secs + Secs + < 1 Sec
Scale-out Reads ✔ ✖ ✖ ✖ ✖ ✖ ✔
Cross-shard operations N/A ✖ N/A N/A N/A N/A N/A ✔
Transparent routing ✖ For HA ✔ ✔ ✔ ✔ ✔ ✔
Shared Nothing ✔ ✔ ✖ ✖ ✖ ✖ ✔ ✔
Storage Engine InnoDB+ InnoDB+ InnoDB+ InnoDB+ InnoDB+ InnoDB+ InnoDB+ NDB
Single Vendor Support ✔ ✔ ✔ ✔ ✔ ✖ ✔ ✔
30
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
When to Consider MySQL Cluster
• Scalability demands
– Sharding for write performance?
• Latency demands
– Cost of each millisecond?
• Uptime requirements
– Cost per minute of downtime?
– Failure versus maintenance?
• Application agility
– Developer languages and frameworks?
– SQL or NoSQL?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Auto-Installer
• Fast configuration
• Auto-discovery
• Workload optimized
• Repeatable best practices
Specify
Workload
Auto-
Discover
Define
Topology
Deploy
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Enhancing DevOps Agility, Reducing Downtime
MySQL Cluster Manager
Automated Management
• Start / Stop node or
whole cluster
• On-Line Scaling
• On-Line Reconfiguration
• On-Line Upgrades
• On-Line Backup &
Restore
• Import Running Cluster
Self-Healing
• Node monitoring
• Auto-recovery extended
to SQL + mgmt nodes
HA Operations
• Cluster-wide
configuration
consistency
• Persistent
configurations
• HA Agents
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Upgrade using MCM
MySQL Cluster Data Nodes
Application Layer
Data Layer
upgrade cluster --package=7.3 mycluster;
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Manager 1.3.2 GA
Available Now!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Cluster Manager 1.3.2 GA
“Unmanaged” production Cluster
mcm> create cluster --import
mcm> import config [--dryrun]
mcm> import cluster[--dryrun]
Cluster now managed by MCM
Import a running Cluster into MCM
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Oracle University MySQL Training Services
Prepare Your Organization to Enable Reliable and High-Performance Web-Based Database Applications
“Training and team skill
have the most significant impact on overall performance of
technology and success of technology projects.” - IDC, 2013
Premier Support customers eligible to
save 20% on learning credits.
Benefits
 Expert-led training to support your MySQL learning needs
 Flexibility to train in the classroom or online
 Hands-on experience to gain real world experience
 Key skills needed for database administrators and developers
• MySQL for Beginners
 MySQL for Database Administrators
 MySQL Performance Tuning
 MySQL Cluster – NEW - Register Your Interest!
 MySQL and PHP - Developing Dynamic Web Applications
 MySQL for Developers
 MySQL Developer Techniques
 MySQL 5.6 Database Administrator
 MySQL 5.6 Developer
To find out more about available MySQL Training & Certification
offerings, go to: education.oracle.com/mysql
Top Courses for Administrators and Developers
Top Certifications
RECENTLY RELEASED
!!ALL NEW!! MySQL Cluster Training
To Register your interest to influence the
schedule on this newly released course – go to
education.oracle.com/mysql and click on the
MySQL Cluster Course
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Next Steps
Learn More
• www.mysql.com/cluster
• Authentic MySQL Curriculum: http://oracle.com/education/mysql
Try it Out
• dev.mysql.com/downloads/cluster/
Let us know what you think
• bugs.mysql.com
• forums.mysql.com/list.php?25

More Related Content

PPTX
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
PDF
Exploring mysql cluster 7.4
PDF
20141011 my sql clusterv01pptx
PDF
MySQL Cluster
PPT
2010 12 mysql_clusteroverview
PDF
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
PDF
MySQL Cluster as Transactional NoSQL (KVS)
PDF
200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
Exploring mysql cluster 7.4
20141011 my sql clusterv01pptx
MySQL Cluster
2010 12 mysql_clusteroverview
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
MySQL Cluster as Transactional NoSQL (KVS)
200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4

Similar to 2_MySQL_Cluster_Introduction.pdf (20)

PDF
NoSQL and MySQL
PPTX
What's new in MySQL Cluster 7.4 webinar charts
PDF
MySQL Cluster overview + development slides (2014)
PDF
MySQL Cluster Scaling to a Billion Queries
PDF
Mysql NDB Cluster's Asynchronous Parallel Design for High Performance
PDF
MySQL NDB Cluster 8.0
PDF
NoSQL and MySQL: News about JSON
PPTX
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
PDF
Introduction to MySQL
ODP
MySQL Cluster
PDF
Mysql wp cluster_evalguide
PDF
Breakthrough performance with MySQL Cluster (2012)
PDF
MySQL NDB Cluster 101
PDF
Ndb cluster 80_requirements
PDF
Scaling MySQL -- Swanseacon.co.uk
ODP
MySQL HA
PDF
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
PDF
MySQL Performance Tuning: The Perfect Scalability (OOW2019)
PDF
C:\fakepath\cluster 7 1
PDF
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
NoSQL and MySQL
What's new in MySQL Cluster 7.4 webinar charts
MySQL Cluster overview + development slides (2014)
MySQL Cluster Scaling to a Billion Queries
Mysql NDB Cluster's Asynchronous Parallel Design for High Performance
MySQL NDB Cluster 8.0
NoSQL and MySQL: News about JSON
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
Introduction to MySQL
MySQL Cluster
Mysql wp cluster_evalguide
Breakthrough performance with MySQL Cluster (2012)
MySQL NDB Cluster 101
Ndb cluster 80_requirements
Scaling MySQL -- Swanseacon.co.uk
MySQL HA
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL Performance Tuning: The Perfect Scalability (OOW2019)
C:\fakepath\cluster 7 1
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...

Recently uploaded (20)

PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
.pdf is not working space design for the following data for the following dat...
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PDF
Clinical guidelines as a resource for EBP(1).pdf
PPTX
IB Computer Science - Internal Assessment.pptx
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPT
Reliability_Chapter_ presentation 1221.5784
PDF
Introduction to Data Science and Data Analysis
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PDF
Lecture1 pattern recognition............
PPTX
Introduction to machine learning and Linear Models
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
Business Analytics and business intelligence.pdf
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
Introduction to Knowledge Engineering Part 1
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
.pdf is not working space design for the following data for the following dat...
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Business Ppt On Nestle.pptx huunnnhhgfvu
Qualitative Qantitative and Mixed Methods.pptx
Clinical guidelines as a resource for EBP(1).pdf
IB Computer Science - Internal Assessment.pptx
IBA_Chapter_11_Slides_Final_Accessible.pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
Reliability_Chapter_ presentation 1221.5784
Introduction to Data Science and Data Analysis
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Lecture1 pattern recognition............
Introduction to machine learning and Linear Models
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Business Analytics and business intelligence.pdf
STUDY DESIGN details- Lt Col Maksud (21).pptx
Introduction to Knowledge Engineering Part 1

2_MySQL_Cluster_Introduction.pdf

  • 1. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Introduction and latest news from OOW Ted Wennmark ted.wennmark@oracle.com Osaka (2nd) and Tokyo (4th) of December 2014
  • 2. Copyright © 2014, 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.
  • 3. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Today’s Database Requirements Extreme Write Scalability Real-Time User Experience Rock Solid Reliability Rapid Service Innovation
  • 4. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Today’s Database Requirements Extreme Write Scalability Real-Time User Experience Rock Solid Reliability Rapid Service Innovation Transactional Integrity OLTP + Real-Time Analytics Standards & Skillsets
  • 5. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Who’s Using MySQL Cluster
  • 6. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Overview • Auto-Sharding, Multi-Master • ACID Compliant, OLTP + Real-Time Analytics HIGH SCALE, READS + WRITES • Shared nothing, no Single Point of Failure • Self Healing + On-Line Operations 99.999% AVAILABILITY • In-Memory Optimization + Disk-Data • Predictable Low-Latency, Bounded Access Time REAL-TIME • Key/Value + Complex, Relational Queries • SQL + Memcached + JavaScript + Java + HTTP/REST & C++ SQL + NoSQL • Open Source + Commercial Editions • Commodity hardware + Management, Monitoring Tools LOW TCO
  • 7. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Architecture MySQL Cluster Data Nodes Clients Application Layer Data Layer
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Scaling MySQL Cluster Data Nodes Clients Application Layer Data Layer
  • 9. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
  • 10. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster HA MySQL Cluster Data Nodes Clients Application Layer Data Layer
  • 11. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
  • 12. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | On-Line Operations Scale Backup Evolve Upgrade
  • 13. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster 7.3: 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 0 5 10 15 20 25 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 Millions of UPDATEs per Second MySQL Cluster Data Nodes
  • 14. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
  • 15. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 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++) NoSQL Access to MySQL Cluster data MySQL Cluster Data Nodes
  • 16. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Cluster & Memcached – Schema-Free <town:maidenhead,SL6> key value <town:maidenhead,SL6> key value Key Value town:maidenhead SL6 generic table Application view SQL view
  • 17. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Cluster & Memcached - Configured Schema <town:maidenhead,SL6> prefix key value <town:maidenhead,SL6> key value Prefix Table Key-col Val-col policy town: map.zip town code cluster Config tables town ... code ... maidenhead ... SL6 ... map.zip Application view SQL view
  • 18. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Node.js NoSQL API • Native JavaScript access to MySQL Cluster – End-to-End JavaScript: browser to the app & DB – Storing and retrieving JavaScript objects directly in MySQL Cluster – Eliminate SQL transformation • Implemented as a module for node.js – Integrates Cluster API library within the web app • Couple high performance, distributed apps, with high performance distributed database • Optionally routes through MySQL Server V8 JavaScript Engine MySQL Cluster Node.js Module MySQL Cluster Data Nodes Clients
  • 19. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster 7.4.1 DMR Available Now!
  • 20. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Better performance and operational simplicity MySQL Cluster 7.4.1 DMR • Performance gain over 7.3 – 47% (Read-Only) – 38% (Read-Write) • Faster maintenance operations – Nodal & Rolling restarts – Upgrades
  • 21. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Asynchronous replication between MySQL Clusters • Active-Active – Update anywhere – Conflict detection • Application notified through exception tables • Can opt to have conflicts resolved automatically – Auto-conflict-resolution • NDB$EPOCH, conflicting rows are rolled back • NDB$EPOCH_TRANS, conflicting transactions are rolled back Active-Active Geo-Replication
  • 22. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | What is a conflict? John.balance==$100 John.balance-=$40 John.balance==$60 John.balance==$200 John.balance==$100 John.balance+= $100 John.balance==$200 John.balance==$60 Spend $40 Add $100 $60 $200
  • 23. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Primary store logical timestamp (GCI) against updated row – Window for conflict opens • GCI replicated with updated row to Secondary • The same row and GCI is replicated back (reflected) from Secondary to Primary after it has been applied – Closing window for conflict • Primary checks every event originating from the Secondary to ensure it isn’t for a ‘conflictable’ row Detecting Conflicts - Reflected GCI John.balance==$100 John.balance-=$40 John.balance==$60 John.balance==$200 John.balance==$100 John.balance+= $100 John.balance==$200 John.balance==$60 Spend $40 Add $100 $60 $200 Primary Secondary
  • 24. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster 7.4.1 DMR • Rolling back of transactions that read conflicted data. • Entire transactions (and dependent ones) rolled back. • Information of conflict's type, cause, and originating transaction. Later in MySQL Cluster 7.4 • Conflicting deletes Handling of Conflicts
  • 25. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | How to Use Conflict Detection/Resolution Decide which tables need protecting For each table, specify what to do on conflicts Just record in exception table Application or DBA acts on content Rollback the conflicting row Rollback the conflicting transaction
  • 26. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Restart Times • Restarting data node with locally checkpointed data – Major improvement • Restarting data node which must recover data from peer – Major improvement – Further speedups to come in 7.4.X (greater parallelization) • Upgrade/rolling restarts – Major improvement • Cluster shutdown and restart – Minor improvement What operations benefit?
  • 27. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Enhanced Memory Reporting mysql> CREATE DATABASE clusterdb;USE clusterdb; mysql> CREATE TABLE simples (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=NDB; mysql> select node_id AS node, fragment_num AS frag, fixed_elem_alloc_bytes alloc_bytes, fixed_elem_free_bytes AS free_bytes, fixed_elem_free_rows AS spare_rows from memory_per_fragment where fq_name like '%simples%'; +------+------+-------------+------------+------------+ | node | frag | alloc_bytes | free_bytes | spare_rows | +------+------+-------------+------------+------------+ | 1 | 0 | 131072 | 5504 | 172 | | 1 | 2 | 131072 | 1280 | 40 | | 2 | 0 | 131072 | 5504 | 172 | | 2 | 2 | 131072 | 1280 | 40 | | 3 | 1 | 131072 | 3104 | 97 | | 3 | 3 | 131072 | 4256 | 133 | | 4 | 1 | 131072 | 3104 | 97 | | 4 | 3 | 131072 | 4256 | 133 | +------+------+-------------+------------+------------+ See how much memory a table is using
  • 28. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Enhanced Memory Reporting +------+------+-------------+------------+------------+ | node | frag | alloc_bytes | free_bytes | spare_rows | +------+------+-------------+------------+------------+ | 1 | 0 | 131072 | 5504 | 172 | | 1 | 2 | 131072 | 1280 | 40 | | 2 | 0 | 131072 | 5504 | 172 | | 2 | 2 | 131072 | 1280 | 40 | | 3 | 1 | 131072 | 3104 | 97 | | 3 | 3 | 131072 | 4256 | 133 | | 4 | 1 | 131072 | 3104 | 97 | | 4 | 3 | 131072 | 4256 | 133 | +------+------+-------------+------------+------------+ mysql> DELETE FROM clusterdb.simples LIMIT 1; +------+------+-------------+------------+------------+ | node | frag | alloc_bytes | free_bytes | spare_rows | +------+------+-------------+------------+------------+ | 1 | 0 | 131072 | 5504 | 172 | | 1 | 2 | 131072 | 1312 | 41 | | 2 | 0 | 131072 | 5504 | 172 | | 2 | 2 | 131072 | 1312 | 41 | | 3 | 1 | 131072 | 3104 | 97 | | 3 | 3 | 131072 | 4288 | 134 | | 4 | 1 | 131072 | 3104 | 97 | | 4 | 3 | 131072 | 4288 | 134 | +------+------+-------------+------------+------------+ See how memory is made available after deleting rows
  • 29. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Enhanced Memory Reporting mysql> CREATE TABLE simples (id INT NOT NULL AUTO_INCREMENT, species VARCHAR(20) DEFAULT "Human", PRIMARY KEY(id, species)) engine=ndb PARTITION BY KEY(species); // Add some data mysql> select node_id AS node, fragment_num AS frag, fixed_elem_alloc_bytes alloc_bytes, fixed_elem_free_bytes AS free_bytes, fixed_elem_free_rows AS spare_rows from ndbinfo.memory_per_fragment where fq_name like '%simples%'; +------+------+-------------+------------+------------+ | node | frag | alloc_bytes | free_bytes | spare_rows | +------+------+-------------+------------+------------+ | 1 | 0 | 0 | 0 | 0 | | 1 | 2 | 196608 | 11732 | 419 | | 2 | 0 | 0 | 0 | 0 | | 2 | 2 | 196608 | 11732 | 419 | | 3 | 1 | 0 | 0 | 0 | | 3 | 3 | 0 | 0 | 0 | | 4 | 1 | 0 | 0 | 0 | | 4 | 3 | 0 | 0 | 0 | +------+------+-------------+------------+------------+ Check how well partitioned/sharded a table is
  • 30. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle MySQL HA & Scaling Solutions MySQL Replication MySQL Fabric Oracle VM Template Oracle Clusterware Solaris Cluster Windows Cluster DRBD MySQL Cluster App Auto-Failover ✖ ✔ ✔ ✔ ✔ ✔ ✔ ✔ Data Layer Auto-Failover ✖ ✔ ✔ ✔ ✔ ✔ ✔ ✔ Zero Data Loss MySQL 5.7 MySQL 5.7 ✔ ✔ ✔ ✔ ✔ ✔ Platform Support All All Linux Linux Solaris Windows Linux All Clustering Mode Master + Slaves Master + Slaves Active/Pas sive Active/Passi ve Active/P assive Active/Pas sive Active/P assive Multi- Master Failover Time N/A Secs Secs + Secs + Secs + Secs + Secs + < 1 Sec Scale-out Reads ✔ ✖ ✖ ✖ ✖ ✖ ✔ Cross-shard operations N/A ✖ N/A N/A N/A N/A N/A ✔ Transparent routing ✖ For HA ✔ ✔ ✔ ✔ ✔ ✔ Shared Nothing ✔ ✔ ✖ ✖ ✖ ✖ ✔ ✔ Storage Engine InnoDB+ InnoDB+ InnoDB+ InnoDB+ InnoDB+ InnoDB+ InnoDB+ NDB Single Vendor Support ✔ ✔ ✔ ✔ ✔ ✖ ✔ ✔ 30
  • 31. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | When to Consider MySQL Cluster • Scalability demands – Sharding for write performance? • Latency demands – Cost of each millisecond? • Uptime requirements – Cost per minute of downtime? – Failure versus maintenance? • Application agility – Developer languages and frameworks? – SQL or NoSQL?
  • 32. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
  • 33. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Auto-Installer • Fast configuration • Auto-discovery • Workload optimized • Repeatable best practices Specify Workload Auto- Discover Define Topology Deploy
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Enhancing DevOps Agility, Reducing Downtime MySQL Cluster Manager Automated Management • Start / Stop node or whole cluster • On-Line Scaling • On-Line Reconfiguration • On-Line Upgrades • On-Line Backup & Restore • Import Running Cluster Self-Healing • Node monitoring • Auto-recovery extended to SQL + mgmt nodes HA Operations • Cluster-wide configuration consistency • Persistent configurations • HA Agents
  • 36. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Upgrade using MCM MySQL Cluster Data Nodes Application Layer Data Layer upgrade cluster --package=7.3 mycluster;
  • 37. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Manager 1.3.2 GA Available Now!
  • 38. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Cluster Manager 1.3.2 GA “Unmanaged” production Cluster mcm> create cluster --import mcm> import config [--dryrun] mcm> import cluster[--dryrun] Cluster now managed by MCM Import a running Cluster into MCM
  • 39. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle University MySQL Training Services Prepare Your Organization to Enable Reliable and High-Performance Web-Based Database Applications “Training and team skill have the most significant impact on overall performance of technology and success of technology projects.” - IDC, 2013 Premier Support customers eligible to save 20% on learning credits. Benefits  Expert-led training to support your MySQL learning needs  Flexibility to train in the classroom or online  Hands-on experience to gain real world experience  Key skills needed for database administrators and developers • MySQL for Beginners  MySQL for Database Administrators  MySQL Performance Tuning  MySQL Cluster – NEW - Register Your Interest!  MySQL and PHP - Developing Dynamic Web Applications  MySQL for Developers  MySQL Developer Techniques  MySQL 5.6 Database Administrator  MySQL 5.6 Developer To find out more about available MySQL Training & Certification offerings, go to: education.oracle.com/mysql Top Courses for Administrators and Developers Top Certifications RECENTLY RELEASED !!ALL NEW!! MySQL Cluster Training To Register your interest to influence the schedule on this newly released course – go to education.oracle.com/mysql and click on the MySQL Cluster Course
  • 40. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Next Steps Learn More • www.mysql.com/cluster • Authentic MySQL Curriculum: http://oracle.com/education/mysql Try it Out • dev.mysql.com/downloads/cluster/ Let us know what you think • bugs.mysql.com • forums.mysql.com/list.php?25