Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
MySQL Fabric:
Easy Management of MySQL Servers
Ricky Setyawan
MySQL Principal Sales Consultant
Ricky.setyawan@oracle.com
2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
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.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |3
Cloud
Web & Enterprise OEM & ISVs
Industry Leaders Rely on MySQL
4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Outline
• Introducing MySQL Fabric
• High-Availability
• Scaling
• Managing
• Connecting
5
Insert Picture Here
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.|
An extensible and easy-
to-use framework for
managing a farm of
MySQL server supporting
high-availability and
sharding
MySQL Fabric
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |6
MySQL Fabric: What is it?
●
“Farm” Management System
●
Distributed Framework
●
Procedure Execution
●
Farm Management
●
Extensible
●
Extensions are first-class
●
High-Availability Groups
●
“Semi-Automatic” Sharding
●
Written in Python
●
Early alpha
●
Long road ahead
●
Open Source
●
You can participate
●
Suggest features
●
Report bugs
●
Contribute patches
●
MySQL 5.6 is the focus
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |7
MySQL Fabric: Goals & Features
●
Connector API Extensions
●
Support Transactions
●
Support full SQL
●
Decision logic in connector
●
Reducing network load
●
Load Balancing
●
Read-Write Split
●
Distribute transactions
●
Global Updates
●
Global tables
●
Schema updates
●
Shard Multiple Tables
●
Using same key
●
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. |8
Transaction Handling
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |9
●
Routing Transactions
●
Pre-declare properties of transactions
●
Detecting transaction boundaries
●
Push as much as possible to server
●
Managing Session State
●
Move session state between servers
– Easy to use
– Expensive and error prone
●
Reset state after each transaction
– Transactions start with default session state
Transaction Handling
What about
crashes?
Where do I store
the session state?
What Session
State Change?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |10
Routing Transactions
Shard #2
Shard #1
Shard #3
Switch
State
Store Executor
QUERY
KEY
KEY
QUERY
Contain decision logic
for routing queries
Contain information
about location of shards
SHARD#
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |11
Deployment for Routing Transactions
Shard #2
Shard #1
Shard #3
Switch
State
Store Executor
Network hop!
Performance?
Protocol?
Single Points
of Failure!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |12
Deployment for Routing Transactions
Shard #2
Shard #1
Shard #3
Switch
State
Store Executor
Deployed with application
(e.g., inside connector)
API simple to add
Caches can be
used to avoid
performance impact
13
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.|
Introducing MySQL Fabric
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |14
Birds-eye View
High Availability Groups (Shards)
MySQL Fabric
Node
Application
XML-RPC
SQL
SQL
Connector
Connector
Connector
Operator
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |15
High-Level Components
●
Fabric-aware Connectors
●
Python, PHP, and Java
●
Extended Connector API
●
MySQL Servers
●
In High-Availability Groups
●
Managing the data
●
MySQL Fabric Node
●
Maintain Meta-Information
●
Information Interfaces
●
Execute Procedures
High Availability Group
Application
MySQL
Fabric
Node
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |16
MySQL Fabric Node Architecture
MySQL
MySQL Fabric
Framework
Executor
State Store
(Persister)
Sh
?
HA
MySQLAMQP XML-RPC
??
Protocols
Extensions
Backing
Store
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |17
MySQL Fabric: Prerequisites
●
MySQL Servers (version 5.6.10 or later)
●
Server for meta-data backing store
●
Servers being managed
●
Python 2.6 or 2.7
●
No support for 3.x yet
●
MySQL Utilities 1.4.0
●
Available at http://labs.mysql.com/
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |18
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
connection_timeout = 6
[protocol.xmlrpc]
address = localhost:8080
threads = 5
[logging]
level = INFO
url =
file:///var/log/fabric.log
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |19
MySQL Fabric: Setup and Teardown
●
Create the necessary tables in backing store
mysqlfabric manage setup
●
Remove the tables from backing store
mysqlfabric manage teardown
●
Connect to database server in “storage” section
●
Ensure that you have the necessary users and privileges
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |20
MySQL Fabric: Starting and Stopping
●
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
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |21
MySQL Fabric Hands-on Workshop
- Login to your Oracle virtual machine using Putty
VM IP : 192.168.56.101
Username : root
Password : 123456
- Start all MySQL instances In this workshop (7 instances)
/usr/local/fabric_ws/start_all_mysql.sh
- Start mysqlfabric process (using & so it runs in
background)
mysqlfabric manage start &
22
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.|
Architecture for
High-Availability
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |23
High-Availability Concepts
●
Redundancy
●
Duplicate critical
components
●
Monitoring
●
Detecting failing
components
●
Monitor load
●
Procedure
●
Activate backups
●
Distribute load
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |24
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!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |25
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
●
State: state/role of the server State: Primary
Mode: Read-Write
Host: server-1.example.com
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |26
MySQL Fabric: 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 
mats xyzzy
mysqlfabric group add my_group server2.example.com 
mats xyzzy
User + Password
(Likely to go away)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |27
MySQL Fabric: Create Groups and add Servers
●
Promote one server to be primary
mysqlfabric group promote my_group
●
Tell failure detector to monitor group
mysqlfabric group activate my_group
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |28
MySQL Fabric Hands-on Workshop
App
Server
Connector
Cache Fabric Node
Port : 13306
Shard1
Secondary
Port : 3309
Primary
Port : 3308
Shard2
Secondary
Port : 3311
Primary
Port : 3310
GlobalGroup
Primary
Port : 3306
Secondary
Port : 3307
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |29
MySQL Fabric Hands-on Workshop
- Create fabric groups
mysqlfabric group create GlobalGroup
mysqlfabric group create Shard1
mysqlfabric group create Shard2
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |30
MySQL Fabric Hands-on Workshop
- Adding servers and promote to primary
GlobalGroup :
# Global Group
mysqlfabric group add GlobalGroup 127.0.0.1:3306
mysqlfabric group lookup_servers GlobalGroup
mysqlfabric group promote GlobalGroup
mysqlfabric group lookup_servers GlobalGroup
mysqlfabric group add GlobalGroup 127.0.0.1:3307
mysqlfabric group lookup_servers GlobalGroup
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |31
MySQL Fabric Hands-on Workshop
[root@192.168.1.31 data_gs]# mysqlfabric group lookup_servers
GlobalGroup
Command :
{ success = True
return = [{'status': 'PRIMARY', 'server_uuid': 'ddba4771-
35d0-11e4-a71d-080027a7161e', 'mode': 'READ_WRITE', 'weight':
1.0, 'address': '127.0.0.1:3306'}, {'status': 'SECONDARY',
'server_uuid': 'fc6e324e-35d0-11e4-a71e-080027a7161e',
'mode': 'READ_ONLY', 'weight': 1.0, 'address': '127.0.0.1:3307'}]
activities =
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |32
MySQL Fabric Hands-on Workshop
- Adding servers and promote to primary
Shard 1 :
mysqlfabric group add Shard1 127.0.0.1:3308
mysqlfabric group lookup_servers Shard1
mysqlfabric group promote Shard1
mysqlfabric group lookup_servers Shard1
mysqlfabric group add Shard1 127.0.0.1:3309
mysqlfabric group lookup_servers Shard1
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |33
MySQL Fabric Hands-on Workshop
[root@192.168.1.31 data_gs]# mysqlfabric group lookup_servers
Shard1
Command :
{ success = True
return = [{'status': 'PRIMARY', 'server_uuid': '266384c5-
35d1-11e4-a71f-080027a7161e', 'mode': 'READ_WRITE', 'weight':
1.0, 'address': '127.0.0.1:3308'}, {'status': 'SECONDARY',
'server_uuid': '2d924643-35d1-11e4-a71f-080027a7161e',
'mode': 'READ_ONLY', 'weight': 1.0, 'address': '127.0.0.1:3309'}]
activities =
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |34
MySQL Fabric Hands-on Workshop
- Adding servers and promote to primary
Shard 2 :
mysqlfabric group add Shard2 127.0.0.1:3310
mysqlfabric group lookup_servers Shard2
mysqlfabric group promote Shard2
mysqlfabric group lookup_servers Shard2
mysqlfabric group add Shard2 127.0.0.1:3311
mysqlfabric group lookup_servers Shard2
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |35
MySQL Fabric Hands-on Workshop
[root@192.168.1.31 data_gs]# mysqlfabric group lookup_servers
Shard2
Command :
{ success = True
return = [{'status': 'PRIMARY', 'server_uuid': '4cc6c541-35d1-
11e4-a720-080027a7161e', 'mode': 'READ_WRITE', 'weight': 1.0,
'address': '127.0.0.1:3310'}, {'status': 'SECONDARY',
'server_uuid': '526a8154-35d1-11e4-a720-080027a7161e',
'mode': 'READ_ONLY', 'weight': 1.0, 'address': '127.0.0.1:3311'}]
activities =
}
36
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.|
Connecting to a
MySQL Fabric Farm
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |37
Fabric-aware Connector API
●
Connector API Extensions
●
Support Transactions
●
Support full SQL
●
Decision logic in connector
●
Reducing network load
●
Load Balancing
●
Read-Write Split
●
Distribute transactions
●
Fabric-aware Connectors
●
Connector/J
●
Connector/Python
●
Connector/PHP
●
Fabric-aware Frameworks
●
Doctrine
●
Hibernate
●
Focus on Connector/Python
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |38
Fabric-aware Connector API
●
Establish a “virtual” connection
●
Real server connection established lazily
●
Provide connection information for the Fabric node
●
Fabric node will provide information about real servers
import mysql.connector.fabric as connector
conn = connector.MySQLFabricConnection(
fabric={"host": "fabric.example.com", "port" : 8080},
user='mats', database="employees")
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |39
Connector API: Executing a Transaction
●
Provide group name
●
Property: group
●
Fabric will compute
candidate servers
●
Provide transaction type
●
Property: type
●
Fabric will pick server in
right mode
conn.set_property(group='my_group', type=TYPE_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() Transactions work fine!
40
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.|
Architecture for
Sharding
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |41
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
●
Improve performance
UID 10000-20000 UID 20001-40000
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |42
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. |43
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. |44
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
Sharded Tables
In desperate need
of sharding!
Foreign keys
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |45
Multi-table Query with Sharded Tables
●
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
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;
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |46
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
Global Tables
Does not need
to be sharded
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |47
Multi-table Query with Global Tables
●
JOIN with departments table
●
Has no employee number, hence no sharding key
●
Table need to be present on all shards
●
How do we update 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;
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |48
Sharding Architecture
Shards
MySQL Fabric Node
Application
Global
Group
Global Updates
Shard
Updates
Replication
Support global update
for off-line shards
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |49
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”
●
Mapping keys to shards
●
Give information on what tables are sharded
●
Add shards
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |50
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 global
Will show the shard map
identifier (a number)
Shard map identifier
Per-mapping Global Group
(Likely to go away)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |51
MySQL Fabric: Add Shards
●
Add shards to shard mapping
mysqlfabric sharding add_shard 1 my_group.1 enabled
.
.
.
mysqlfabric sharding add_shard 1 my_group.N enabled
Shard map identifier
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |52
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. |53
MySQL Fabric Hands-on Workshop
-Activate failure detector
mysqlfabric group activate Globalgroup
mysqlfabric group activate Shard1
mysqlfabric group activate Shard2
-Create sharding definitions
mysqlfabric sharding create_definition RANGE GlobalGroup
-Add Tables to Defined Shard Mappings
mysqlfabric sharding add_table 1 test.emp emp_no
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |54
MySQL Fabric Hands-on Workshop
-Add Shards for the Registered Tables
mysqlfabric sharding add_shard 1 "Shard1/1, Shard2/1000"
--state=ENABLED
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |55
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
●
Extended Connector API
●
Extra properties passed out-of-band
Compute
Shard#
Key
Shard#Map#
Compute
Map#
Tables
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |56
Connector API: Shard Specific Query
●
Provide tables in query
●
Property: tables
●
Fabric will compute map
●
Provide sharding key
●
Property: key
●
Fabric will compute shard
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() Transactions work fine!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |57
Connector API: Shard Specific Query
●
Provide tables in query
●
Property: tables
●
Fabric will compute map
●
Provide sharding key
●
Property: key
●
Fabric will compute shard
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]
Join queries are sent to correct
shard and executed there
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |58
Connector API: Global Update
●
Provide tables in query
●
Property: tables
●
Fabric will compute map
●
(Likely to not be needed)
●
Set global scope
●
Property: scope
●
Query goes to global group
conn.set_property(tables=['employees.titles'], scope='GLOBAL')
cur = conn.cursor()
cur.execute("ALTER TABLE employees.titles ADD nickname VARCHAR(64)")
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |59
MySQL Fabric Hands-on Workshop
-Create test table via Global Group
./mysql --port=3306 --protocol=tcp -uroot
USE test
CREATE TABLE emp(emp_no INT, first_name VARCHAR(32),
last_name VARCHAR(32));
-Run sample program
python /usr/local/fabric_ws/fabric-demo.py
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |60
MySQL Fabric Hands-on Workshop
-Testing scenarios
- Kill Fabric store instance
- Kill GlobalGroup primary node
- Kill Shard1 primary node
61
Insert Picture Here
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.|
Closing Remarks
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |62
What do we have now?
●
MySQL Farm Management
●
High-Availability
●
Sharding
●
High-Availability
●
Group Concept
●
Simple failure detector
●
Slave promotion
●
Connector APIs
●
Transaction properties
●
“Logical” connection
management
●
Enhanced Connectors
●
Connector/Python
●
Connector/PHP
●
Connector/J
●
Sharding
●
Range and hash sharding
●
Shard move and shard split
●
Global tables and updates
●
Command-line Interface
●
Easy setup and
management
●
XML-RPC Interfaces
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |63
Thoughts for the Future
●
Connector multi-cast
●
Scatter-gather
●
UNION of result sets
●
More complex operations?
●
Internal interfaces
●
Improve extension support
●
Improve procedures
support
●
Command-line interface
●
Improving usability
●
Focus on ease-of-use
●
More protocols
●
MySQL-RPC Protocol?
●
AMQP?
●
More frameworks?
●
More HA group types
●
DRBD
●
MySQL Cluster
●
Fabric-unaware connectors?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |64
Thoughts for the Future
●
“More transparent” sharding
●
Single-query transactions
●
Cross-shard join is a
problem
●
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
●
Fail over to other Fabric
node
●
Distributed failure detector
●
Connectors report failures
●
Custom failure detectors
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |65
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. |66
Reading for the Interested
●
MySQL Forum: Fabric, Sharding, HA, Utilities
http://forums.mysql.com/list.php?144
●
A Brief Introduction to MySQL Fabric
http://mysqlmusings.blogspot.com/2013/09/brief-introduction-to-mysql-fabric.html
●
MySQL Fabric – Sharding – Introduction
http://vnwrites.blogspot.com/2013/09/mysqlfabric-sharding-introduction.html
●
Writing a Fault-tolerant Database Application using MySQL Fabric
http://alfranio-distributed.blogspot.se/2013/09/writing-fault-tolerant-database.html
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |67
Mats Kindahl
Twitter: @mkindahl
Blog: http://mysqlmusings.blogspot.com
Andrew Morgan (Product Management)
Twitter: @andrewmorgan
Blog: http://clusterdb.com
Alfranio Correia
Twitter: @alfranio
Blog: http://alfranio-distributed.blogspot.com
Narayanan Venkateswaran
Twitter: @vn_tweets
Blog: http://vnwrites.blogspot.com
Keeping in Touch

My sql fabric webinar v1.1

  • 1.
    Copyright © 2013,Oracle and/or its affiliates. All rights reserved.1 MySQL Fabric: Easy Management of MySQL Servers Ricky Setyawan MySQL Principal Sales Consultant Ricky.setyawan@oracle.com
  • 2.
    2 Copyright ©2014, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement 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.
  • 3.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |3 Cloud Web & Enterprise OEM & ISVs Industry Leaders Rely on MySQL
  • 4.
    4 Copyright ©2014, Oracle and/or its affiliates. All rights reserved. | Outline • Introducing MySQL Fabric • High-Availability • Scaling • Managing • Connecting
  • 5.
    5 Insert Picture Here Copyright© 2013, Oracle and/or its affiliates. All rights reserved.| An extensible and easy- to-use framework for managing a farm of MySQL server supporting high-availability and sharding MySQL Fabric
  • 6.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |6 MySQL Fabric: What is it? ● “Farm” Management System ● Distributed Framework ● Procedure Execution ● Farm Management ● Extensible ● Extensions are first-class ● High-Availability Groups ● “Semi-Automatic” Sharding ● Written in Python ● Early alpha ● Long road ahead ● Open Source ● You can participate ● Suggest features ● Report bugs ● Contribute patches ● MySQL 5.6 is the focus
  • 7.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |7 MySQL Fabric: Goals & Features ● Connector API Extensions ● Support Transactions ● Support full SQL ● Decision logic in connector ● Reducing network load ● Load Balancing ● Read-Write Split ● Distribute transactions ● Global Updates ● Global tables ● Schema updates ● Shard Multiple Tables ● Using same key ● Sharding Functions ● Range ● (Consistent) Hash ● Shard Operations ● Using built-in executor ● Shard move ● Shard split
  • 8.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |8 Transaction Handling
  • 9.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |9 ● Routing Transactions ● Pre-declare properties of transactions ● Detecting transaction boundaries ● Push as much as possible to server ● Managing Session State ● Move session state between servers – Easy to use – Expensive and error prone ● Reset state after each transaction – Transactions start with default session state Transaction Handling What about crashes? Where do I store the session state? What Session State Change?
  • 10.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |10 Routing Transactions Shard #2 Shard #1 Shard #3 Switch State Store Executor QUERY KEY KEY QUERY Contain decision logic for routing queries Contain information about location of shards SHARD#
  • 11.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |11 Deployment for Routing Transactions Shard #2 Shard #1 Shard #3 Switch State Store Executor Network hop! Performance? Protocol? Single Points of Failure!
  • 12.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |12 Deployment for Routing Transactions Shard #2 Shard #1 Shard #3 Switch State Store Executor Deployed with application (e.g., inside connector) API simple to add Caches can be used to avoid performance impact
  • 13.
    13 Insert Picture Here Copyright© 2014, Oracle and/or its affiliates. All rights reserved.| Introducing MySQL Fabric
  • 14.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |14 Birds-eye View High Availability Groups (Shards) MySQL Fabric Node Application XML-RPC SQL SQL Connector Connector Connector Operator
  • 15.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |15 High-Level Components ● Fabric-aware Connectors ● Python, PHP, and Java ● Extended Connector API ● MySQL Servers ● In High-Availability Groups ● Managing the data ● MySQL Fabric Node ● Maintain Meta-Information ● Information Interfaces ● Execute Procedures High Availability Group Application MySQL Fabric Node
  • 16.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |16 MySQL Fabric Node Architecture MySQL MySQL Fabric Framework Executor State Store (Persister) Sh ? HA MySQLAMQP XML-RPC ?? Protocols Extensions Backing Store
  • 17.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |17 MySQL Fabric: Prerequisites ● MySQL Servers (version 5.6.10 or later) ● Server for meta-data backing store ● Servers being managed ● Python 2.6 or 2.7 ● No support for 3.x yet ● MySQL Utilities 1.4.0 ● Available at http://labs.mysql.com/
  • 18.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |18 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 connection_timeout = 6 [protocol.xmlrpc] address = localhost:8080 threads = 5 [logging] level = INFO url = file:///var/log/fabric.log
  • 19.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |19 MySQL Fabric: Setup and Teardown ● Create the necessary tables in backing store mysqlfabric manage setup ● Remove the tables from backing store mysqlfabric manage teardown ● Connect to database server in “storage” section ● Ensure that you have the necessary users and privileges
  • 20.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |20 MySQL Fabric: Starting and Stopping ● 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
  • 21.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |21 MySQL Fabric Hands-on Workshop - Login to your Oracle virtual machine using Putty VM IP : 192.168.56.101 Username : root Password : 123456 - Start all MySQL instances In this workshop (7 instances) /usr/local/fabric_ws/start_all_mysql.sh - Start mysqlfabric process (using & so it runs in background) mysqlfabric manage start &
  • 22.
    22 Insert Picture Here Copyright© 2014, Oracle and/or its affiliates. All rights reserved.| Architecture for High-Availability
  • 23.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |23 High-Availability Concepts ● Redundancy ● Duplicate critical components ● Monitoring ● Detecting failing components ● Monitor load ● Procedure ● Activate backups ● Distribute load
  • 24.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |24 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!
  • 25.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |25 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 ● State: state/role of the server State: Primary Mode: Read-Write Host: server-1.example.com
  • 26.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |26 MySQL Fabric: 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 mats xyzzy mysqlfabric group add my_group server2.example.com mats xyzzy User + Password (Likely to go away)
  • 27.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |27 MySQL Fabric: Create Groups and add Servers ● Promote one server to be primary mysqlfabric group promote my_group ● Tell failure detector to monitor group mysqlfabric group activate my_group
  • 28.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |28 MySQL Fabric Hands-on Workshop App Server Connector Cache Fabric Node Port : 13306 Shard1 Secondary Port : 3309 Primary Port : 3308 Shard2 Secondary Port : 3311 Primary Port : 3310 GlobalGroup Primary Port : 3306 Secondary Port : 3307
  • 29.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |29 MySQL Fabric Hands-on Workshop - Create fabric groups mysqlfabric group create GlobalGroup mysqlfabric group create Shard1 mysqlfabric group create Shard2
  • 30.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |30 MySQL Fabric Hands-on Workshop - Adding servers and promote to primary GlobalGroup : # Global Group mysqlfabric group add GlobalGroup 127.0.0.1:3306 mysqlfabric group lookup_servers GlobalGroup mysqlfabric group promote GlobalGroup mysqlfabric group lookup_servers GlobalGroup mysqlfabric group add GlobalGroup 127.0.0.1:3307 mysqlfabric group lookup_servers GlobalGroup
  • 31.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |31 MySQL Fabric Hands-on Workshop [root@192.168.1.31 data_gs]# mysqlfabric group lookup_servers GlobalGroup Command : { success = True return = [{'status': 'PRIMARY', 'server_uuid': 'ddba4771- 35d0-11e4-a71d-080027a7161e', 'mode': 'READ_WRITE', 'weight': 1.0, 'address': '127.0.0.1:3306'}, {'status': 'SECONDARY', 'server_uuid': 'fc6e324e-35d0-11e4-a71e-080027a7161e', 'mode': 'READ_ONLY', 'weight': 1.0, 'address': '127.0.0.1:3307'}] activities = }
  • 32.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |32 MySQL Fabric Hands-on Workshop - Adding servers and promote to primary Shard 1 : mysqlfabric group add Shard1 127.0.0.1:3308 mysqlfabric group lookup_servers Shard1 mysqlfabric group promote Shard1 mysqlfabric group lookup_servers Shard1 mysqlfabric group add Shard1 127.0.0.1:3309 mysqlfabric group lookup_servers Shard1
  • 33.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |33 MySQL Fabric Hands-on Workshop [root@192.168.1.31 data_gs]# mysqlfabric group lookup_servers Shard1 Command : { success = True return = [{'status': 'PRIMARY', 'server_uuid': '266384c5- 35d1-11e4-a71f-080027a7161e', 'mode': 'READ_WRITE', 'weight': 1.0, 'address': '127.0.0.1:3308'}, {'status': 'SECONDARY', 'server_uuid': '2d924643-35d1-11e4-a71f-080027a7161e', 'mode': 'READ_ONLY', 'weight': 1.0, 'address': '127.0.0.1:3309'}] activities = }
  • 34.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |34 MySQL Fabric Hands-on Workshop - Adding servers and promote to primary Shard 2 : mysqlfabric group add Shard2 127.0.0.1:3310 mysqlfabric group lookup_servers Shard2 mysqlfabric group promote Shard2 mysqlfabric group lookup_servers Shard2 mysqlfabric group add Shard2 127.0.0.1:3311 mysqlfabric group lookup_servers Shard2
  • 35.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |35 MySQL Fabric Hands-on Workshop [root@192.168.1.31 data_gs]# mysqlfabric group lookup_servers Shard2 Command : { success = True return = [{'status': 'PRIMARY', 'server_uuid': '4cc6c541-35d1- 11e4-a720-080027a7161e', 'mode': 'READ_WRITE', 'weight': 1.0, 'address': '127.0.0.1:3310'}, {'status': 'SECONDARY', 'server_uuid': '526a8154-35d1-11e4-a720-080027a7161e', 'mode': 'READ_ONLY', 'weight': 1.0, 'address': '127.0.0.1:3311'}] activities = }
  • 36.
    36 Insert Picture Here Copyright© 2014, Oracle and/or its affiliates. All rights reserved.| Connecting to a MySQL Fabric Farm
  • 37.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |37 Fabric-aware Connector API ● Connector API Extensions ● Support Transactions ● Support full SQL ● Decision logic in connector ● Reducing network load ● Load Balancing ● Read-Write Split ● Distribute transactions ● Fabric-aware Connectors ● Connector/J ● Connector/Python ● Connector/PHP ● Fabric-aware Frameworks ● Doctrine ● Hibernate ● Focus on Connector/Python
  • 38.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |38 Fabric-aware Connector API ● Establish a “virtual” connection ● Real server connection established lazily ● Provide connection information for the Fabric node ● Fabric node will provide information about real servers import mysql.connector.fabric as connector conn = connector.MySQLFabricConnection( fabric={"host": "fabric.example.com", "port" : 8080}, user='mats', database="employees")
  • 39.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |39 Connector API: Executing a Transaction ● Provide group name ● Property: group ● Fabric will compute candidate servers ● Provide transaction type ● Property: type ● Fabric will pick server in right mode conn.set_property(group='my_group', type=TYPE_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() Transactions work fine!
  • 40.
    40 Insert Picture Here Copyright© 2014, Oracle and/or its affiliates. All rights reserved.| Architecture for Sharding
  • 41.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |41 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 ● Improve performance UID 10000-20000 UID 20001-40000
  • 42.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |42 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
  • 43.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |43 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
  • 44.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |44 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 Sharded Tables In desperate need of sharding! Foreign keys
  • 45.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |45 Multi-table Query with Sharded Tables ● 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 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;
  • 46.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |46 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 Global Tables Does not need to be sharded
  • 47.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |47 Multi-table Query with Global Tables ● JOIN with departments table ● Has no employee number, hence no sharding key ● Table need to be present on all shards ● How do we update 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;
  • 48.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |48 Sharding Architecture Shards MySQL Fabric Node Application Global Group Global Updates Shard Updates Replication Support global update for off-line shards
  • 49.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |49 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” ● Mapping keys to shards ● Give information on what tables are sharded ● Add shards
  • 50.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |50 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 global Will show the shard map identifier (a number) Shard map identifier Per-mapping Global Group (Likely to go away)
  • 51.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |51 MySQL Fabric: Add Shards ● Add shards to shard mapping mysqlfabric sharding add_shard 1 my_group.1 enabled . . . mysqlfabric sharding add_shard 1 my_group.N enabled Shard map identifier
  • 52.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |52 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
  • 53.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |53 MySQL Fabric Hands-on Workshop -Activate failure detector mysqlfabric group activate Globalgroup mysqlfabric group activate Shard1 mysqlfabric group activate Shard2 -Create sharding definitions mysqlfabric sharding create_definition RANGE GlobalGroup -Add Tables to Defined Shard Mappings mysqlfabric sharding add_table 1 test.emp emp_no
  • 54.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |54 MySQL Fabric Hands-on Workshop -Add Shards for the Registered Tables mysqlfabric sharding add_shard 1 "Shard1/1, Shard2/1000" --state=ENABLED
  • 55.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |55 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 ● Extended Connector API ● Extra properties passed out-of-band Compute Shard# Key Shard#Map# Compute Map# Tables
  • 56.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |56 Connector API: Shard Specific Query ● Provide tables in query ● Property: tables ● Fabric will compute map ● Provide sharding key ● Property: key ● Fabric will compute shard 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() Transactions work fine!
  • 57.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |57 Connector API: Shard Specific Query ● Provide tables in query ● Property: tables ● Fabric will compute map ● Provide sharding key ● Property: key ● Fabric will compute shard 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] Join queries are sent to correct shard and executed there
  • 58.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |58 Connector API: Global Update ● Provide tables in query ● Property: tables ● Fabric will compute map ● (Likely to not be needed) ● Set global scope ● Property: scope ● Query goes to global group conn.set_property(tables=['employees.titles'], scope='GLOBAL') cur = conn.cursor() cur.execute("ALTER TABLE employees.titles ADD nickname VARCHAR(64)")
  • 59.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |59 MySQL Fabric Hands-on Workshop -Create test table via Global Group ./mysql --port=3306 --protocol=tcp -uroot USE test CREATE TABLE emp(emp_no INT, first_name VARCHAR(32), last_name VARCHAR(32)); -Run sample program python /usr/local/fabric_ws/fabric-demo.py
  • 60.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |60 MySQL Fabric Hands-on Workshop -Testing scenarios - Kill Fabric store instance - Kill GlobalGroup primary node - Kill Shard1 primary node
  • 61.
    61 Insert Picture Here Copyright© 2014, Oracle and/or its affiliates. All rights reserved.| Closing Remarks
  • 62.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |62 What do we have now? ● MySQL Farm Management ● High-Availability ● Sharding ● High-Availability ● Group Concept ● Simple failure detector ● Slave promotion ● Connector APIs ● Transaction properties ● “Logical” connection management ● Enhanced Connectors ● Connector/Python ● Connector/PHP ● Connector/J ● Sharding ● Range and hash sharding ● Shard move and shard split ● Global tables and updates ● Command-line Interface ● Easy setup and management ● XML-RPC Interfaces
  • 63.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |63 Thoughts for the Future ● Connector multi-cast ● Scatter-gather ● UNION of result sets ● More complex operations? ● Internal interfaces ● Improve extension support ● Improve procedures support ● Command-line interface ● Improving usability ● Focus on ease-of-use ● More protocols ● MySQL-RPC Protocol? ● AMQP? ● More frameworks? ● More HA group types ● DRBD ● MySQL Cluster ● Fabric-unaware connectors?
  • 64.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |64 Thoughts for the Future ● “More transparent” sharding ● Single-query transactions ● Cross-shard join is a problem ● 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 ● Fail over to other Fabric node ● Distributed failure detector ● Connectors report failures ● Custom failure detectors
  • 65.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |65 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
  • 66.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |66 Reading for the Interested ● MySQL Forum: Fabric, Sharding, HA, Utilities http://forums.mysql.com/list.php?144 ● A Brief Introduction to MySQL Fabric http://mysqlmusings.blogspot.com/2013/09/brief-introduction-to-mysql-fabric.html ● MySQL Fabric – Sharding – Introduction http://vnwrites.blogspot.com/2013/09/mysqlfabric-sharding-introduction.html ● Writing a Fault-tolerant Database Application using MySQL Fabric http://alfranio-distributed.blogspot.se/2013/09/writing-fault-tolerant-database.html
  • 67.
    Copyright © 2014,Oracle and/or its affiliates. All rights reserved. |67 Mats Kindahl Twitter: @mkindahl Blog: http://mysqlmusings.blogspot.com Andrew Morgan (Product Management) Twitter: @andrewmorgan Blog: http://clusterdb.com Alfranio Correia Twitter: @alfranio Blog: http://alfranio-distributed.blogspot.com Narayanan Venkateswaran Twitter: @vn_tweets Blog: http://vnwrites.blogspot.com Keeping in Touch