mysql cluster presentation by krishna. what is mysql cluster ? just like hadoop, it is a...

30
MySQL Cluster Presentation by Krishna

Upload: carmella-garrett

Post on 22-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

MySQL Cluster

Presentation by

Krishna

Page 2: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

What is MySQL Cluster ?

Just like Hadoop, it is a technology/framework for distributed databases.

ACID compliant.

Horizontal scaling of (MySQL server + storage engine).

In a nut shell it provides clustering for the MySQL DBMS.

MySQL Cluster

Page 3: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Design principles

High write scalability- auto sharding.

99.99 % availability- Shared nothing design.

Real-Time responsiveness- in memory data base system.

Low TCO and Open platform.

MySQL Cluster

Page 4: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Implementation

Implemented through NDB (Network database) storage Engine.

NDB cluster- against shared storage.

Nodes in MySQL Cluster are categorized into three categories namely:

1. Data Nodes

2. SQL Nodes

3. Management Nodes

MySQL Cluster

Page 5: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Architecture

Image source MySQL Cluster

Page 6: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Data Node

Implemented as a ndb or ndbmtd in the NDB cluster.

Primary function is to process and retrieve information.

Monitoring other nodes in the cluster and notifying the Management node.

Perform recovery on restart.

MySQL Cluster

Page 7: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

SQL Node

Runs as the mysqld program, provides application access to the data nodes by receiving all interaction requests as queries.

Interaction layer between MySQL clients and the data nodes.

Typically , SQL node is a MySQL server which uses the NDB cluster storage engine.

MySQL Cluster

Page 8: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Management Node

Manages all other nodes in the Cluster.

Performs functions such as providing configuration details, starting and stopping the nodes, running back up etc..

Key point - a node of this type should be started first, before any other node.

MySQL Cluster

Page 9: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Cluster Configuration

Information regarding the number of nodes (processes), hosts , and their properties is necessary to set up the cluster.

Local configuration file- residing on each data/API node.

Global configuration file- the central one residing on one or more management nodes.

MySQL Cluster

Page 10: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Configuration files

## config.ini#

[NDB_MGMD DEFAULT]Portnumber=1186

[NDB_MGMD]NodeId=49HostName=10.30.12.23DataDir=C:/Users/kummadisingu/MySQL_Cluster/49/Portnumber=1186

[NDBD]NodeId=1HostName=10.30.12.28DataDir=C:/Users/kummadisingu/MySQL_Cluster/1/

[MYSQLD]NodeId=54HostName=10.30.12.30

# my.cnf# [mysqld]log-error=mysqld.54.errdatadir="C:/Users/kummadisingu/MySQL_Cluster/54/"basedir="C:/Program Files/MySQL/MySQL Cluster 7.3/"port=3307ndbcluster=onndb-nodeid=54ndb-connectstring=10.30.12.23:1186,

MySQL Cluster

Page 11: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Auto-Sharding

MySQL Cluster automatically partitions the tables across data nodes in the NDB cluster.

By default, sharding is based on hashing of the primary key, which generally leads to a more even distribution of data and queries across the cluster

Automatically creates node groups based on configuration parameters.

MySQL Cluster

Page 12: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

How it happens ?

MySQL Cluster Image-source

Page 13: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Continued Operation of MySQL Cluster

1. As long as each node group participating in the cluster has at least one node operating, the cluster has a complete copy of all data and remains viable.

2. However, if both nodes from either node group fail the cluster has lost an entire partition and so can no longer provide access to a complete set of all cluster data

F1~ fragment 1 of partition 1MySQL Cluster Image-source

Page 14: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

MySQL Cluster Replication

Multiple clusters within a cluster – scenario when Geographical replication is in demand.

Synchronous replication- happens only between data nodes and uses the two phase commit protocol.

Asynchronous replication- replication between two or more clusters (multi master).

MySQL Cluster

Page 15: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

CAP theorem and MySQL Cluster

A single MySQL Cluster prioritizes data consistency over availability when network partitions occur.

A pair of asynchronously replicating MySQL Clusters prioritizes service availability over data consistency when network partitions occur.

That’s Great!

MySQL Cluster

Page 16: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Single MySQL Cluster - CP

When a network partition occurs, live nodes in each partition regroup and decide what to do next:

If there are not enough live nodes to serve all of the data stored – shutdown ~ degrade availability.

After partition if the live nodes still holds all of the data- Continue to provide service.

MySQL Cluster

Page 17: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Asynchronously replicating clusters - AP

 Data consistency within each cluster is guaranteed as normal, but data consistency across the two clusters is not because of asynchronous replication.

And yet, continue to accept read and write requests by implementing a

special type of consistency mechanism known as …?

Eventually Consistent

MySQL Cluster

Page 18: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

NoSQL and MySQL Cluster

All the benefits of an ACID RDBMS + performance capabilities of Key/Value store = MySQL Cluster

By pass the SQL layer and directly access the data nodes via the memcache API or various other NoSQL interfaces.

MySQL Cluster

Page 19: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

MySQL Cluster & Memcache API

1. key-value interaction with NDB engine via the familiar memcached API.

2. Extra caching layer~ very low latency.

MySQL Cluster

Image-source

Page 20: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Scheme-less storage in MySQL Cluster

By default, every Key / Value is written to the same table with each Key / Value pair stored in a single row - thus allowing schema-less data storage

MySQL Cluster

Image-source

Page 21: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

NoSQL + SQL

Alternatively, we can define a key-prefix so that each value is linked to a pre-defined column in a specific table.

MySQL Cluster

Image-source

Page 22: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Additional Features

Online scaling & up-gradation without temporary outage.

Elastic in nature ~ compatible with the cloud computing framework.

Unlike other distributed databases, MYSQL Cluster supports execution of complex join queries- preserving ACID properties.

MySQL Cluster

Page 23: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Resilient to Failures

Employs a self healing auto recovery mechanism with :

1. Automatic transfer of control.

2. Automatic restart and resynchronize.

3. ~No Single point failures.

MySQL Cluster

Page 24: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Queries: Two key points to remember

For a table to be replicated in the cluster, it must use the NDB Cluster storage engine by specifying “ENGINE=NDBCLUSTER”:

CREATE TABLE table_name (col_name column_definitions) ENGINE=NDBCLUSTER;

ALTER TABLE table_name ENGINE=NDBCLUSTER;

Every NDBCluster has a primary key. If no primary key is defined by the user when a table is created, the NDBCluster storage engine automatically generates a hidden one.

MySQL Cluster

Page 25: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Limitations

Partitioning.

- Limited partitioning schemes.

- Upper limit on the maximum number of partitions:

~ 8 * [ number of node groups ]

Storage size.

- Single MYSQL cluster has a storage limit of 3TB, which is very low.

MySQL Cluster

Page 26: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Compare

1. Unrestricted data size

2. Batch processing

3. Disk storage

1. Real time analytics

2. Mission critical applications

3. Data Integrity

MySQL Cluster

Page 27: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Conclusion

MySQL’s answer to the NoSQL competitors in the big data web market.

Certainly brings out the best of the both worlds.

MySQL Cluster is already serving some of the most demanding web and mobile services on the planet

MySQL Cluster

Page 28: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Customers

MySQL Cluster

Page 29: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

Available Versions

MySQL Cluster GA (Generally available)

MySQL Cluster Carrier Guide Edition (Community and Commercial versions)

Includes MySQL Cluster Manager

24 hour online support.

MySQL Cluster

Page 30: MySQL Cluster Presentation by Krishna. What is MySQL Cluster ?  Just like Hadoop, it is a technology/framework for distributed databases.  ACID compliant

MySQL Cluster