SlideShare a Scribd company logo
1 of 58
Download to read offline
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.1
Sharding and Scale-out
using MySQL Fabric
Mats Kindahl (mats.kindahl@oracle.com)
Principal Senior Software Developer
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |2
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 decision. The development,
release, and timing of any features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.
Safe Harbor Statement
3 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |
Presentation Outline
 Introducing MySQL Fabric
 Architecture for High-Availability
 Connecting to a MySQL Fabric Farm
 Architecture for Sharding
 Summary and Closing Remarks
4
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |
An extensible and easy-to-use
framework for managing a farm
of MySQL servers supporting
high-availability and sharding
MySQL Fabric
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |5
What does all that mean?
●
“Farm” Management System
●
Farm: Collection of components
●
Distributed Framework
●
Framework
●
Procedure execution
●
State store
●
Transaction Routing
●
Extensible
●
Extensions are first-class
●
High-Availability Groups
●
“Semi-Automatic” Sharding
●
Written in Python
●
Latest Release 1.4.2
●
Release Candidate
●
Open Source
●
You can participate
●
Suggest features
●
Report bugs
●
Contribute patches
●
MySQL 5.6 is focus
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |6
MySQL Fabric: Goals & Features
●
Decision logic in connector
●
Eliminate one network hop
●
Reducing network load
●
Connector API Extensions
●
Support Transactions
●
Support full SQL
●
Load Balancing
●
Read-Write Split
●
Round-robin
●
Multi-Table Sharding
●
Sharding Functions
●
Range
●
(Consistent) Hash
●
Shard Operations
●
Shard move
●
Shard split
●
Global Updates
●
Global tables
●
Schema updates
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |7
A Brief History of MySQL Fabric
●
MySQL Fabric 1.4.0
●
September, 2013
●
First public release
●
High-Availability Groups
●
Slave Promotion
●
Range and Hash Sharding
●
Shard move and split
●
Connector/Python Support
●
Connector/J Support
●
Connector/PHP Support
● MySQL Fabric 1.4.1
● December, 2013
● Alpha release
● Sharding refactorings
● MySQL Fabric 1.4.2
● April, 2014
● Release Candidate
● Distributed Failure Detection
● Credentials
● Weighted Round-Robin
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |8
Birds-eye View
High Availability Groups
Application
XML-RPC
SQL
SQL
Connector
Connector
Connector
Operator
MySQL
Fabric
Node
Database
Servers
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |9
High-Level Components
●
Fabric-aware Connectors
●
Python, PHP, and Java
●
Enhanced Connector API
●
MySQL Fabric Node
●
Manage information about farm
●
Provide status information
●
Execute procedures
●
MySQL Servers
●
Organized in High-Availability Groups
●
Handling application data
High Availability
Group
Application
Connector
Connector
Connector
MySQL
Fabric
Node
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |10
MySQL Fabric Node Architecture
MySQL
MySQL Fabric
Framework
Executor
State Store
(Persister)
Sh
?HA
MySQL-RPCAMQP XML-RPC
??
Connector
Connector
Connector
Protocols
Extensions
Backing
Store
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |11
MySQL Fabric: Prerequisites
●
MySQL Servers (version 5.6.10 or later)
●
Backing store database server
●
Application database servers
●
Python 2.6 or 2.7
●
No support for 3.x yet
●
MySQL Utilities 1.4
●
Available at https://dev.mysql.com/downloads/tools/utilities
●
“Development release” tab
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |12
MySQL Fabric: Configuration
●
Backing Store
●
MySQL server
●
Persistent storage for state
●
Storage engine-agnostic
●
Protocol
●
Address where node will be
●
Currently only XML-RPC
●
Logging
●
Chatty: INFO (default)
●
Moderate: WARNING
●
URL for rotating log
[storage]
address = localhost:3306
user = fabric
password = 
database = fabric
[servers]
user = fabric
password = 
[protocol.xmlrpc]
address = localhost:32274
threads = 5
disable_authentication = yes
[logging]
level = INFO
url = file:///var/log/fabric.log
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |13
MySQL Fabric: Basic Commands and Help
●
Command Structure
mysqlfabric group command ...
●
Getting help
mysqlfabric help
mysqlfabric help commands
mysqlfabric help manage
mysqlfabric help manage setup
●
MySQL Utilities Documentation:
●
http://dev.mysql.com/doc/mysql-utilities/1.4/en/index.html
●
MySQL Fabric Documentation:
●
http://dev.mysql.com/doc/mysql-utilities/1.4/en/fabric.html
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |14
Setting up and Tearing down MySQL Fabric
●
Create and populate the necessary tables in backing store
mysqlfabric manage setup
●
Remove the tables from backing store
mysqlfabric manage teardown
●
Connects to the database server in “storage” section
●
Ensure that you have the necessary users and privileges
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |15
Starting and Stopping MySQL Fabric
●
Start MySQL Fabric node in foreground – print log to terminal
mysqlfabric manage start
●
Start MySQL Fabric node in background – print log to file
mysqlfabric manage start ­­daemonize 
●
Stop MySQL Fabric node
mysqlfabric manage stop
16
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |
Architecture for
High-Availability
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |17
High-Availability Concepts
●
Redundancy
●
Duplicate critical components
●
Monitoring
●
Detecting failing components
●
Monitor load
●
Procedures
●
Activate replacements
●
Distribute load
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |18
High-Availability Group Concept
● Group of servers
● Hardware redundancy
● Data redundancy
● Generic Concept
● Implementation-independent
● Self-managed or externally managed
● Different Types
● Primary-Backup (Master-Slave)
● Shared or Replicated Storage
● MySQL Cluster
Done!
Examples Only
Not Implemented
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |19
High-Availability Group Concept
● Abstract Concept
● Set of servers
● Server attributes
● Connector Attributes
● Connection information
● Mode: read-only, read-write, ...
● Weight: distribute load
● Management Attributes
● Status: state/role of the server
Status: Primary
Mode: Read-Write
Host: server-
1.example.com
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |20
Create Groups and add Servers
●
Define a group
mysqlfabric group create my_group
●
Add servers to group
mysqlfabric group add my_group server1.example.com
mysqlfabric group add my_group server2.example.com
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |21
Activate High-Availability Group
●
Promote one server to be primary
mysqlfabric group promote my_group
●
Tell built-in failure detector to monitor group
mysqlfabric group activate my_group
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |22
Distributed Failure Detector
New in MySQL Fabric 1.4.2
●
Connectors report errors
●
Report that an error was noticed
●
Failover based on statistics
●
report_error(server, source, error)
●
Report failure
●
A server is known to have failed
●
Failover occurs immediately
●
report_fault(server, source, error)
Connector
report_error
report_fault
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |23
Update Only Operations
New in MySQL Fabric 1.4.2
●
Situation:
●
Server promotion is done elsewhere
●
Real situation does not match content of state-store
●
Problem:
●
Need to update state store to match real situation
●
Should not touch application servers
●
Solution: Use update-only option
mysqlfabric group promote my_group ­­update_only  
­­slave_uuid=29bf3b2d­b5ac­11e3­a383­58946b051f64
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |24
Credentials in MySQL Fabric
New in MySQL Fabric 1.4.2
●
Credentials
●
Digest Authentication
●
SSL connection
●
Digest Authentication
●
RFC 2617
●
Server: Realm
●
Client: User + Password
●
SSL connection
●
Setup Like MySQL Server
[storage]
address = localhost:3306
user = fabric
password = xyzzy
database = fabric
[protocol.xmlrpc]
address = localhost:32274
threads = 5
disable_authentication = no
realm = MySQL Fabric
user = admin
password = xyzzy
ssl_ca = /etc/mysql/fabric_ca.pem
ssl_key = /etc/mysql/fabric_key.pem
ssl_cert = /etc/mysql/fabric_cert.pem
25
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |
Connecting to a
MySQL Fabric Farm
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |26
● Fabric-aware Connectors
● Connector/J
● Connector/Python
● Connector/PHP
● Fabric-aware Frameworks
● Doctrine
● Hibernate
● In this presentation:
● Connector/Python
Fabric-aware Connector
●
Connector API Extensions
●
Support Transactions
●
Support full SQL
●
Decision logic in connector
●
Reducing network load
●
Load Balancing
●
Read-Write Split
●
Distribute transactions
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |27
Routing Transactions
prop1=val1
prop2=val2
execute(query)
srv1.example.com:3306
srv2.example.com:3306
srv3.example.com:3307
MySQL
Fabric
Node
Application
prop1=val1
prop2=val2
execute(query) Connector
Cache
srv1.example.com
srv2.example.com
srv3.example.com
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |28
Fabric-aware Connector API
import mysql.connector
conn = mysql.connector.connect(
    fabric={"host": "fabric.example.com"},
    user='mats', password='xyzzy', database="employees"
)
● Establish a “virtual” connection
● Real server connection established lazily
● Provide connection information for the Fabric node
● Connector will fetch information about servers
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |29
Enable Connector/Python Error Reporting
New in Connector/Python 1.2.1
import mysql.connector
conn = mysql.connector.connect(
    fabric={"host": "fabric.example.com"},
    user='mats', password='xyzzy', database="employees",
report_error=True,
)
● Connectors can report errors to Fabric node
● Enable using report_error
● Defaults to False
● Require MySQL Fabric 1.4.2
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |30
Connector API: Executing a Transaction
●
Provide group name
●
Property: group
●
Fabric will compute candidate
servers
conn.set_property(group='my_group', mode=MODE_READWRITE)
cur = conn.cursor()
cur.execute("INSERT INTO employees VALUES (%s,%s,%s)",
            (emp_no, first_name, last_name))
cur.execute("INSERT INTO titles(emp_no,title,from_date)"
            “ VALUES (%s,%s,CURDATE())",
            (emp_no, 'Intern'));
conn.commit()
● Provide transaction mode
● Property: mode
● Fabric will pick server in right
mode
Same as
before
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |31
START TRANSACTION;
SELECT salary INTO @s FROM salaries WHERE emp_no = 20101;
SET @s = 1.1 * @s;
INSERT INTO salaries VALUES (20101, @s);
COMMIT;
BEGIN;
CALL update_salary(20202, @s); 
COMMIT;
Where's the sharding key? Ah, there it is!
Session state?
Hmm... looks like
a read transaction
Oops.. it was a
write transaction!
Transaction done!
Clear session state?
New transaction! Different connection?
What about the session state?
Executing a Transaction
What about connection pools?
Application error?
What does this
procedure update?
33
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |
Architecture for
Sharding
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |34
Benefits of Sharding
●
Write scalability
●
Can handle more writes
●
Large data set
●
Database too large
●
Does not fit on single server
●
Improved performance
●
Smaller index size
●
Smaller working set
UID 10000-20000 UID 20001-40000
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |35
MySQL Fabric: Sharding Goals & Features
●
Connector API Extensions
●
Support Transactions
●
Support full SQL
●
Decision logic in connector
●
Reducing network load
●
Shard Multiple Tables
●
Using same key
●
Global Updates
●
Global tables
●
Schema updates
●
Sharding Functions
●
Range
●
(Consistent) Hash
●
Shard Operations
●
Using built-in executor
●
Shard move
●
Shard split
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |36
Sharded Tables
Table Rows
salaries 284 404 700
titles 44 330 800
employees 30 002 400
dept_emp 33 160 300
dept_manager 2 400
departments 900
In desperate need
of sharding!
Foreign keys
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |37
Mapping the Sharding Key
●
What is a sharding key?
●
Single column
●
Multi column
– Same table?
– Different tables?
●
How is the key transformed?
●
Hash
●
Range
●
User-defined
Compute
Shard#
KeyShard#
(X)
(X,Y,...)
RANGE
HASH
Something else
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |38
Sharded Tables: Multiple Mappings
Library Schema
Employee Schema
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |39
Digression: Computing Shards
●
Multiple Mappings
●
Which mapping to use?
●
Application don't care
… but know tables in transaction
●
Currently only one mapping
●
Computing shard requires
●
Tables + sharding key
●
Map# + sharding key
●
Enhanced Connector API
Compute
Shard#
Key
Shard#Map#
Compute
Map#
Tables
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |40
Multi-table Query with Sharded Tables
SELECT first_name, last_name, salary
FROM salaries JOIN employees USING (emp_no)
WHERE emp_no = 21012
AND CURRENT_DATE BETWEEN from_date AND to_date;
● Referential Integrity Constraint
● Example query joining salaries and employees
● Same key, same shard: co-locate rows for same user
● JOIN normally based on equality
● Using non-equality defeats purpose of foreign key
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |41
Global Tables
Table Rows
salaries 284 404 700
titles 44 330 800
employees 30 002 400
dept_emp 33 160 300
dept_manager 2 400
departments 900
Do not really need
to be sharded
Global tables exist
on all shards!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |42
Multi-table Query with Global Tables
SELECT first_name, last_name, GROUP_CONCAT(dept_name)
FROM employees JOIN dept_emp USING (emp_no)
JOIN departments USING (dept_no)
WHERE emp_no = 21012 GROUP BY emp_no;
● JOIN with departments table
● Has no employee number, hence no sharding key
● Table need to be present on all shards
● But... how do we update global tables?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |43
Sharding Architecture
Shards
MySQL
Fabric Node
Application
Connector
Connector
Connector
Global
Group
Global Updates
Shard
Updates
Replication
Support global update
for off-line shards
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |44
MySQL Fabric: Sharding Setup
●
Set up some groups
●
my_global – for global updates
●
my_group.* – for the shards
●
Add servers to the groups
●
Create a shard mapping
●
A “distributed database”
●
Give information on what tables are sharded
●
Add shards
●
Mapping keys to shards
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |45
MySQL Fabric: Set up Shard Mapping
●
Define shard mapping
mysqlfabric sharding 
  create_definition hash my_global
●
Add tables that should be sharded
mysqlfabric sharding add_table 1 
  employees.employees emp_no
mysqlfabric sharding add_table 1 
  employees.salaries emp_no
●
Tables not added are considered global
Shard map identifier
Will return a
shard map identifier
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |46
MySQL Fabric: Add Shards
●
Add shards to shard mapping
mysqlfabric sharding add_shard 1 
  “my_group.1,...,my_group.N” ­­state=ENABLED
Shard map identifier
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |47
MySQL Fabric: Moving and Splitting Shards
●
Moving a shard from one group to another
mysqlfabric sharding move 5 my_group.5
●
Splitting a shard into two pieces (hash)
mysqlfabric sharding split 5 my_group.6
Shard ID
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |48
Connector API: Shard Specific Query
●
Provide tables in query
●
Property: tables
●
Fabric will compute map
conn.set_property(tables=['employees.employees', 'employees.titles'],
                  key=emp_no)
cur = conn.cursor()
cur.execute("INSERT INTO employees VALUES (%s,%s,%s)",
            (emp_no, first_name, last_name))
cur.execute("INSERT INTO titles(emp_no, title, from_date)"
            " VALUES (%s, %s, CURDATE())",
            (emp_no, 'Intern'));
conn.commit()
● Provide sharding key
● Property: key
● Fabric will compute shard
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |49
Connector API: Shard Specific Query
●
Provide tables in query
●
Property: tables
●
Fabric will compute map
conn.set_property(tables=['employees.employees', 'employees.titles'],
                  key=emp_no)
cur = conn.cursor()
cur.execute(
    "SELECT first_name, last_name, title"
    "  FROM employees JOIN titles USING (emp_no)"
    " WHERE emp_no = %d", (emp_no,))
for row in cur:
    print row[0], row[1], “,“, row[2]
● Provide sharding key
● Property: key
● Fabric will compute shard
Join queries are sent to correct
shard and executed there
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |50
Connector API: Global Update
●
Provide tables in query
●
Property: tables
●
Fabric will compute map
●
(Not necessary)
conn.set_property(tables=['employees.titles'], scope='GLOBAL')
cur = conn.cursor()
cur.execute("ALTER TABLE employees.titles ADD nickname VARCHAR(64)")
● Set global scope
● Property: scope
● Query goes to global group
51
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |
Closing Remarks
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |52
What do we have now?
●
MySQL Farm Management
●
High-Availability
●
Sharding
●
High-Availability
●
Group Concept
●
Slave promotion
●
Sharding
●
Range and hash sharding
●
Shard move and shard split
●
Connector APIs
●
Transaction properties
●
“Virtual” connections
●
Enhanced Connectors
●
Connector/Python
●
Connector/PHP
●
Connector/J
●
Command-line Interface
●
XML-RPC Interfaces
●
Distributed failure detector
●
Connectors report failures
●
Custom failure detectors
●
Credentials
●
RFC 2617
●
SSL support
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |53
Thoughts for the Future
●
Connector multi-cast
●
Scatter-gather
●
UNION of result sets
●
More complex operations?
●
Extension interfaces
●
Improve extension support
●
Improve procedures support
●
Command-line interface
●
Improving usability
●
Focus on ease-of-use
●
More protocols
●
MySQL-RPC Protocol?
●
More frameworks?
●
More connectors?
●
C/C++?
●
Fabric-unaware connectors?
●
More HA group types
●
DRBD
●
MySQL Cluster
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |54
Thoughts for the Future
●
“Transparent” Sharding
●
Single-query transactions?
●
Speculative execution?
●
Cross-shard join?
●
Multiple shard mappings
●
Independent tables
●
Multi-way shard split
●
Efficient initial sharding
●
Better use of resources
●
High-availability executor
●
Node failure stop execution
●
Replicated State Machine
– Paxos?
– Raft?
●
Continue execution on other Fabric
node
●
Session Consistency
●
We have a distributed database
●
It should look like a single database
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |55
Reading for the Interested
● MySQL Forum: Fabric, Sharding, HA, Utilities
http://forums.mysql.com/list.php?144
● MySQL Fabric Documentation
http://dev.mysql.com/doc/mysql-utilities/1.4/en/fabric.html
● Migrating From an Unsharded to a Sharded Setup
http://vnwrites.blogspot.com/2013/09/mysqlfabric-sharding-migration.html
● Configuring and running MySQL Fabric
http://alfranio-distributed.blogspot.com/2014/03/mysqlfabric-installation.html
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |56
Want to contribute?
●
Check it
… and send us use-case and feature suggestions
●
Test it
… and send comments to the forum
●
Break it
… and send in bugs to http://bugs.mysql.com
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |57
Mats Kindahl
Twitter: @mkindahl
http://mysqlmusings.blogspot.com
Alfranio Correia
Twitter: @alfranio
http://alfranio-distributed.blogspot.com
Keeping in Touch
Narayanan Venkateswaran
Twitter: @vn_tweets
http://vnwrites.blogspot.com
Geert Vanderkelen
Twitter: @geertjanvdk
http://geert.vanderkelen.org
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.58
Graphic Section Divider
MySQL Connect @ Oracle
OpenWorld
Sept 29 – Oct 2
Special Offer:
Register Before
May 2 and Save an
Extra US$100!
Code: DPER
Call for Proposals Open
Until April 15!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |59
Thank you!

More Related Content

What's hot

MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMatt Lord
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017Ivan Ma
 
Why MySQL High Availability Matters
Why MySQL High Availability MattersWhy MySQL High Availability Matters
Why MySQL High Availability MattersMatt Lord
 
Conference slides: MySQL Cluster Performance Tuning
Conference slides: MySQL Cluster Performance TuningConference slides: MySQL Cluster Performance Tuning
Conference slides: MySQL Cluster Performance TuningSeveralnines
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!Vitor Oliveira
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMario Beck
 
MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)Olivier DASINI
 
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterMySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterOlivier DASINI
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLOlivier DASINI
 
MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)Mario Beck
 
MySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The DolphinMySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The DolphinOlivier DASINI
 
MySQL 5.6 Updates
MySQL 5.6 UpdatesMySQL 5.6 Updates
MySQL 5.6 UpdatesDave Stokes
 
High Availability with MariaDB Enterprise
High Availability with MariaDB EnterpriseHigh Availability with MariaDB Enterprise
High Availability with MariaDB EnterpriseMariaDB Corporation
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeOlivier DASINI
 
MySQL Cloud Service Deep Dive
MySQL Cloud Service Deep DiveMySQL Cloud Service Deep Dive
MySQL Cloud Service Deep DiveMorgan Tocker
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreSujatha Sivakumar
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10Kenny Gryp
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationNuno Carvalho
 

What's hot (20)

MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an Overview
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
 
Why MySQL High Availability Matters
Why MySQL High Availability MattersWhy MySQL High Availability Matters
Why MySQL High Availability Matters
 
Conference slides: MySQL Cluster Performance Tuning
Conference slides: MySQL Cluster Performance TuningConference slides: MySQL Cluster Performance Tuning
Conference slides: MySQL Cluster Performance Tuning
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB Cluster
 
MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)
 
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterMySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
 
MySQL Cluster Basics
MySQL Cluster BasicsMySQL Cluster Basics
MySQL Cluster Basics
 
MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)
 
MySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The DolphinMySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The Dolphin
 
My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3
 
MySQL 5.6 Updates
MySQL 5.6 UpdatesMySQL 5.6 Updates
MySQL 5.6 Updates
 
High Availability with MariaDB Enterprise
High Availability with MariaDB EnterpriseHigh Availability with MariaDB Enterprise
High Availability with MariaDB Enterprise
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtime
 
MySQL Cloud Service Deep Dive
MySQL Cloud Service Deep DiveMySQL Cloud Service Deep Dive
MySQL Cloud Service Deep Dive
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
 

Viewers also liked

MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding Ulf Wendel
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialKenny Gryp
 
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal ScalingMySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal ScalingMats Kindahl
 
Anatomy of a Proxy Server - MaxScale Internals
Anatomy of a Proxy Server - MaxScale InternalsAnatomy of a Proxy Server - MaxScale Internals
Anatomy of a Proxy Server - MaxScale InternalsIvan Zoratti
 
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFSMySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFSMats Kindahl
 
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke KajiyamaInsight Technology, Inc.
 
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-靖 小田島
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWSAllan Denot
 
Spider DeNA Technology Seminar #2
Spider DeNA Technology Seminar #2Spider DeNA Technology Seminar #2
Spider DeNA Technology Seminar #2Kentoku
 
Zabbix+group replication
Zabbix+group replicationZabbix+group replication
Zabbix+group replicationbri nger
 
Étude de cas : migration MySQL Latin 1 vers UTF-8
Étude de cas : migration MySQL Latin 1 vers UTF-8Étude de cas : migration MySQL Latin 1 vers UTF-8
Étude de cas : migration MySQL Latin 1 vers UTF-8Olivier DASINI
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleColin Charles
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)Seungmin Yu
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationFrederic Descamps
 
MHA : MySQL haute dispo, chez Viadeo par Olivier Dasini
MHA : MySQL haute dispo, chez Viadeo par Olivier DasiniMHA : MySQL haute dispo, chez Viadeo par Olivier Dasini
MHA : MySQL haute dispo, chez Viadeo par Olivier DasiniOlivier DASINI
 
Nuvola: a tale of migration to AWS
Nuvola: a tale of migration to AWSNuvola: a tale of migration to AWS
Nuvola: a tale of migration to AWSMatteo Moretti
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017Dave Stokes
 
Architectures haute disponibilité avec MySQL
Architectures haute disponibilité avec MySQLArchitectures haute disponibilité avec MySQL
Architectures haute disponibilité avec MySQLOlivier DASINI
 
Using Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud EnvironmentsUsing Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud Environmentsahamilton55
 

Viewers also liked (20)

MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal ScalingMySQL Sharding: Tools and Best Practices for Horizontal Scaling
MySQL Sharding: Tools and Best Practices for Horizontal Scaling
 
Anatomy of a Proxy Server - MaxScale Internals
Anatomy of a Proxy Server - MaxScale InternalsAnatomy of a Proxy Server - MaxScale Internals
Anatomy of a Proxy Server - MaxScale Internals
 
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFSMySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
MySQL Applier for Apache Hadoop: Real-Time Event Streaming to HDFS
 
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
[B34] MySQL最新ロードマップ – MySQL 5.7とその先へ by Ryusuke Kajiyama
 
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWS
 
Spider DeNA Technology Seminar #2
Spider DeNA Technology Seminar #2Spider DeNA Technology Seminar #2
Spider DeNA Technology Seminar #2
 
Zabbix+group replication
Zabbix+group replicationZabbix+group replication
Zabbix+group replication
 
Étude de cas : migration MySQL Latin 1 vers UTF-8
Étude de cas : migration MySQL Latin 1 vers UTF-8Étude de cas : migration MySQL Latin 1 vers UTF-8
Étude de cas : migration MySQL Latin 1 vers UTF-8
 
Optimisation de MySQL
Optimisation de MySQLOptimisation de MySQL
Optimisation de MySQL
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
MHA : MySQL haute dispo, chez Viadeo par Olivier Dasini
MHA : MySQL haute dispo, chez Viadeo par Olivier DasiniMHA : MySQL haute dispo, chez Viadeo par Olivier Dasini
MHA : MySQL haute dispo, chez Viadeo par Olivier Dasini
 
Nuvola: a tale of migration to AWS
Nuvola: a tale of migration to AWSNuvola: a tale of migration to AWS
Nuvola: a tale of migration to AWS
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017
 
Architectures haute disponibilité avec MySQL
Architectures haute disponibilité avec MySQLArchitectures haute disponibilité avec MySQL
Architectures haute disponibilité avec MySQL
 
Using Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud EnvironmentsUsing Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud Environments
 

Similar to Sharding and Scale-out using MySQL Fabric

MySQL High Availability - Managing Farms of Distributed Servers
MySQL High Availability - Managing Farms of Distributed ServersMySQL High Availability - Managing Farms of Distributed Servers
MySQL High Availability - Managing Farms of Distributed ServersNarayanan Venkateswaran
 
MySQL Fabric - High Availability & Automated Sharding for MySQL
MySQL Fabric - High Availability & Automated Sharding for MySQLMySQL Fabric - High Availability & Automated Sharding for MySQL
MySQL Fabric - High Availability & Automated Sharding for MySQLTed Wennmark
 
MySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesMySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesShivji Kumar Jha
 
MySQL Group Replication @osi days 2014
MySQL Group Replication @osi days 2014MySQL Group Replication @osi days 2014
MySQL Group Replication @osi days 2014Manish Kumar
 
2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdf2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdfHaiping Li
 
Multi source replication pdf
Multi source replication pdfMulti source replication pdf
Multi source replication pdfMysql User Camp
 
MySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL FabricMySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL FabricMark Swarbrick
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech UpdatesRyusuke Kajiyama
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQLTed Wennmark
 
Oracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLOracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLMario Beck
 
MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014Sanjay Manwani
 
MySQL Intro JSON NoSQL
MySQL Intro JSON NoSQLMySQL Intro JSON NoSQL
MySQL Intro JSON NoSQLMark Swarbrick
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsMario Beck
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementMark Matthews
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBAJeff Smith
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise PortfolioAbel Flórez
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptxIvan Ma
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 

Similar to Sharding and Scale-out using MySQL Fabric (20)

MySQL High Availability - Managing Farms of Distributed Servers
MySQL High Availability - Managing Farms of Distributed ServersMySQL High Availability - Managing Farms of Distributed Servers
MySQL High Availability - Managing Farms of Distributed Servers
 
MySQL Fabric
MySQL FabricMySQL Fabric
MySQL Fabric
 
MySQL Fabric - High Availability & Automated Sharding for MySQL
MySQL Fabric - High Availability & Automated Sharding for MySQLMySQL Fabric - High Availability & Automated Sharding for MySQL
MySQL Fabric - High Availability & Automated Sharding for MySQL
 
MySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesMySQL High Availability with Replication New Features
MySQL High Availability with Replication New Features
 
MySQL Group Replication @osi days 2014
MySQL Group Replication @osi days 2014MySQL Group Replication @osi days 2014
MySQL Group Replication @osi days 2014
 
2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdf2_MySQL_Cluster_Introduction.pdf
2_MySQL_Cluster_Introduction.pdf
 
Multi source replication pdf
Multi source replication pdfMulti source replication pdf
Multi source replication pdf
 
MySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL FabricMySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL Fabric
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
Oracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQLOracle Enterprise Manager for MySQL
Oracle Enterprise Manager for MySQL
 
MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014
 
MySQL Intro JSON NoSQL
MySQL Intro JSON NoSQLMySQL Intro JSON NoSQL
MySQL Intro JSON NoSQL
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance Improvement
 
Em13c New Features- Two of Two
Em13c New Features- Two of TwoEm13c New Features- Two of Two
Em13c New Features- Two of Two
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBA
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise Portfolio
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 

More from Mats Kindahl

Replication Tips & Trick for SMUG
Replication Tips & Trick for SMUGReplication Tips & Trick for SMUG
Replication Tips & Trick for SMUGMats Kindahl
 
Sharding using MySQL and PHP
Sharding using MySQL and PHPSharding using MySQL and PHP
Sharding using MySQL and PHPMats Kindahl
 
Replication Tips & Tricks
Replication Tips & TricksReplication Tips & Tricks
Replication Tips & TricksMats Kindahl
 
MySQL Binary Log API Presentation - OSCON 2011
MySQL Binary Log API Presentation - OSCON 2011MySQL Binary Log API Presentation - OSCON 2011
MySQL Binary Log API Presentation - OSCON 2011Mats Kindahl
 
Python Utilities for Managing MySQL Databases
Python Utilities for Managing MySQL DatabasesPython Utilities for Managing MySQL Databases
Python Utilities for Managing MySQL DatabasesMats Kindahl
 
Mysteries of the binary log
Mysteries of the binary logMysteries of the binary log
Mysteries of the binary logMats Kindahl
 

More from Mats Kindahl (7)

Why rust?
Why rust?Why rust?
Why rust?
 
Replication Tips & Trick for SMUG
Replication Tips & Trick for SMUGReplication Tips & Trick for SMUG
Replication Tips & Trick for SMUG
 
Sharding using MySQL and PHP
Sharding using MySQL and PHPSharding using MySQL and PHP
Sharding using MySQL and PHP
 
Replication Tips & Tricks
Replication Tips & TricksReplication Tips & Tricks
Replication Tips & Tricks
 
MySQL Binary Log API Presentation - OSCON 2011
MySQL Binary Log API Presentation - OSCON 2011MySQL Binary Log API Presentation - OSCON 2011
MySQL Binary Log API Presentation - OSCON 2011
 
Python Utilities for Managing MySQL Databases
Python Utilities for Managing MySQL DatabasesPython Utilities for Managing MySQL Databases
Python Utilities for Managing MySQL Databases
 
Mysteries of the binary log
Mysteries of the binary logMysteries of the binary log
Mysteries of the binary log
 

Recently uploaded

Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxSimranPal17
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectBoston Institute of Analytics
 
SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxHaritikaChhatwal1
 
Rithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdfRithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdfrahulyadav957181
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfblazblazml
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Thomas Poetter
 
Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max PrincetonTimothy Spann
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024Susanna-Assunta Sansone
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...Amil Baba Dawood bangali
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...Jack Cole
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelBoston Institute of Analytics
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Boston Institute of Analytics
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
Principles and Practices of Data Visualization
Principles and Practices of Data VisualizationPrinciples and Practices of Data Visualization
Principles and Practices of Data VisualizationKianJazayeri1
 
Cyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded dataCyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded dataTecnoIncentive
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 

Recently uploaded (20)

Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
Data Analysis Project: Stroke Prediction
Data Analysis Project: Stroke PredictionData Analysis Project: Stroke Prediction
Data Analysis Project: Stroke Prediction
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptx
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis Project
 
SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptx
 
Rithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdfRithik Kumar Singh codealpha pythohn.pdf
Rithik Kumar Singh codealpha pythohn.pdf
 
Insurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis ProjectInsurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis Project
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
Minimizing AI Hallucinations/Confabulations and the Path towards AGI with Exa...
 
Real-Time AI Streaming - AI Max Princeton
Real-Time AI  Streaming - AI Max PrincetonReal-Time AI  Streaming - AI Max Princeton
Real-Time AI Streaming - AI Max Princeton
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
Principles and Practices of Data Visualization
Principles and Practices of Data VisualizationPrinciples and Practices of Data Visualization
Principles and Practices of Data Visualization
 
Cyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded dataCyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded data
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 

Sharding and Scale-out using MySQL Fabric

  • 1. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.1 Sharding and Scale-out using MySQL Fabric Mats Kindahl (mats.kindahl@oracle.com) Principal Senior Software Developer
  • 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |2 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 decision. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Safe Harbor Statement
  • 3. 3 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 | Presentation Outline  Introducing MySQL Fabric  Architecture for High-Availability  Connecting to a MySQL Fabric Farm  Architecture for Sharding  Summary and Closing Remarks
  • 4. 4 Insert Picture Here Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 | An extensible and easy-to-use framework for managing a farm of MySQL servers supporting high-availability and sharding MySQL Fabric
  • 5. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |5 What does all that mean? ● “Farm” Management System ● Farm: Collection of components ● Distributed Framework ● Framework ● Procedure execution ● State store ● Transaction Routing ● Extensible ● Extensions are first-class ● High-Availability Groups ● “Semi-Automatic” Sharding ● Written in Python ● Latest Release 1.4.2 ● Release Candidate ● Open Source ● You can participate ● Suggest features ● Report bugs ● Contribute patches ● MySQL 5.6 is focus
  • 6. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |6 MySQL Fabric: Goals & Features ● Decision logic in connector ● Eliminate one network hop ● Reducing network load ● Connector API Extensions ● Support Transactions ● Support full SQL ● Load Balancing ● Read-Write Split ● Round-robin ● Multi-Table Sharding ● Sharding Functions ● Range ● (Consistent) Hash ● Shard Operations ● Shard move ● Shard split ● Global Updates ● Global tables ● Schema updates
  • 7. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |7 A Brief History of MySQL Fabric ● MySQL Fabric 1.4.0 ● September, 2013 ● First public release ● High-Availability Groups ● Slave Promotion ● Range and Hash Sharding ● Shard move and split ● Connector/Python Support ● Connector/J Support ● Connector/PHP Support ● MySQL Fabric 1.4.1 ● December, 2013 ● Alpha release ● Sharding refactorings ● MySQL Fabric 1.4.2 ● April, 2014 ● Release Candidate ● Distributed Failure Detection ● Credentials ● Weighted Round-Robin
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |8 Birds-eye View High Availability Groups Application XML-RPC SQL SQL Connector Connector Connector Operator MySQL Fabric Node Database Servers
  • 9. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |9 High-Level Components ● Fabric-aware Connectors ● Python, PHP, and Java ● Enhanced Connector API ● MySQL Fabric Node ● Manage information about farm ● Provide status information ● Execute procedures ● MySQL Servers ● Organized in High-Availability Groups ● Handling application data High Availability Group Application Connector Connector Connector MySQL Fabric Node
  • 10. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |10 MySQL Fabric Node Architecture MySQL MySQL Fabric Framework Executor State Store (Persister) Sh ?HA MySQL-RPCAMQP XML-RPC ?? Connector Connector Connector Protocols Extensions Backing Store
  • 11. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |11 MySQL Fabric: Prerequisites ● MySQL Servers (version 5.6.10 or later) ● Backing store database server ● Application database servers ● Python 2.6 or 2.7 ● No support for 3.x yet ● MySQL Utilities 1.4 ● Available at https://dev.mysql.com/downloads/tools/utilities ● “Development release” tab
  • 12. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |12 MySQL Fabric: Configuration ● Backing Store ● MySQL server ● Persistent storage for state ● Storage engine-agnostic ● Protocol ● Address where node will be ● Currently only XML-RPC ● Logging ● Chatty: INFO (default) ● Moderate: WARNING ● URL for rotating log [storage] address = localhost:3306 user = fabric password =  database = fabric [servers] user = fabric password =  [protocol.xmlrpc] address = localhost:32274 threads = 5 disable_authentication = yes [logging] level = INFO url = file:///var/log/fabric.log
  • 13. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |13 MySQL Fabric: Basic Commands and Help ● Command Structure mysqlfabric group command ... ● Getting help mysqlfabric help mysqlfabric help commands mysqlfabric help manage mysqlfabric help manage setup ● MySQL Utilities Documentation: ● http://dev.mysql.com/doc/mysql-utilities/1.4/en/index.html ● MySQL Fabric Documentation: ● http://dev.mysql.com/doc/mysql-utilities/1.4/en/fabric.html
  • 14. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |14 Setting up and Tearing down MySQL Fabric ● Create and populate the necessary tables in backing store mysqlfabric manage setup ● Remove the tables from backing store mysqlfabric manage teardown ● Connects to the database server in “storage” section ● Ensure that you have the necessary users and privileges
  • 15. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |15 Starting and Stopping MySQL Fabric ● Start MySQL Fabric node in foreground – print log to terminal mysqlfabric manage start ● Start MySQL Fabric node in background – print log to file mysqlfabric manage start ­­daemonize  ● Stop MySQL Fabric node mysqlfabric manage stop
  • 16. 16 Insert Picture Here Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 | Architecture for High-Availability
  • 17. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |17 High-Availability Concepts ● Redundancy ● Duplicate critical components ● Monitoring ● Detecting failing components ● Monitor load ● Procedures ● Activate replacements ● Distribute load
  • 18. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |18 High-Availability Group Concept ● Group of servers ● Hardware redundancy ● Data redundancy ● Generic Concept ● Implementation-independent ● Self-managed or externally managed ● Different Types ● Primary-Backup (Master-Slave) ● Shared or Replicated Storage ● MySQL Cluster Done! Examples Only Not Implemented
  • 19. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |19 High-Availability Group Concept ● Abstract Concept ● Set of servers ● Server attributes ● Connector Attributes ● Connection information ● Mode: read-only, read-write, ... ● Weight: distribute load ● Management Attributes ● Status: state/role of the server Status: Primary Mode: Read-Write Host: server- 1.example.com
  • 20. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |20 Create Groups and add Servers ● Define a group mysqlfabric group create my_group ● Add servers to group mysqlfabric group add my_group server1.example.com mysqlfabric group add my_group server2.example.com
  • 21. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |21 Activate High-Availability Group ● Promote one server to be primary mysqlfabric group promote my_group ● Tell built-in failure detector to monitor group mysqlfabric group activate my_group
  • 22. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |22 Distributed Failure Detector New in MySQL Fabric 1.4.2 ● Connectors report errors ● Report that an error was noticed ● Failover based on statistics ● report_error(server, source, error) ● Report failure ● A server is known to have failed ● Failover occurs immediately ● report_fault(server, source, error) Connector report_error report_fault
  • 23. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |23 Update Only Operations New in MySQL Fabric 1.4.2 ● Situation: ● Server promotion is done elsewhere ● Real situation does not match content of state-store ● Problem: ● Need to update state store to match real situation ● Should not touch application servers ● Solution: Use update-only option mysqlfabric group promote my_group ­­update_only   ­­slave_uuid=29bf3b2d­b5ac­11e3­a383­58946b051f64
  • 24. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |24 Credentials in MySQL Fabric New in MySQL Fabric 1.4.2 ● Credentials ● Digest Authentication ● SSL connection ● Digest Authentication ● RFC 2617 ● Server: Realm ● Client: User + Password ● SSL connection ● Setup Like MySQL Server [storage] address = localhost:3306 user = fabric password = xyzzy database = fabric [protocol.xmlrpc] address = localhost:32274 threads = 5 disable_authentication = no realm = MySQL Fabric user = admin password = xyzzy ssl_ca = /etc/mysql/fabric_ca.pem ssl_key = /etc/mysql/fabric_key.pem ssl_cert = /etc/mysql/fabric_cert.pem
  • 25. 25 Insert Picture Here Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 | Connecting to a MySQL Fabric Farm
  • 26. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |26 ● Fabric-aware Connectors ● Connector/J ● Connector/Python ● Connector/PHP ● Fabric-aware Frameworks ● Doctrine ● Hibernate ● In this presentation: ● Connector/Python Fabric-aware Connector ● Connector API Extensions ● Support Transactions ● Support full SQL ● Decision logic in connector ● Reducing network load ● Load Balancing ● Read-Write Split ● Distribute transactions
  • 27. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |27 Routing Transactions prop1=val1 prop2=val2 execute(query) srv1.example.com:3306 srv2.example.com:3306 srv3.example.com:3307 MySQL Fabric Node Application prop1=val1 prop2=val2 execute(query) Connector Cache srv1.example.com srv2.example.com srv3.example.com
  • 28. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |28 Fabric-aware Connector API import mysql.connector conn = mysql.connector.connect(     fabric={"host": "fabric.example.com"},     user='mats', password='xyzzy', database="employees" ) ● Establish a “virtual” connection ● Real server connection established lazily ● Provide connection information for the Fabric node ● Connector will fetch information about servers
  • 29. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |29 Enable Connector/Python Error Reporting New in Connector/Python 1.2.1 import mysql.connector conn = mysql.connector.connect(     fabric={"host": "fabric.example.com"},     user='mats', password='xyzzy', database="employees", report_error=True, ) ● Connectors can report errors to Fabric node ● Enable using report_error ● Defaults to False ● Require MySQL Fabric 1.4.2
  • 30. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |30 Connector API: Executing a Transaction ● Provide group name ● Property: group ● Fabric will compute candidate servers conn.set_property(group='my_group', mode=MODE_READWRITE) cur = conn.cursor() cur.execute("INSERT INTO employees VALUES (%s,%s,%s)",             (emp_no, first_name, last_name)) cur.execute("INSERT INTO titles(emp_no,title,from_date)"             “ VALUES (%s,%s,CURDATE())",             (emp_no, 'Intern')); conn.commit() ● Provide transaction mode ● Property: mode ● Fabric will pick server in right mode Same as before
  • 31. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |31 START TRANSACTION; SELECT salary INTO @s FROM salaries WHERE emp_no = 20101; SET @s = 1.1 * @s; INSERT INTO salaries VALUES (20101, @s); COMMIT; BEGIN; CALL update_salary(20202, @s);  COMMIT; Where's the sharding key? Ah, there it is! Session state? Hmm... looks like a read transaction Oops.. it was a write transaction! Transaction done! Clear session state? New transaction! Different connection? What about the session state? Executing a Transaction What about connection pools? Application error? What does this procedure update?
  • 32. 33 Insert Picture Here Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 | Architecture for Sharding
  • 33. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |34 Benefits of Sharding ● Write scalability ● Can handle more writes ● Large data set ● Database too large ● Does not fit on single server ● Improved performance ● Smaller index size ● Smaller working set UID 10000-20000 UID 20001-40000
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |35 MySQL Fabric: Sharding Goals & Features ● Connector API Extensions ● Support Transactions ● Support full SQL ● Decision logic in connector ● Reducing network load ● Shard Multiple Tables ● Using same key ● Global Updates ● Global tables ● Schema updates ● Sharding Functions ● Range ● (Consistent) Hash ● Shard Operations ● Using built-in executor ● Shard move ● Shard split
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |36 Sharded Tables Table Rows salaries 284 404 700 titles 44 330 800 employees 30 002 400 dept_emp 33 160 300 dept_manager 2 400 departments 900 In desperate need of sharding! Foreign keys
  • 36. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |37 Mapping the Sharding Key ● What is a sharding key? ● Single column ● Multi column – Same table? – Different tables? ● How is the key transformed? ● Hash ● Range ● User-defined Compute Shard# KeyShard# (X) (X,Y,...) RANGE HASH Something else
  • 37. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |38 Sharded Tables: Multiple Mappings Library Schema Employee Schema
  • 38. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |39 Digression: Computing Shards ● Multiple Mappings ● Which mapping to use? ● Application don't care … but know tables in transaction ● Currently only one mapping ● Computing shard requires ● Tables + sharding key ● Map# + sharding key ● Enhanced Connector API Compute Shard# Key Shard#Map# Compute Map# Tables
  • 39. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |40 Multi-table Query with Sharded Tables SELECT first_name, last_name, salary FROM salaries JOIN employees USING (emp_no) WHERE emp_no = 21012 AND CURRENT_DATE BETWEEN from_date AND to_date; ● Referential Integrity Constraint ● Example query joining salaries and employees ● Same key, same shard: co-locate rows for same user ● JOIN normally based on equality ● Using non-equality defeats purpose of foreign key
  • 40. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |41 Global Tables Table Rows salaries 284 404 700 titles 44 330 800 employees 30 002 400 dept_emp 33 160 300 dept_manager 2 400 departments 900 Do not really need to be sharded Global tables exist on all shards!
  • 41. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |42 Multi-table Query with Global Tables SELECT first_name, last_name, GROUP_CONCAT(dept_name) FROM employees JOIN dept_emp USING (emp_no) JOIN departments USING (dept_no) WHERE emp_no = 21012 GROUP BY emp_no; ● JOIN with departments table ● Has no employee number, hence no sharding key ● Table need to be present on all shards ● But... how do we update global tables?
  • 42. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |43 Sharding Architecture Shards MySQL Fabric Node Application Connector Connector Connector Global Group Global Updates Shard Updates Replication Support global update for off-line shards
  • 43. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |44 MySQL Fabric: Sharding Setup ● Set up some groups ● my_global – for global updates ● my_group.* – for the shards ● Add servers to the groups ● Create a shard mapping ● A “distributed database” ● Give information on what tables are sharded ● Add shards ● Mapping keys to shards
  • 44. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |45 MySQL Fabric: Set up Shard Mapping ● Define shard mapping mysqlfabric sharding    create_definition hash my_global ● Add tables that should be sharded mysqlfabric sharding add_table 1    employees.employees emp_no mysqlfabric sharding add_table 1    employees.salaries emp_no ● Tables not added are considered global Shard map identifier Will return a shard map identifier
  • 45. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |46 MySQL Fabric: Add Shards ● Add shards to shard mapping mysqlfabric sharding add_shard 1    “my_group.1,...,my_group.N” ­­state=ENABLED Shard map identifier
  • 46. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |47 MySQL Fabric: Moving and Splitting Shards ● Moving a shard from one group to another mysqlfabric sharding move 5 my_group.5 ● Splitting a shard into two pieces (hash) mysqlfabric sharding split 5 my_group.6 Shard ID
  • 47. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |48 Connector API: Shard Specific Query ● Provide tables in query ● Property: tables ● Fabric will compute map conn.set_property(tables=['employees.employees', 'employees.titles'],                   key=emp_no) cur = conn.cursor() cur.execute("INSERT INTO employees VALUES (%s,%s,%s)",             (emp_no, first_name, last_name)) cur.execute("INSERT INTO titles(emp_no, title, from_date)"             " VALUES (%s, %s, CURDATE())",             (emp_no, 'Intern')); conn.commit() ● Provide sharding key ● Property: key ● Fabric will compute shard
  • 48. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |49 Connector API: Shard Specific Query ● Provide tables in query ● Property: tables ● Fabric will compute map conn.set_property(tables=['employees.employees', 'employees.titles'],                   key=emp_no) cur = conn.cursor() cur.execute(     "SELECT first_name, last_name, title"     "  FROM employees JOIN titles USING (emp_no)"     " WHERE emp_no = %d", (emp_no,)) for row in cur:     print row[0], row[1], “,“, row[2] ● Provide sharding key ● Property: key ● Fabric will compute shard Join queries are sent to correct shard and executed there
  • 49. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |50 Connector API: Global Update ● Provide tables in query ● Property: tables ● Fabric will compute map ● (Not necessary) conn.set_property(tables=['employees.titles'], scope='GLOBAL') cur = conn.cursor() cur.execute("ALTER TABLE employees.titles ADD nickname VARCHAR(64)") ● Set global scope ● Property: scope ● Query goes to global group
  • 50. 51 Insert Picture Here Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 | Closing Remarks
  • 51. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |52 What do we have now? ● MySQL Farm Management ● High-Availability ● Sharding ● High-Availability ● Group Concept ● Slave promotion ● Sharding ● Range and hash sharding ● Shard move and shard split ● Connector APIs ● Transaction properties ● “Virtual” connections ● Enhanced Connectors ● Connector/Python ● Connector/PHP ● Connector/J ● Command-line Interface ● XML-RPC Interfaces ● Distributed failure detector ● Connectors report failures ● Custom failure detectors ● Credentials ● RFC 2617 ● SSL support
  • 52. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |53 Thoughts for the Future ● Connector multi-cast ● Scatter-gather ● UNION of result sets ● More complex operations? ● Extension interfaces ● Improve extension support ● Improve procedures support ● Command-line interface ● Improving usability ● Focus on ease-of-use ● More protocols ● MySQL-RPC Protocol? ● More frameworks? ● More connectors? ● C/C++? ● Fabric-unaware connectors? ● More HA group types ● DRBD ● MySQL Cluster
  • 53. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |54 Thoughts for the Future ● “Transparent” Sharding ● Single-query transactions? ● Speculative execution? ● Cross-shard join? ● Multiple shard mappings ● Independent tables ● Multi-way shard split ● Efficient initial sharding ● Better use of resources ● High-availability executor ● Node failure stop execution ● Replicated State Machine – Paxos? – Raft? ● Continue execution on other Fabric node ● Session Consistency ● We have a distributed database ● It should look like a single database
  • 54. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |55 Reading for the Interested ● MySQL Forum: Fabric, Sharding, HA, Utilities http://forums.mysql.com/list.php?144 ● MySQL Fabric Documentation http://dev.mysql.com/doc/mysql-utilities/1.4/en/fabric.html ● Migrating From an Unsharded to a Sharded Setup http://vnwrites.blogspot.com/2013/09/mysqlfabric-sharding-migration.html ● Configuring and running MySQL Fabric http://alfranio-distributed.blogspot.com/2014/03/mysqlfabric-installation.html
  • 55. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |56 Want to contribute? ● Check it … and send us use-case and feature suggestions ● Test it … and send comments to the forum ● Break it … and send in bugs to http://bugs.mysql.com
  • 56. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |57 Mats Kindahl Twitter: @mkindahl http://mysqlmusings.blogspot.com Alfranio Correia Twitter: @alfranio http://alfranio-distributed.blogspot.com Keeping in Touch Narayanan Venkateswaran Twitter: @vn_tweets http://vnwrites.blogspot.com Geert Vanderkelen Twitter: @geertjanvdk http://geert.vanderkelen.org
  • 57. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.58 Graphic Section Divider MySQL Connect @ Oracle OpenWorld Sept 29 – Oct 2 Special Offer: Register Before May 2 and Save an Extra US$100! Code: DPER Call for Proposals Open Until April 15!
  • 58. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.| Percona Live | April 3, 2014 |59 Thank you!