mysql cluster introduction
DESCRIPTION
An introduction to MySQL Cluster - from FOSDEM 2013.TRANSCRIPT
MySQL Cluster Web Scalability, 99.999% Availability
Andrew Morgan @andrewmorgan www.clusterdb.com
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 2
Safe Harbour 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 © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 3
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
• Open Source + Commercial Editions • Commodity hardware + Management, Monitoring Tools
LOW TCO
• Key/Value + Complex, Relational Queries • SQL + Memcached + JavaScript + Java + JPA + HTTP/REST & C++
SQL + NoSQL
• In-Memory Optimization + Disk-Data • Predictable Low-Latency, Bounded Access Time
REAL-TIME
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 4
Who’s Using MySQL Cluster?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 5
MySQL Cluster Architecture
MySQL Cluster Data Nodes
Clients
Application Layer
Management
Data Layer
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 6
MySQL Cluster Architecture On-Line Scaling
MySQL Cluster Data Nodes
Clients
Application Layer
Management Management
Data Layer
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 7
http://clusterdb.com/u/pi
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 8
MySQL Cluster Architecture No Single Point of Failure
MySQL Cluster Data Nodes
Application Layer
Management Management
Clients
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 9
Data Node 1
Data Node 2
Data Node 3
Data Node 4
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 10
Data Node 1
Data Node 2
F1
Primary Fragment
Secondary Fragment
Data Node 3
Data Node 4 Fx
Fx
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 11
Data Node 1
Data Node 2
F1
Primary Fragment
Secondary Fragment
F1
Data Node 3
Data Node 4 Fx
Fx
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 12
Data Node 1
Data Node 2
F1
Primary Fragment
Secondary Fragment
F3 F1
Data Node 3
Data Node 4 Fx
Fx
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 13
Data Node 1
Data Node 2
F1 F3
Primary Fragment
Secondary Fragment
F3 F1
Data Node 3
Data Node 4 Fx
Fx
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 14
Data Node 1
Data Node 2
F1 F3
Primary Fragment
Secondary Fragment
F3 F1
Data Node 3
Data Node 4
F2 F4
F4 F2 Fx
Fx
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 15
Data Node 1
Data Node 2
F1 F3
Primary Fragment
Secondary Fragment
F3 F1
Data Node 3
Data Node 4
F2 F4
F4 F2
Node Group 1
Node Group 2 Fx
Fx
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 16
Data Node 1
Data Node 2
F1 F3
Primary Fragment
Secondary Fragment
F3 F1
Data Node 3
Data Node 4
F2 F4
F4 F2
Node Group 1
Node Group 2 Fx
Fx
Table T1
P2
P3
P4
Px Partition
P1
Automatic Data Partitioning
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 17
On-line Scheduled Maintenance
Scale
Upgrade
Backup
Evolve
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 18
Multi-Data Center Availability Geographic Replication
DR and Data Locality Replicate complete clusters
across data centers – Fully active/active – No passive resources
Split individual clusters across data centers
– Synchronous replication & auto-failover between sites
Geographic Replication
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 19
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
Mill
ions
of U
PDAT
Es p
er
Seco
nd
MySQL Cluster Data Nodes
1.2 Billion UPDATEs per Minute
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 20
Real-World Test Case
Web-Based Content Management System – JOINs 11-tables, 33.5k rows – Returns 2k rows, 19 columns per row
0102030405060708090
100
MySQL Cluster 7.1 MySQL Cluster 7.2
Query Execution Time Seconds
87.23 seconds
1.26 seconds
70x Faster
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 21
MySQL Cluster 7.3 EA: Node.js NoSQL API Native JavaScript access to MySQL Cluster
– End-to-End JavaScript: browser to the app and database
– Storing and retrieving JavaScript objects directly in MySQL Cluster
– Eliminate SQL transformation Implemented as a module for node.js
– Integrates full Cluster API library within the web app
Couple high performance, distributed apps, with high performance distributed database
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 22
MySQL Cluster 7.3 DMR1: Foreign Keys Brings MySQL Cluster to a broader range of workloads
– Packaged apps, custom projects Adds powerful functionality while reducing complexity
– App logic & data model Enabled by default Enforced for SQL & NoSQL APIs On-line add and drop
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 23
MySQL Cluster 7.2 and 7.3: Auto-Installer Early Access Feature
Fast configuration Workload optimized
New! Best practices
Specify Workload
Auto-Discover
Define Topology Deploy
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 24
When to Consider MySQL Cluster Scalability demands
Sharding for write performance?
Latency demands Cost of each second?
Uptime requirements Cost per minute of downtime? Failure versus maintenance?
Application agility Developer languages and frameworks? SQL or NoSQL?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. | 3rd February 2013 25
Next Steps Learn More • www.mysql.com/cluster • Authentic MySQL Curriculum:
http://oracle.com/education/mysql
Try it Out • dev.mysql.com/cluster • labs.mysql.com • github.com/mysql/mysql-js
Let us know what you think • clusterdb.com • @clusterdb • forums.mysql.com/list.php?25