MySQL High Availability Solutions
Avoid loss of service by reducing the risk of failures
MySQL InnoDB Cluster
Collection of products that work together to provide a complete High Availability solution for MySQL
MySQL InnoDB ReplicaSet
Administer a set of MySQL instances running asynchronous replication
MySQL NDB Cluster
A high-availability, high-redundancy version of MySQL adapted for the distributed computing environment
81. When TO consider MySQL NDB Cluster
You need High Availability 6-9’s (and strong consistency)
You need Sharding, either due to size or write performance
You need Linear Scalabillity when adding more nodes
You need predictable Real-time response times
– SQL and cross shard join support
You want a ACID distributed in-memory database
81
83. MySQL NDB Cluster Architecture
Multiple data nodes form a cluster
Shared nothing architecture
Data is automatically distributed to data nodes
83
84. MySQL NDB Cluster Architecture - Replicas
Copy of 1
Copy of 1
Multiple copies of data are maintained for availability
A group of data nodes shares the same data
1 - 4 replicas/copies of data can be configured
84
85. User-id (PK) Service Data
1773467253 chat xxx
6257346892 chat xxx
1773467253 photos xxx
7234782739 photos xxx
8235602099 reminders xxx
8437829249 location xxx
MySQL Cluster Data Nodes
Partition Key
Data distribution
Auto-partitioning 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 consistent.
85
86. Writing data “ACID”
Data
Memory
Flush writes to disk in
background checkpoints
Commit Log (REDO)
writes
…
time
…
Data in MySQL Cluster is written to memory
and disk in a way that allows real-time
access and recovery
Memory is locked so it won’t swap
Writes go to data memory and commit log
Background process checkpoints data
memory for recovery
Reads always happen from memory -
not from disk
86
87. MySQL NDB Cluster Use Cases
Key-Value store
+ High Availability, Scale-Out, Durability
Transactional object store
+ Multi row transactions and consistency
Relational database with MySQL Server front-ends
+ SQL joins, foreign keys, triggers, stored procedures, generated columns, JSON
87