SlideShare a Scribd company logo
MySQL NDB Cluster 101
MySQL Cluster
Proven in serving billions of people
every day when making phone calls,
playing online games or handling
financial transactions.
Massively linear scale
Always-On 99.9999% Availability
Sharded In-Memory Datasets
Always Consistent
Parallel Real-Time Performance.
Auto-partitioning, data distribution
and replication built-in.
Read- and Write Scale-Out
to many TB on commodity hardware.
Designed for mission critical
systems. Masterless, shared-nothing
with no single point of failure.
Transactional consistency across
distributed and partitioned dataset.
Out of the box straightforward
application programming.
Ease of use
Open Source
Written in C++. Can be used standalone
or with MySQL as a SQL front-end.
NDB is the highest throughput
distributed, in-memory, transactional
database in the world.
It’s open source!
Horizontal and vertical scale with MySQL Cluster
15TB in-memory per node

100+TB with on-disk
100+TB to 5 PB

in a single cluster
1 - 2GB/sec read/write 

transactions per shard
400k TPM DBT2

per 1 CPU socket
100+ data nodes
1-4 replicas
10k threads for parallel
query processing
Cluster drives systems with massive scale and real-time answering times
100M trades
analyzed 

every year
20B $ volume
every day
2+B mobile phone
users 

world wide


100+M in a
single installation
30+M active
gamers

every month
12+M in one
multi-player
> > >
MySQL Cluster linear scale
NoSQL Performance
Confidential – Oracle Internal/Restricted/Highly Restricted
Memory optimized tables
Durable
Mix with disk-based tables
Parallel table scans for non-indexed
searches
MySQL Cluster FlexAsych
200M NoSQL Reads/Second
!-!!!!
!50,000,000!!
!100,000,000!!
!150,000,000!!
!200,000,000!!
!250,000,000!!
2! 4! 6! 8! 10! 12! 14! 16! 18! 20! 22! 24! 26! 28! 30! 32!
Reads!per!second!
Data!Nodes!
FlexAsync!Reads!
MySQL Cluster Industries
Telecom
Gaming & Massive Parallel Online Games
Financials
MySQL Cluster Use Cases
• IOT - applications that write massive amounts of data in short periods of
time
• Shopping carts - durable, fast and frequent updates
• User tracking and monitoring
• Authentication and session management systems - real-time user
verification
• User profile and directories - reliable real-time information store
• Messaging systems
Use cluster if you need
Performance
Read and write
scalability
Real-time in-memory
Super low guaranteed
latency
Auto-Sharding
Elastic
Consistency
Always on
Always consistent
ACID
Global consistent view
of the data data
Cross-shard, cross-
replica foreign keys
SQL and NoSQL
Distributed key value
Advanced joins
Parallel distributed
query
Highly Available
Simple HA
Simple programing
MySQL Cluster Usage
• Key Value store

+ High Availability, Scale-Out, Durability
• Transactional object store

+ Multi row transactions and consistency
• Relational database

+ SQL joins, foreign keys, triggers, stored procedures,
generated columns, JSON, GIS, …
•
Usages
Confidential – Oracle Internal/Restricted/Highly Restricted
Steel Belted Radius Carrier Server
Provides centralized Authentication, Authorization, and
Accounting (AAA or Triple A) management for users who
connect and use a network service.


https://www.juniper.net/documentation/en_US/sbr-carrier8.3.0
Juniper
Radius Server
Switch
Scalable Session State Register
MySQL Cluster
Bredbandsbolaget (B2)
B2 application Nexus to authenticate and grant
customers access to B2 services including
broadband, VoIP and TV broadcasting.
MySQL Cluster for mission critical
authentication and authorisation services.
Up and serving through on-line versions
upgrades and maintenance since 2003!
Real Time Network Operation Platform
Internal Backoffice Systems
Subscriber Profiles
Authentication Services
B2 Core Network
Stream processing in the financial industry
Live trading data
Kafka
Messages
Message
Formatting
Message Event Bus
NDB native
Client processors
Confidential – Oracle Internal/Restricted/Highly Restricted
Hadoop (HopsFS) 

with MySQL Cluster
NameNodes
Leader
HDFS Client
DataNodes
hops.io
ClusterJ
Small
Files
Architecture
Clients
Cluster front-
ends and
connectors
Data Nodes
Partitioning- and distribution engine
Deployment examples
Dev setup
App or MySQL Server
connecting directly
locally to single data
node.
High available setup
Co-located app/MySQL
Server and data nodes
using shared memory
connections.
Classical 3-tier setup
Redundant
SQL and NoSQL mixed
access
Multiple SQL nodes and
native node.js accessing
same datasets
Sharding and redundancy with
no single point of failure
Multiple copies of data are maintained for availability
A group of data nodes shares the same data
1 - 4 replicas
High availability
• Up to 4 replicas per shard
• All replicas active
• Always consistent
• Microsecond failover
High availability
• Majority for 3 and 4 nodes
• Arbitration for 2 replicas
• Proudly using 2-phase
Lets crash an Availability Zone (AD)
• No service 

interruption
source: LogicalClocks, MySQL Innovation Day, January 23, 2019
Synchronous replication locally and asynchronous between physical locations
• With awareness of data locality and availability domains for cloud
Cluster
Data Nodes
Replication
Btw, conflict detection 

and automated resolution.
Data distribution
• Auto-sharding and distribution
No name-node or central master
• Each dataset is split into fragments and
distributed across data nodes
• Within a cluster data is always transactionally
consistent
MySQL Cluster Data Nodes
PK Service Data
253 Tiktok xxx
892 Snapchat xxx
253 Discord xxx
739 Instagram xxx
Data distribution
• Partition of all data to thousands of
virtual partitions
• Virtual partitions distributed to data
nodes
…
PK Service Data
253 Tiktok xxx
892 Snapchat xxx
253 Discord xxx
739 Instagram xxx
Data distribution
• Deterministic, random distribution by default
• Data in up to 32 data node local partitions
• each controlled by their own threads
• key to parallel query processing
PK Service Data
253 Tiktok xxx
892 Snapchat xxx
253 Discord xxx
739 Instagram xxx
Data distribution and HA
• Each partition is synchronously replicated to
peer data nodes
• ReplicaSets are called Node Group
• All partitions active for read and write
PK Service Data
253 Tiktok xxx
892 Snapchat xxx
253 Discord xxx
739 Instagram xxx
Node Group Node Group
On-line Scaling and Elasticity - Repartitioning
• Virtual partitions re-distributed on-line when adding more data nodes
• Designed to be a slow background process not impacting real-time
performance.
On-line Scaling and Elasticity - Repartitioning
• Minimal amount of data moved
• No re-hashing necessary
• Similar to consistent hashing
Writing data
writes Data Memory
(RAM)
• Memory is locked so it won’t swap
Writing data
• Writes log to disk asynchronously in
background
- key to real-time in-memory transactions
• Partial checkpoints of data memory
- fast node starts and system recovery
Flush writes to disk in
background checkpoints
writes
…
Data Memory
(RAM)
Writing data
• Writes go to data memory and commit log
• In-memory data reads never involve disks
Flush writes to disk in
background checkpoints
Commit Log (REDO)
writes
…
time
…
Data Memory
(RAM)
Data Node
Multiple Threads per data node
Parallel execution of
… multiple queries from …
… multiple users on …
… multiple MySQL Servers
Communication with signals
Goal: minimize context switching
NIC
Main thread
Local
Data
Managers
Receive
Send
Disk/SSD IO
DataMemory
(RAM)
Lock free multi core VM
• Data is partitioned inside the data nodes
• Communication asynchronously, event driven
on cluster’s VM
• No group communication - instead using
Distributed row locks
Non-blocking 2-phase commit
NIC
Main thread
Local
Data
Managers
Receive
Send
Disk/SSD IO
DataMemory
(RAM)
Queries in multithreaded NDB Virtual Machine
• Even a single query from MySQL Server executed in parallel
DataMemory
(RAM)
QUERY …
Massive parallel system executing parallel queries
Receive Send
Transaction Data Manager
Data Node Data Node
Receive Send
Transaction Data Manager
Data distribution awareness
• Key-value with hash on
primary key
• Complemented by
ordered in-memory-
optimised T-Tree
indexes for fast
searches
For PK operations
NDB data partition
is simply calculated
PK Service Data
739 Instagram xxx
Consolidated view of distributed data
• Clients and MySQL
Servers see a
consolidated view of
the distributed data
• Joins are pushed down
to data nodes
• Parallel cross-shard
execution in the data
nodes
• Result consolidation in
MySQL Server
Consolidated view of distributed data
Parallel cross-partition queries
• Parallel execution on the
data nodes and within
data nodes
• 64 cpus per node
leveraged
• parallelizes single queries
• 144 data nodes 

x 32 partitions 

= 4608! CPUs
+ 32 other processing
threads per node
• automatic batching, event
driven and asynchronous
PK Service Data
253 Tiktok xxx
892 Snapchat xxx
253 Discord xxx
739 Instagram xxx
Parallel cross-partition queries
$ SELECT * FROM services
LEFT JOIN data USING(service)
Data Nodes
Service Data
Snapchat xxx
PK Service
892 Snapchat
PK Service Data
892 Snapchat xxx
… … …
Parallel execution of
single queries
on all data nodes and
within data nodes
MySQL Cluster - matured with advanced features
• Disk tables for even bigger data
• IO control for efficient disk usage
• Local domain / availability domain
• Shared memory connections
• Sub-second failover and self-healing
• Online scaling, maintenance and version upgrades
• Heartbeat mechanisms to support nontrivial network failures
• many more …
Thank You
Bernd Ocklin
Snr Director
MySQL Cluster Development

More Related Content

What's hot (20)

PDF
Oracle db performance tuning
Simon Huang
 
PPTX
Optimizing Apache Spark SQL Joins
Databricks
 
PDF
Disaster Recovery and High Availability with Kafka, SRM and MM2
Abdelkrim Hadjidj
 
PDF
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
Miguel Araújo
 
PPTX
Apache Bigtopによるオープンなビッグデータ処理基盤の構築(オープンデベロッパーズカンファレンス 2021 Online 発表資料)
NTT DATA Technology & Innovation
 
PDF
MySQL 8
Mark Swarbrick
 
PPTX
ProxySQL for MySQL
Mydbops
 
PPTX
大量のデータ処理や分析に使えるOSS Apache Sparkのご紹介(Open Source Conference 2020 Online/Kyoto ...
NTT DATA Technology & Innovation
 
PDF
ODA Backup Restore Utility & ODA Rescue Live Disk
Ruggero Citton
 
PDF
MySQLと組み合わせて始める全文検索プロダクト"elasticsearch"
Kentaro Yoshida
 
PDF
Multi cluster, multitenant and hierarchical kafka messaging service slideshare
Allen (Xiaozhong) Wang
 
PDF
Building a SIMD Supported Vectorized Native Engine for Spark SQL
Databricks
 
PPTX
Apache Spark 2.4 and 3.0 What's Next?
NTT DATA Technology & Innovation
 
PPTX
Dbts 分散olt pv2
Takashi Kambayashi
 
PDF
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Databricks
 
PPTX
MySQL_MariaDB-성능개선-202201.pptx
NeoClova
 
PDF
MySQL Advanced Administrator 2021 - 네오클로바
NeoClova
 
PDF
MySQL High Availability -- InnoDB Clusters
Matt Lord
 
PDF
Apache Iceberg Presentation for the St. Louis Big Data IDEA
Adam Doyle
 
PDF
PG-REXで学ぶPacemaker運用の実例
kazuhcurry
 
Oracle db performance tuning
Simon Huang
 
Optimizing Apache Spark SQL Joins
Databricks
 
Disaster Recovery and High Availability with Kafka, SRM and MM2
Abdelkrim Hadjidj
 
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
Miguel Araújo
 
Apache Bigtopによるオープンなビッグデータ処理基盤の構築(オープンデベロッパーズカンファレンス 2021 Online 発表資料)
NTT DATA Technology & Innovation
 
ProxySQL for MySQL
Mydbops
 
大量のデータ処理や分析に使えるOSS Apache Sparkのご紹介(Open Source Conference 2020 Online/Kyoto ...
NTT DATA Technology & Innovation
 
ODA Backup Restore Utility & ODA Rescue Live Disk
Ruggero Citton
 
MySQLと組み合わせて始める全文検索プロダクト"elasticsearch"
Kentaro Yoshida
 
Multi cluster, multitenant and hierarchical kafka messaging service slideshare
Allen (Xiaozhong) Wang
 
Building a SIMD Supported Vectorized Native Engine for Spark SQL
Databricks
 
Apache Spark 2.4 and 3.0 What's Next?
NTT DATA Technology & Innovation
 
Dbts 分散olt pv2
Takashi Kambayashi
 
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Databricks
 
MySQL_MariaDB-성능개선-202201.pptx
NeoClova
 
MySQL Advanced Administrator 2021 - 네오클로바
NeoClova
 
MySQL High Availability -- InnoDB Clusters
Matt Lord
 
Apache Iceberg Presentation for the St. Louis Big Data IDEA
Adam Doyle
 
PG-REXで学ぶPacemaker運用の実例
kazuhcurry
 

Similar to MySQL NDB Cluster 101 (20)

PPT
MYSQL
gilashikwa
 
PDF
MySQL NDB Cluster 8.0
Ted Wennmark
 
PDF
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
PDF
Webinar Slides: Geo-Distributed MySQL Clustering Done Right!
Continuent
 
PDF
NoSQL – Data Center Centric Application Enablement
DATAVERSITY
 
PDF
Data Lake and the rise of the microservices
Bigstep
 
PDF
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
ScyllaDB
 
PPT
2010 12 mysql_clusteroverview
Dimas Prasetyo
 
PPTX
Aruman Cassandra database
Umesh Dande
 
PPTX
Relational cloud, A Database-as-a-Service for the Cloud
Hossein Riasati
 
PDF
Mysql NDB Cluster's Asynchronous Parallel Design for High Performance
Bernd Ocklin
 
PDF
MySQL Cluster
Mario Beck
 
PDF
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mydbops
 
PDF
Data Pipelines with Spark & DataStax Enterprise
DataStax
 
PPTX
Membase Meetup - Silicon Valley
Membase
 
PDF
The Nile Approach: Re-engineering Postgres for Millions of Tenants by Gwen Sh...
ScyllaDB
 
PPTX
Cassandra
Upaang Saxena
 
PPTX
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Clustrix
 
PDF
Hacking apache cloud stack
Nitin Mehta
 
PDF
Azure Days 2019: Grösser und Komplexer ist nicht immer besser (Meinrad Weiss)
Trivadis
 
MYSQL
gilashikwa
 
MySQL NDB Cluster 8.0
Ted Wennmark
 
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
Webinar Slides: Geo-Distributed MySQL Clustering Done Right!
Continuent
 
NoSQL – Data Center Centric Application Enablement
DATAVERSITY
 
Data Lake and the rise of the microservices
Bigstep
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
ScyllaDB
 
2010 12 mysql_clusteroverview
Dimas Prasetyo
 
Aruman Cassandra database
Umesh Dande
 
Relational cloud, A Database-as-a-Service for the Cloud
Hossein Riasati
 
Mysql NDB Cluster's Asynchronous Parallel Design for High Performance
Bernd Ocklin
 
MySQL Cluster
Mario Beck
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Mydbops
 
Data Pipelines with Spark & DataStax Enterprise
DataStax
 
Membase Meetup - Silicon Valley
Membase
 
The Nile Approach: Re-engineering Postgres for Millions of Tenants by Gwen Sh...
ScyllaDB
 
Cassandra
Upaang Saxena
 
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Clustrix
 
Hacking apache cloud stack
Nitin Mehta
 
Azure Days 2019: Grösser und Komplexer ist nicht immer besser (Meinrad Weiss)
Trivadis
 
Ad

Recently uploaded (20)

PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Ad

MySQL NDB Cluster 101

  • 2. MySQL Cluster Proven in serving billions of people every day when making phone calls, playing online games or handling financial transactions.
  • 3. Massively linear scale Always-On 99.9999% Availability Sharded In-Memory Datasets Always Consistent Parallel Real-Time Performance. Auto-partitioning, data distribution and replication built-in. Read- and Write Scale-Out to many TB on commodity hardware. Designed for mission critical systems. Masterless, shared-nothing with no single point of failure. Transactional consistency across distributed and partitioned dataset. Out of the box straightforward application programming. Ease of use Open Source Written in C++. Can be used standalone or with MySQL as a SQL front-end.
  • 4. NDB is the highest throughput distributed, in-memory, transactional database in the world. It’s open source!
  • 5. Horizontal and vertical scale with MySQL Cluster 15TB in-memory per node
 100+TB with on-disk 100+TB to 5 PB
 in a single cluster 1 - 2GB/sec read/write 
 transactions per shard 400k TPM DBT2
 per 1 CPU socket 100+ data nodes 1-4 replicas 10k threads for parallel query processing
  • 6. Cluster drives systems with massive scale and real-time answering times 100M trades analyzed 
 every year 20B $ volume every day 2+B mobile phone users 
 world wide 
 100+M in a single installation 30+M active gamers
 every month 12+M in one multi-player > > >
  • 7. MySQL Cluster linear scale NoSQL Performance Confidential – Oracle Internal/Restricted/Highly Restricted Memory optimized tables Durable Mix with disk-based tables Parallel table scans for non-indexed searches MySQL Cluster FlexAsych 200M NoSQL Reads/Second !-!!!! !50,000,000!! !100,000,000!! !150,000,000!! !200,000,000!! !250,000,000!! 2! 4! 6! 8! 10! 12! 14! 16! 18! 20! 22! 24! 26! 28! 30! 32! Reads!per!second! Data!Nodes! FlexAsync!Reads!
  • 8. MySQL Cluster Industries Telecom Gaming & Massive Parallel Online Games Financials
  • 9. MySQL Cluster Use Cases • IOT - applications that write massive amounts of data in short periods of time • Shopping carts - durable, fast and frequent updates • User tracking and monitoring • Authentication and session management systems - real-time user verification • User profile and directories - reliable real-time information store • Messaging systems
  • 10. Use cluster if you need Performance Read and write scalability Real-time in-memory Super low guaranteed latency Auto-Sharding Elastic Consistency Always on Always consistent ACID Global consistent view of the data data Cross-shard, cross- replica foreign keys SQL and NoSQL Distributed key value Advanced joins Parallel distributed query Highly Available Simple HA Simple programing
  • 11. MySQL Cluster Usage • Key Value store
 + High Availability, Scale-Out, Durability • Transactional object store
 + Multi row transactions and consistency • Relational database
 + SQL joins, foreign keys, triggers, stored procedures, generated columns, JSON, GIS, … •
  • 13. Confidential – Oracle Internal/Restricted/Highly Restricted Steel Belted Radius Carrier Server Provides centralized Authentication, Authorization, and Accounting (AAA or Triple A) management for users who connect and use a network service. 
 https://www.juniper.net/documentation/en_US/sbr-carrier8.3.0 Juniper Radius Server Switch Scalable Session State Register MySQL Cluster
  • 14. Bredbandsbolaget (B2) B2 application Nexus to authenticate and grant customers access to B2 services including broadband, VoIP and TV broadcasting. MySQL Cluster for mission critical authentication and authorisation services. Up and serving through on-line versions upgrades and maintenance since 2003! Real Time Network Operation Platform Internal Backoffice Systems Subscriber Profiles Authentication Services B2 Core Network
  • 15. Stream processing in the financial industry Live trading data Kafka Messages Message Formatting Message Event Bus NDB native Client processors
  • 16. Confidential – Oracle Internal/Restricted/Highly Restricted Hadoop (HopsFS) 
 with MySQL Cluster NameNodes Leader HDFS Client DataNodes hops.io ClusterJ Small Files
  • 17. Architecture Clients Cluster front- ends and connectors Data Nodes Partitioning- and distribution engine
  • 18. Deployment examples Dev setup App or MySQL Server connecting directly locally to single data node. High available setup Co-located app/MySQL Server and data nodes using shared memory connections. Classical 3-tier setup Redundant SQL and NoSQL mixed access Multiple SQL nodes and native node.js accessing same datasets
  • 19. Sharding and redundancy with no single point of failure Multiple copies of data are maintained for availability A group of data nodes shares the same data 1 - 4 replicas
  • 20. High availability • Up to 4 replicas per shard • All replicas active • Always consistent • Microsecond failover
  • 21. High availability • Majority for 3 and 4 nodes • Arbitration for 2 replicas • Proudly using 2-phase
  • 22. Lets crash an Availability Zone (AD) • No service 
 interruption source: LogicalClocks, MySQL Innovation Day, January 23, 2019
  • 23. Synchronous replication locally and asynchronous between physical locations • With awareness of data locality and availability domains for cloud Cluster Data Nodes Replication Btw, conflict detection 
 and automated resolution.
  • 24. Data distribution • Auto-sharding and distribution No name-node or central master • Each dataset is split into fragments and distributed across data nodes • Within a cluster data is always transactionally consistent MySQL Cluster Data Nodes PK Service Data 253 Tiktok xxx 892 Snapchat xxx 253 Discord xxx 739 Instagram xxx
  • 25. Data distribution • Partition of all data to thousands of virtual partitions • Virtual partitions distributed to data nodes … PK Service Data 253 Tiktok xxx 892 Snapchat xxx 253 Discord xxx 739 Instagram xxx
  • 26. Data distribution • Deterministic, random distribution by default • Data in up to 32 data node local partitions • each controlled by their own threads • key to parallel query processing PK Service Data 253 Tiktok xxx 892 Snapchat xxx 253 Discord xxx 739 Instagram xxx
  • 27. Data distribution and HA • Each partition is synchronously replicated to peer data nodes • ReplicaSets are called Node Group • All partitions active for read and write PK Service Data 253 Tiktok xxx 892 Snapchat xxx 253 Discord xxx 739 Instagram xxx Node Group Node Group
  • 28. On-line Scaling and Elasticity - Repartitioning • Virtual partitions re-distributed on-line when adding more data nodes • Designed to be a slow background process not impacting real-time performance.
  • 29. On-line Scaling and Elasticity - Repartitioning • Minimal amount of data moved • No re-hashing necessary • Similar to consistent hashing
  • 30. Writing data writes Data Memory (RAM) • Memory is locked so it won’t swap
  • 31. Writing data • Writes log to disk asynchronously in background - key to real-time in-memory transactions • Partial checkpoints of data memory - fast node starts and system recovery Flush writes to disk in background checkpoints writes … Data Memory (RAM)
  • 32. Writing data • Writes go to data memory and commit log • In-memory data reads never involve disks Flush writes to disk in background checkpoints Commit Log (REDO) writes … time … Data Memory (RAM)
  • 33. Data Node Multiple Threads per data node Parallel execution of … multiple queries from … … multiple users on … … multiple MySQL Servers Communication with signals Goal: minimize context switching NIC Main thread Local Data Managers Receive Send Disk/SSD IO DataMemory (RAM)
  • 34. Lock free multi core VM • Data is partitioned inside the data nodes • Communication asynchronously, event driven on cluster’s VM • No group communication - instead using Distributed row locks Non-blocking 2-phase commit NIC Main thread Local Data Managers Receive Send Disk/SSD IO DataMemory (RAM)
  • 35. Queries in multithreaded NDB Virtual Machine • Even a single query from MySQL Server executed in parallel DataMemory (RAM) QUERY …
  • 36. Massive parallel system executing parallel queries Receive Send Transaction Data Manager Data Node Data Node Receive Send Transaction Data Manager
  • 37. Data distribution awareness • Key-value with hash on primary key • Complemented by ordered in-memory- optimised T-Tree indexes for fast searches For PK operations NDB data partition is simply calculated PK Service Data 739 Instagram xxx
  • 38. Consolidated view of distributed data • Clients and MySQL Servers see a consolidated view of the distributed data • Joins are pushed down to data nodes • Parallel cross-shard execution in the data nodes • Result consolidation in MySQL Server Consolidated view of distributed data
  • 39. Parallel cross-partition queries • Parallel execution on the data nodes and within data nodes • 64 cpus per node leveraged • parallelizes single queries • 144 data nodes 
 x 32 partitions 
 = 4608! CPUs + 32 other processing threads per node • automatic batching, event driven and asynchronous PK Service Data 253 Tiktok xxx 892 Snapchat xxx 253 Discord xxx 739 Instagram xxx
  • 40. Parallel cross-partition queries $ SELECT * FROM services LEFT JOIN data USING(service) Data Nodes Service Data Snapchat xxx PK Service 892 Snapchat PK Service Data 892 Snapchat xxx … … … Parallel execution of single queries on all data nodes and within data nodes
  • 41. MySQL Cluster - matured with advanced features • Disk tables for even bigger data • IO control for efficient disk usage • Local domain / availability domain • Shared memory connections • Sub-second failover and self-healing • Online scaling, maintenance and version upgrades • Heartbeat mechanisms to support nontrivial network failures • many more …
  • 42. Thank You Bernd Ocklin Snr Director MySQL Cluster Development