SlideShare a Scribd company logo
NoSQL and SQL: The Best of Both
Worlds
Andrew Morgan
@andrewmorgan
clusterdb.com
1st February 2015
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 2
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 3
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 4
Graph Database
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 5
NoSQL
Simple access patterns
Compromise on consistency
for performance
Ad-hoc data format
Simple operation
SQL
Complex queries with joins
ACID transactions
Well defined schemas
Rich set of tools
Still a role for SQL (RDBMS)?
Scalability
Performance
HA
Ease of use
SQL/Joins
ACID Transactions
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 6
The Temptation to Jettison Relational Model
• Relational Model:
– Data stored in multiple tables
– Many lookups to retrieve a user’s
timeline
– Is it worth the effort in setting up
this complex data model?
• Simpler just to store as one
document?
The allure of document stores
Examples borrowed from @sarahmei https://speakerdeck.com/sarahmei/switching-data-stores-a-postmodern-comedy
user
friend
post
comment
like
liker
commenter
many
many
many
one
one
many
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 7
The Temptation to Jettison Relational Model
• Document Model:
– Entire timeline in a single
document (row)
– Single lookup to retrieve the
user’s timeline
– Brilliantly efficient model when
the document truly contains self-
contained information
• Like a real-world document!
The allure of document stores
{name: ‘Joe’,
url: ‘http://clusterdb.com’,
stream:[
{friend:{
name: ‘Jane’,
posts:[{content: ‘…’,
comments:[
{comment: ‘…’,
commenter: ‘Joe’},
{…}
],
likes: [‘Joe’, ‘Fred’, ‘Billy’]
},
{…},{…},…
]
}, {…},{…},…
}
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 8
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 9
The Temptation to Jettison Relational Model
• These are all people who have
their own data that users will
want to view or click through:
– Name
– url
– Timeline
• Easy to represent with FKs in a
relational model
But when the data isn’t self contained…
user
friend
post
comment
like
liker
commenter
many
many
many
one
one
many
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 10
The Temptation to Jettison Relational Model
• Do I store all data for all friends
and likers again at every point they
appear in the document?
• Massive amount of repeated data
– Wasted space
– Needs to be kept in sync (and you don’t
have transactions to provide
consistency)
The allure of document stores
{name: ‘Joe’,
url: ‘http://clusterdb.com’,
stream:[
{friend:{
name: ‘Jane’,
posts:[{content: ‘…’,
comments:[
{comment: ‘…’,
commenter: ‘Joe’},
{…}
],
likes: [‘Joe’, ‘Fred’, ‘Billy’]
},
{…},{…},…
]
}, {…},{…},…
}
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 11
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 12
The Temptation to Jettison Relational Model
• The reality is that the developer
will store the user-ids instead
• Developer is responsible for
implementing ‘joins’ in the
application
– e.g. scanning all timelines for where a
user made a comment or liked a post
• No transactions to ensure
consistency between documents
The allure of document stores
{name: 83746251,
url: ‘…’
stream:[
{friend:{
name: 9384726153,
posts:[{content: ‘…’,
comments:[
{comment: ‘…’,
commenter: 83746251},
{…}
],
likes: [83746251, 750730283,
2938493820]
},
{…},{…},…
]
}, {…},{…},…
}
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 13
The Temptation to Jettison Relational Model
• Each attribute’s labels are stored in
every document
– More wasted space
– Developers compensate by replacing
with short names
The allure of document stores
{n5: 83746251,
u2: ‘…’
s1:[
{f2:{
n5: 9384726153,
p4:[{c4: ‘…’,
c3:[
{c2: ‘…’,
c8: 83746251},
{…}
],
l5: [83746251, 750730283,
2938493820]
},
{…},{…},…
]
}, {…},{…},…
}
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 14
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 15
MySQL Cluster Overview
• In-Memory Optimization + Disk-Data
• Predictable Low-Latency, Bounded Access Time
REAL-TIME
• 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
• 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
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 16
MySQL Cluster Architecture
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 17
MySQL Cluster Scaling
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 18
MySQL Cluster HA
MySQL Cluster Data Nodes
Clients
Application Layer
Data Layer
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 19
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 20
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 21
1.2 Billion UPDATEs per Minute
• Distributed Joins also
possible
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
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 22
Scalability a
Performance a
HA a
Ease of use
SQL/Joins a
ACID Transactions a
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 23
Scalability a
Performance a
HA a
Ease of use a
SQL/Joins a
ACID Transactions a
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 24
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 25
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 26
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
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 27
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
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 28
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
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 29
NoSQL API for Node.js & FKs
FKs enforced on all APIs:
{ message: 'Error',
sqlstate: '23000',
ndb_error: null,
cause:
{message: 'Foreign key constraint violated: No parent row found [255]',
sqlstate: '23000',
ndb_error:
{ message: 'Foreign key constraint violated: No parent row found',
code: 255,
classification: 'ConstraintViolation',
handler_error_code: 151,
status: 'PermanentError' },
cause: null } }
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 30
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
• clusterdb.com
• @clusterdb
• forums.mysql.com/list.php?25
1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 31

More Related Content

PPTX
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
PPTX
What's new in MySQL Cluster 7.4 webinar charts
PDF
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
PDF
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
ODP
MySQL HA Alternatives 2010
PDF
MySQL Document Store - A Document Store with all the benefts of a Transactona...
PPTX
Data Streaming with Apache Kafka & MongoDB - EMEA
PDF
MySQL Cluster performance best practices
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
What's new in MySQL Cluster 7.4 webinar charts
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL HA Alternatives 2010
MySQL Document Store - A Document Store with all the benefts of a Transactona...
Data Streaming with Apache Kafka & MongoDB - EMEA
MySQL Cluster performance best practices

What's hot (20)

PDF
MySQL for Software-as-a-Service (SaaS)
PPTX
PASS Summit - SQL Server 2017 Deep Dive
PDF
MySQL Intro JSON NoSQL
PDF
MySQL Manchester TT - 5.7 Whats new
PDF
Successful MySQL Scalability
PDF
MySQL Tech Tour 2015 - Alt Intro
PPTX
2019 - OOW - Database Migration Methods from On-Premise to Cloud
PPTX
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...
PDF
Open Innovation with Power Systems
PDF
Mysql Enterprise Edition Feature and Tools
PPTX
Mysql ecosystem in 2019
PPTX
The rise of microservices - containers and orchestration
PPTX
Accelerating Business Intelligence Solutions with Microsoft Azure pass
PPT
MySQL Tech Tour 2015 - 5.7 Connector/J/Net
PDF
MySQL Manchester TT - Replication Features
PPTX
SQL Server on Linux - march 2017
PPTX
Expert summit SQL Server 2016
PDF
Temporal Tables, Transparent Archiving in DB2 for z/OS and IDAA
PDF
Oracle’s Advanced Analytics & Machine Learning 12.2c New Features & Road Map;...
PDF
MySQL Enterprise Edition Overview
MySQL for Software-as-a-Service (SaaS)
PASS Summit - SQL Server 2017 Deep Dive
MySQL Intro JSON NoSQL
MySQL Manchester TT - 5.7 Whats new
Successful MySQL Scalability
MySQL Tech Tour 2015 - Alt Intro
2019 - OOW - Database Migration Methods from On-Premise to Cloud
Bridging Oracle Database and Hadoop by Alex Gorbachev, Pythian from Oracle Op...
Open Innovation with Power Systems
Mysql Enterprise Edition Feature and Tools
Mysql ecosystem in 2019
The rise of microservices - containers and orchestration
Accelerating Business Intelligence Solutions with Microsoft Azure pass
MySQL Tech Tour 2015 - 5.7 Connector/J/Net
MySQL Manchester TT - Replication Features
SQL Server on Linux - march 2017
Expert summit SQL Server 2016
Temporal Tables, Transparent Archiving in DB2 for z/OS and IDAA
Oracle’s Advanced Analytics & Machine Learning 12.2c New Features & Road Map;...
MySQL Enterprise Edition Overview
Ad

Viewers also liked (15)

PDF
No sql with mysql cluster (MyNA・JPUG合同DB勉強会)
PPTX
MongoDB 3.4 webinar
PPT
MySQL Cluster Basics
PDF
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
PDF
Seminar : &quot;The Future of MYSQL - Roadmap to Success&quot; session MySQL...
PDF
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
PPT
Building a Scalable Architecture for web apps
PDF
Mysql cluster introduction
PDF
MySQL Developer Day conference: MySQL Replication and Scalability
PDF
NoSQL and SQL - blending the best of both worlds
PPTX
MySQL High Availability Solutions - Feb 2015 webinar
PDF
Best practices for MySQL High Availability
PPT
7 Stages of Scaling Web Applications
PPTX
Facebook architecture presentation: scalability challenge
PDF
Architecture of a Modern Web App
No sql with mysql cluster (MyNA・JPUG合同DB勉強会)
MongoDB 3.4 webinar
MySQL Cluster Basics
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
Seminar : &quot;The Future of MYSQL - Roadmap to Success&quot; session MySQL...
Seminar : &quot;The Future of MySQL - Roadmap to Success&quot; session MySQL ...
Building a Scalable Architecture for web apps
Mysql cluster introduction
MySQL Developer Day conference: MySQL Replication and Scalability
NoSQL and SQL - blending the best of both worlds
MySQL High Availability Solutions - Feb 2015 webinar
Best practices for MySQL High Availability
7 Stages of Scaling Web Applications
Facebook architecture presentation: scalability challenge
Architecture of a Modern Web App
Ad

Similar to FOSDEM 2015 - NoSQL and SQL the best of both worlds (20)

PPTX
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
PDF
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
PDF
MySQL 8.0 Document Store - Discovery of a New World
PDF
MySQL Cluster
PDF
MySQL Cluster as Transactional NoSQL (KVS)
PDF
NoSQL and MySQL
PDF
NoSQL and MySQL: News about JSON
PPTX
Big Data And No SQL
PDF
MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...
PPTX
NoSQL Architecture Overview
PDF
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
PDF
MySQL Cluster overview + development slides (2014)
PPTX
Introduction to NoSQL database technology
PDF
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
PDF
Introduction to MySQL Document Store
PPTX
A Step by Step Introduction to the MySQL Document Store
PDF
Beyond Relational Databases
PDF
Oracle Open World 2018 / Code One : MySQL 8.0 Document Store
PDF
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
PDF
Oracle NoSQL Database -- Big Data Bellevue Meetup - 02-18-15
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
MySQL 8.0 Document Store - Discovery of a New World
MySQL Cluster
MySQL Cluster as Transactional NoSQL (KVS)
NoSQL and MySQL
NoSQL and MySQL: News about JSON
Big Data And No SQL
MySQL User Group NL: MySQL 8.0 Document Store- NoSQL with all the benefits of...
NoSQL Architecture Overview
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
MySQL Cluster overview + development slides (2014)
Introduction to NoSQL database technology
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
Introduction to MySQL Document Store
A Step by Step Introduction to the MySQL Document Store
Beyond Relational Databases
Oracle Open World 2018 / Code One : MySQL 8.0 Document Store
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
Oracle NoSQL Database -- Big Data Bellevue Meetup - 02-18-15

More from Andrew Morgan (6)

PPTX
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
PPTX
PistonHead's use of MongoDB for Analytics
PPTX
Joins and Other MongoDB 3.2 Aggregation Enhancements
PPTX
Document validation in MongoDB 3.2
PDF
MySQL Replication: What’s New in MySQL 5.7 and Beyond
PDF
Developing high-throughput services with no sql ap-is to innodb and mysql clu...
Powering Microservices with MongoDB, Docker, Kubernetes & Kafka – MongoDB Eur...
PistonHead's use of MongoDB for Analytics
Joins and Other MongoDB 3.2 Aggregation Enhancements
Document validation in MongoDB 3.2
MySQL Replication: What’s New in MySQL 5.7 and Beyond
Developing high-throughput services with no sql ap-is to innodb and mysql clu...

Recently uploaded (20)

PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
history of c programming in notes for students .pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
medical staffing services at VALiNTRY
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
AutoCAD Professional Crack 2025 With License Key
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
assetexplorer- product-overview - presentation
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Designing Intelligence for the Shop Floor.pdf
Reimagine Home Health with the Power of Agentic AI​
history of c programming in notes for students .pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Salesforce Agentforce AI Implementation.pdf
Download FL Studio Crack Latest version 2025 ?
medical staffing services at VALiNTRY
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Transform Your Business with a Software ERP System
AutoCAD Professional Crack 2025 With License Key
17 Powerful Integrations Your Next-Gen MLM Software Needs
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Nekopoi APK 2025 free lastest update
Digital Systems & Binary Numbers (comprehensive )
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Why Generative AI is the Future of Content, Code & Creativity?
assetexplorer- product-overview - presentation
Complete Guide to Website Development in Malaysia for SMEs
Designing Intelligence for the Shop Floor.pdf

FOSDEM 2015 - NoSQL and SQL the best of both worlds

  • 1. NoSQL and SQL: The Best of Both Worlds Andrew Morgan @andrewmorgan clusterdb.com 1st February 2015 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
  • 2. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 2
  • 3. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 3
  • 4. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 4
  • 5. Graph Database 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 5
  • 6. NoSQL Simple access patterns Compromise on consistency for performance Ad-hoc data format Simple operation SQL Complex queries with joins ACID transactions Well defined schemas Rich set of tools Still a role for SQL (RDBMS)? Scalability Performance HA Ease of use SQL/Joins ACID Transactions 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 6
  • 7. The Temptation to Jettison Relational Model • Relational Model: – Data stored in multiple tables – Many lookups to retrieve a user’s timeline – Is it worth the effort in setting up this complex data model? • Simpler just to store as one document? The allure of document stores Examples borrowed from @sarahmei https://speakerdeck.com/sarahmei/switching-data-stores-a-postmodern-comedy user friend post comment like liker commenter many many many one one many 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 7
  • 8. The Temptation to Jettison Relational Model • Document Model: – Entire timeline in a single document (row) – Single lookup to retrieve the user’s timeline – Brilliantly efficient model when the document truly contains self- contained information • Like a real-world document! The allure of document stores {name: ‘Joe’, url: ‘http://clusterdb.com’, stream:[ {friend:{ name: ‘Jane’, posts:[{content: ‘…’, comments:[ {comment: ‘…’, commenter: ‘Joe’}, {…} ], likes: [‘Joe’, ‘Fred’, ‘Billy’] }, {…},{…},… ] }, {…},{…},… } 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 8
  • 9. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 9
  • 10. The Temptation to Jettison Relational Model • These are all people who have their own data that users will want to view or click through: – Name – url – Timeline • Easy to represent with FKs in a relational model But when the data isn’t self contained… user friend post comment like liker commenter many many many one one many 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 10
  • 11. The Temptation to Jettison Relational Model • Do I store all data for all friends and likers again at every point they appear in the document? • Massive amount of repeated data – Wasted space – Needs to be kept in sync (and you don’t have transactions to provide consistency) The allure of document stores {name: ‘Joe’, url: ‘http://clusterdb.com’, stream:[ {friend:{ name: ‘Jane’, posts:[{content: ‘…’, comments:[ {comment: ‘…’, commenter: ‘Joe’}, {…} ], likes: [‘Joe’, ‘Fred’, ‘Billy’] }, {…},{…},… ] }, {…},{…},… } 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 11
  • 12. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 12
  • 13. The Temptation to Jettison Relational Model • The reality is that the developer will store the user-ids instead • Developer is responsible for implementing ‘joins’ in the application – e.g. scanning all timelines for where a user made a comment or liked a post • No transactions to ensure consistency between documents The allure of document stores {name: 83746251, url: ‘…’ stream:[ {friend:{ name: 9384726153, posts:[{content: ‘…’, comments:[ {comment: ‘…’, commenter: 83746251}, {…} ], likes: [83746251, 750730283, 2938493820] }, {…},{…},… ] }, {…},{…},… } 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 13
  • 14. The Temptation to Jettison Relational Model • Each attribute’s labels are stored in every document – More wasted space – Developers compensate by replacing with short names The allure of document stores {n5: 83746251, u2: ‘…’ s1:[ {f2:{ n5: 9384726153, p4:[{c4: ‘…’, c3:[ {c2: ‘…’, c8: 83746251}, {…} ], l5: [83746251, 750730283, 2938493820] }, {…},{…},… ] }, {…},{…},… } 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 14
  • 15. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 15
  • 16. MySQL Cluster Overview • In-Memory Optimization + Disk-Data • Predictable Low-Latency, Bounded Access Time REAL-TIME • 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 • 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 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 16
  • 17. MySQL Cluster Architecture MySQL Cluster Data Nodes Clients Application Layer Data Layer 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 17
  • 18. MySQL Cluster Scaling MySQL Cluster Data Nodes Clients Application Layer Data Layer 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 18
  • 19. MySQL Cluster HA MySQL Cluster Data Nodes Clients Application Layer Data Layer 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 19
  • 20. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 20
  • 21. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 21
  • 22. 1.2 Billion UPDATEs per Minute • Distributed Joins also possible 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 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 22 Scalability a Performance a HA a Ease of use SQL/Joins a ACID Transactions a
  • 23. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 23
  • 24. Scalability a Performance a HA a Ease of use a SQL/Joins a ACID Transactions a 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 24
  • 25. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 25
  • 26. 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 26
  • 27. 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 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 27
  • 28. 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 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 28
  • 29. 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 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 29
  • 30. NoSQL API for Node.js & FKs FKs enforced on all APIs: { message: 'Error', sqlstate: '23000', ndb_error: null, cause: {message: 'Foreign key constraint violated: No parent row found [255]', sqlstate: '23000', ndb_error: { message: 'Foreign key constraint violated: No parent row found', code: 255, classification: 'ConstraintViolation', handler_error_code: 151, status: 'PermanentError' }, cause: null } } 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 30
  • 31. 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 • clusterdb.com • @clusterdb • forums.mysql.com/list.php?25 1/2/2015 Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 31