SlideShare una empresa de Scribd logo
1 de 59
Descargar para leer sin conexión
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
Insert Picture Here
2013-09-21
MySQL Sharding:
Tools and Best Practices for
Horizontal Scaling
Mats Kindahl (mats.kindahl@oracle.com)
Alfranio Correia (alfranio.correia@oracle.com)
Narayanan Venkateswaran (v.narayanan@oracle.com)
2013-09-21
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2
2013-09-21
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
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3
Program Agenda
 Handling Scaling
 What is sharding?
 Managing a Sharded Database
 Working with a Sharded Database
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
2013-09-21
What is
this
sharding?
What are
the benefits
of sharding?
How do I
shard my
database?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
2013-09-21
It's all about scaling...
●
Start with a single server
The Growing Enterprise
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
2013-09-21
It's all about scaling...
●
Start with a single server
●
More and more page requests
●
...more and more reads
●
What to do?
●
Scale out!
The Growing Enterprise
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
2013-09-21
It's all about scaling...
●
Start with a single server
●
More and more page requests
●
...more and more reads
●
What to do?
●
Scale out!
●
Replicate to read servers
The Growing Enterprise
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
2013-09-21
It's all about scaling...
●
Start with a single server
●
More and more page requests
●
...more and more reads
●
What to do?
●
Scale out!
●
Replicate to read servers
●
Perform a read-write split
●
Writes go to master
●
Reads go to read servers
The Growing Enterprise
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
2013-09-21
It's all about scaling...
●
More and more updates
●
Write load increases
●
What now?
The Growing Enterprise
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
2013-09-21
It's all about scaling...
●
More and more updates
●
Write load increases
●
What now?
●
Add another master?
The Growing Enterprise
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11
2013-09-21
It's all about scaling...
●
More and more updates
●
Write load increases
●
What now?
●
Add another master?
●
Doesn't work...
●
Write load is replicated
The Growing Enterprise
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12
2013-09-21
It's all about scaling...
●
More and more updates
●
Write load increases
●
What now?
●
Add another master?
●
Doesn't work...
●
Write load is replicated
●
Partition database
●
Distribute writes
●
Called sharding
The Growing Enterprise
UID 10000-20000 UID 20001-40000
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.14
Insert Picture Here
Architecture of a
Sharding Solution
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15
What do you need to consider?
 High level architecture
 Transaction and sharding key handling
 Granularity of sharding
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16
2013-09-21
High-level Architecture
●
What components do we need?
●
How are they deployed?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17
2013-09-21
Components for a Sharding Solution
Shard #2
Shard #1
Shard #3
Switch
State
Store Executor
QUERY
KEY
KEY
QUERY
Contain decision logic
for distributing queries
Contain information
about location of shards
SHARD#
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18
2013-09-21
Deployment of the Sharding Solution
Shard #2
Shard #1
Shard #3
Switch
State
Store Executor
Network hop!
Performance?
Protocol?
Single Points
of Failure!
Caches can be
used to avoid
performance impact
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19
2013-09-21
Deployment of the Sharding Solution
Shard #2
Shard #1
Shard #3
Switch
State
Store Executor
Deployed with application
(e.g., inside connector)
API simple to add
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20
2013-09-21
Transaction and Shard Key Handling
●
How are the transactions handled?
●
How do get the shard key for a transaction?
●
How to compute shard from key?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21
2013-09-21
BEGIN
SELECT salary INTO @s FROM salaries WHERE emp_no = 20101;
SET @s = 1.1 * @s;
INSERT INTO salaries VALUES (20101, @s);
COMMIT
BEGIN
INSERT INTO ... 
COMMIT
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 shard?
What about the session state?
Transaction Handling
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22
2013-09-21
Transaction Handling
●
Detecting transaction boundaries
●
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
What about
crashes?
Where do I store
the session state?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.24
2013-09-21
Granularity of Sharding
●
Can multiple tables be sharded with the same key?
●
Can we shard different tables different ways?
●
Do we allow global tables?
●
Do we allow cross-database queries?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.26
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.27
2013-09-21
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
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28
2013-09-21
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
● How do we update global tables?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29
Insert Picture Here
Managing a
Sharded Database
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30
Insert Picture Here
An extensible and easy-to-use
framework for managing a farm
of MySQL server supporting
high-availability and sharding
MySQL Fabric
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31
2013-09-21
MySQL Fabric: What is it?
●
“Farm” Management System
●
High-Availability
●
Sharding
●
Distributed
●
Procedure Execution
●
Extensible
●
Written in Python
●
Early alpha
●
Long road ahead
●
Open Source
●
You can participate
●
Suggest features
●
Report bugs
●
Contribute patches
●
MySQL 5.6 is focus
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32
2013-09-21
MySQL Fabric: Features
●
Decision logic in connector
●
Reducing network load
●
Support Transactions
●
API to provide sharding key
●
Global Updates
●
Global Tables
●
Schema updates
●
Procedure Executor
●
Shard Multiple Tables
●
Using same key
●
Sharding Functions
●
Range
●
(Consistent) Hash
●
Shard Operations
●
Using built-in executor
●
Shard move
●
Shard split
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33
2013-09-21
Birds-eye View of a Sharded Database
High Availability Groups
(Shards)
MySQL
Fabric
Node
Application
XML-RPC
SQL
SQL
Connector
Connector
Connector
Operator
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34
2013-09-21
MySQL Fabric Node Architecture
MySQL
MySQL Fabric
Framework
Executor
State Store
(Persister)
Sh
?HA
MySQLAMQP XML-RPC
??
Connector
Connector
Connector
Protocols
Extensions
Backing
Store
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.36
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.37
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.38
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.39
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.40
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.41
2013-09-21
MySQL Fabric: Create Groups and add Servers
●
Define a group
mysqlfabric group create my_global
●
Add servers to group
mysqlfabric group add my_global global.example.com 
  mats xyzzy
mysqlfabric group add my_global …
User + Password
(Likely to go away)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42
2013-09-21
MySQL Fabric: Create Groups and add Servers
●
Promote one server to be primary
mysqlfabric group promote my_global
●
Tell failure detector to monitor group
mysqlfabric group activate my_global
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43
2013-09-21
MySQL Fabric: Set up Shard Mapping
●
Define shard mapping
mysqlfabric sharding define hash my_global
●
Add tables that should be sharded
mysqlfabric sharding add_mapping 1 
  employees.employees emp_no
mysqlfabric sharding add_mapping 1 
  employees.salaries emp_no
●
Tables not added are global
Will show the shard map
identifier (a number)
Shard map identifier
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.45
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.46
Insert Picture Here
Working with a
Sharded Database
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47
2013-09-21
Fabric-aware Connector API
●
Support Transactions
●
Sharding key out of band
●
Fabric-aware Connectors
●
Connector/J
●
Connector/Python
●
Connector/PHP
●
Fabric-aware Frameworks
●
Doctrine
●
Hibernate
●
Focus on Connector/Python
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.48
2013-09-21
Fabric-aware Connector API
import mysql.connector.fabric as connector
conn = connector.MySQLFabricConnection(
    fabric={"host": "fabric.example.com", "port" : 8080},
    user='mats', database="employees")
● Establish a “virtual” connection
● Real server connection established lazily
● Provide connection information for the Fabric node
● Fabric node will provide information about real servers
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.49
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.50
2013-09-21
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
Transactions work fine!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.51
2013-09-21
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 © 2013, Oracle and/or its affiliates. All rights reserved.52
2013-09-21
Connector API: Global Update
●
Provide tables in query
●
Property: tables
●
Fabric will compute map
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
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.53
Insert Picture Here
Closing Remarks
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.54
2013-09-21
Thoughts for the Future
●
Connector multi-cast
●
Scatter-gather
●
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 © 2013, Oracle and/or its affiliates. All rights reserved.55
2013-09-21
Thoughts for the Future
●
“More transparent” sharding
●
Single-query transactions
●
Cross-shard joins 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 © 2013, Oracle and/or its affiliates. All rights reserved.56
2013-09-21
MySQL Connect Sessions
● MySQL High Availability: Managing Farms of Distributed Servers
● September 22, 5:30pm-6:30pm in Imperial Ballroom B
● Scaling PHP Applications
● September 22, 10:00am-11:00am in Union Square Room ¾
● MySQL Sharding, Replication, and HA
● September 21, 5:30-6:30pm in Imperial Ballroom B
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.57
2013-09-21
References
● 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
● Migrating From an Unsharded to a Sharded Setup
● http://vnwrites.blogspot.com/2013/09/mysqlfabric-sharding-migration.html
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.58
2013-09-21
Mats Kindahl
Twitter: @mkindahl
Blog: http://mysqlmusings.blogspot.com
Alfranio Correia
Twitter: @alfranio
Blog: http://alfranio-distributed.blogspot.com
Narayanan Venkateswaran
Twitter: @vn_tweets
Blog: http://vnwrites.blogspot.com
Keeping in Touch
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.59
2013-09-21
Thank you!

Más contenido relacionado

La actualidad más candente

How Development Teams Cut Costs with ScyllaDB.pdf
How Development Teams Cut Costs with ScyllaDB.pdfHow Development Teams Cut Costs with ScyllaDB.pdf
How Development Teams Cut Costs with ScyllaDB.pdfScyllaDB
 
Oracle Clusterware Node Management and Voting Disks
Oracle Clusterware Node Management and Voting DisksOracle Clusterware Node Management and Voting Disks
Oracle Clusterware Node Management and Voting DisksMarkus Michalewicz
 
The Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationThe Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationMarkus Michalewicz
 
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...MinhLeNguyenAnh2
 
Oracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACOracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACMarkus Michalewicz
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of PrestoTaro L. Saito
 
Under the Hood of a Shard-per-Core Database Architecture
Under the Hood of a Shard-per-Core Database ArchitectureUnder the Hood of a Shard-per-Core Database Architecture
Under the Hood of a Shard-per-Core Database ArchitectureScyllaDB
 
Make Your Application “Oracle RAC Ready” & Test For It
Make Your Application “Oracle RAC Ready” & Test For ItMake Your Application “Oracle RAC Ready” & Test For It
Make Your Application “Oracle RAC Ready” & Test For ItMarkus Michalewicz
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONMarkus Michalewicz
 
How to Use Oracle RAC in a Cloud? - A Support Question
How to Use Oracle RAC in a Cloud? - A Support QuestionHow to Use Oracle RAC in a Cloud? - A Support Question
How to Use Oracle RAC in a Cloud? - A Support QuestionMarkus Michalewicz
 
MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0Mayank Prasad
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performanceoysteing
 
AskTom: How to Make and Test Your Application "Oracle RAC Ready"?
AskTom: How to Make and Test Your Application "Oracle RAC Ready"?AskTom: How to Make and Test Your Application "Oracle RAC Ready"?
AskTom: How to Make and Test Your Application "Oracle RAC Ready"?Markus Michalewicz
 
Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Anil Nair
 
Oracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection IssuesOracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection IssuesMarkus Flechtner
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudNoritaka Sekiyama
 

La actualidad más candente (20)

How Development Teams Cut Costs with ScyllaDB.pdf
How Development Teams Cut Costs with ScyllaDB.pdfHow Development Teams Cut Costs with ScyllaDB.pdf
How Development Teams Cut Costs with ScyllaDB.pdf
 
Oracle Clusterware Node Management and Voting Disks
Oracle Clusterware Node Management and Voting DisksOracle Clusterware Node Management and Voting Disks
Oracle Clusterware Node Management and Voting Disks
 
The Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - PresentationThe Oracle RAC Family of Solutions - Presentation
The Oracle RAC Family of Solutions - Presentation
 
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
 
Oracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACOracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RAC
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of Presto
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
 
Under the Hood of a Shard-per-Core Database Architecture
Under the Hood of a Shard-per-Core Database ArchitectureUnder the Hood of a Shard-per-Core Database Architecture
Under the Hood of a Shard-per-Core Database Architecture
 
Make Your Application “Oracle RAC Ready” & Test For It
Make Your Application “Oracle RAC Ready” & Test For ItMake Your Application “Oracle RAC Ready” & Test For It
Make Your Application “Oracle RAC Ready” & Test For It
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLON
 
Apache Spark Architecture
Apache Spark ArchitectureApache Spark Architecture
Apache Spark Architecture
 
How to Use Oracle RAC in a Cloud? - A Support Question
How to Use Oracle RAC in a Cloud? - A Support QuestionHow to Use Oracle RAC in a Cloud? - A Support Question
How to Use Oracle RAC in a Cloud? - A Support Question
 
MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0
 
How to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better PerformanceHow to Analyze and Tune MySQL Queries for Better Performance
How to Analyze and Tune MySQL Queries for Better Performance
 
Oracle GoldenGate入門
Oracle GoldenGate入門Oracle GoldenGate入門
Oracle GoldenGate入門
 
AskTom: How to Make and Test Your Application "Oracle RAC Ready"?
AskTom: How to Make and Test Your Application "Oracle RAC Ready"?AskTom: How to Make and Test Your Application "Oracle RAC Ready"?
AskTom: How to Make and Test Your Application "Oracle RAC Ready"?
 
Galera Cluster Best Practices for DBA's and DevOps Part 1
Galera Cluster Best Practices for DBA's and DevOps Part 1Galera Cluster Best Practices for DBA's and DevOps Part 1
Galera Cluster Best Practices for DBA's and DevOps Part 1
 
Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19
 
Oracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection IssuesOracle Database: Checklist Connection Issues
Oracle Database: Checklist Connection Issues
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
 

Destacado

LaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data TypeLaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data TypeGabriela Ferrara
 
MySQL Enterprise Cloud
MySQL Enterprise Cloud MySQL Enterprise Cloud
MySQL Enterprise Cloud Mark Swarbrick
 
Building Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL FabricBuilding Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL FabricMats Kindahl
 
[스마트스터디]MongoDB 의 역습
[스마트스터디]MongoDB 의 역습[스마트스터디]MongoDB 의 역습
[스마트스터디]MongoDB 의 역습smartstudy_official
 
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLGabriela Ferrara
 
LAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivialLAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivialGabriela Ferrara
 
MySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo ProveitoMySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo ProveitoGabriela Ferrara
 
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...Ivan Zoratti
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1Ivan Ma
 
MySQL Cluster Whats New
MySQL Cluster Whats NewMySQL Cluster Whats New
MySQL Cluster Whats NewMark Swarbrick
 
The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016Colin Charles
 
Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016Gabriela Ferrara
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Ontico
 
Sharding using MySQL and PHP
Sharding using MySQL and PHPSharding using MySQL and PHP
Sharding using MySQL and PHPMats Kindahl
 
Exploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better TogetherExploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better TogetherObjectRocket
 
Coding like a girl - DjangoCon
Coding like a girl - DjangoConCoding like a girl - DjangoCon
Coding like a girl - DjangoConGabriela Ferrara
 

Destacado (20)

LaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data TypeLaravelSP - MySQL 5.7: introdução ao JSON Data Type
LaravelSP - MySQL 5.7: introdução ao JSON Data Type
 
MySQL Enterprise Cloud
MySQL Enterprise Cloud MySQL Enterprise Cloud
MySQL Enterprise Cloud
 
Building Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL FabricBuilding Scalable High Availability Systems using MySQL Fabric
Building Scalable High Availability Systems using MySQL Fabric
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
[스마트스터디]MongoDB 의 역습
[스마트스터디]MongoDB 의 역습[스마트스터디]MongoDB 의 역습
[스마트스터디]MongoDB 의 역습
 
SunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQLSunshinePHP 2017 - Making the most out of MySQL
SunshinePHP 2017 - Making the most out of MySQL
 
Laravel 5 and SOLID
Laravel 5 and SOLIDLaravel 5 and SOLID
Laravel 5 and SOLID
 
LAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivialLAMP: Desenvolvendo além do trivial
LAMP: Desenvolvendo além do trivial
 
MySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo ProveitoMySQL 5.7 - 
Tirando o Máximo Proveito
MySQL 5.7 - 
Tirando o Máximo Proveito
 
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
Ora mysql bothGetting the best of both worlds with Oracle 11g and MySQL Enter...
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
 
MySQL Cluster Whats New
MySQL Cluster Whats NewMySQL Cluster Whats New
MySQL Cluster Whats New
 
The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016
 
Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016Strip your TEXT fields - Exeter Web Feb/2016
Strip your TEXT fields - Exeter Web Feb/2016
 
Mongodb
MongodbMongodb
Mongodb
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
 
Sharding using MySQL and PHP
Sharding using MySQL and PHPSharding using MySQL and PHP
Sharding using MySQL and PHP
 
Exploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better TogetherExploring MongoDB & Elasticsearch: Better Together
Exploring MongoDB & Elasticsearch: Better Together
 
Strip your TEXT fields
Strip your TEXT fieldsStrip your TEXT fields
Strip your TEXT fields
 
Coding like a girl - DjangoCon
Coding like a girl - DjangoConCoding like a girl - DjangoCon
Coding like a girl - DjangoCon
 

Similar a MySQL Sharding: Tools and Best Practices for Horizontal Scaling

Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Dave Stokes
 
My sql fabric webinar tw2
My sql fabric webinar tw2My sql fabric webinar tw2
My sql fabric webinar tw2Ivan Tu
 
206590 mobilizing your primavera workforce
206590 mobilizing your primavera workforce206590 mobilizing your primavera workforce
206590 mobilizing your primavera workforcep6academy
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllThomas Wuerthinger
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Dave Stokes
 
MySQL Fabric: Easy Management of MySQL Servers
MySQL Fabric: Easy Management of MySQL ServersMySQL Fabric: Easy Management of MySQL Servers
MySQL Fabric: Easy Management of MySQL ServersMats Kindahl
 
A3 oracle database 12c extreme performance for cloud computing
A3   oracle database 12c extreme performance for cloud computingA3   oracle database 12c extreme performance for cloud computing
A3 oracle database 12c extreme performance for cloud computingDr. Wilfred Lin (Ph.D.)
 
OSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaOSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaMayank Prasad
 
Introduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise MonitorIntroduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise MonitorMark Leith
 
O Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no JavaO Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no JavaBruno Borges
 
GLOC Keynote 2014 - In-memory
GLOC Keynote 2014 - In-memoryGLOC Keynote 2014 - In-memory
GLOC Keynote 2014 - In-memoryConnor McDonald
 
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013Andrew Morgan
 
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...Dave Stokes
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014Dave Stokes
 
(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle Cloud(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle CloudRuggero Citton
 
Developing Applications with MySQL and Java
Developing Applications with MySQL and JavaDeveloping Applications with MySQL and Java
Developing Applications with MySQL and JavaMark Matthews
 

Similar a MySQL Sharding: Tools and Best Practices for Horizontal Scaling (20)

Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
Scaling MySQl 1 to N Servers -- Los Angelese MySQL User Group Feb 2014
 
My sql fabric webinar tw2
My sql fabric webinar tw2My sql fabric webinar tw2
My sql fabric webinar tw2
 
206590 mobilizing your primavera workforce
206590 mobilizing your primavera workforce206590 mobilizing your primavera workforce
206590 mobilizing your primavera workforce
 
Graal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them AllGraal and Truffle: One VM to Rule Them All
Graal and Truffle: One VM to Rule Them All
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015
 
MySQL Fabric: Easy Management of MySQL Servers
MySQL Fabric: Easy Management of MySQL ServersMySQL Fabric: Easy Management of MySQL Servers
MySQL Fabric: Easy Management of MySQL Servers
 
A3 oracle database 12c extreme performance for cloud computing
A3   oracle database 12c extreme performance for cloud computingA3   oracle database 12c extreme performance for cloud computing
A3 oracle database 12c extreme performance for cloud computing
 
OSI_MySQL_Performance Schema
OSI_MySQL_Performance SchemaOSI_MySQL_Performance Schema
OSI_MySQL_Performance Schema
 
Introduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise MonitorIntroduction to MySQL Enterprise Monitor
Introduction to MySQL Enterprise Monitor
 
Oracle NoSQL
Oracle NoSQLOracle NoSQL
Oracle NoSQL
 
con9578-2088758.pdf
con9578-2088758.pdfcon9578-2088758.pdf
con9578-2088758.pdf
 
O Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no JavaO Mundo Oracle e o Que Há de Novo no Java
O Mundo Oracle e o Que Há de Novo no Java
 
GLOC Keynote 2014 - In-memory
GLOC Keynote 2014 - In-memoryGLOC Keynote 2014 - In-memory
GLOC Keynote 2014 - In-memory
 
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
NoSQL & SQL - Best of both worlds - BarCamp Berkshire 2013
 
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
MySQL 5.7 NEW FEATURES, BETTER PERFORMANCE, AND THINGS THAT WILL BREAK -- Mid...
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
 
Cloud based database
Cloud based databaseCloud based database
Cloud based database
 
(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle Cloud(ZDM) Zero Downtime DB Migration to Oracle Cloud
(ZDM) Zero Downtime DB Migration to Oracle Cloud
 
Apouc 2014-business-analytics-and-big-data
Apouc 2014-business-analytics-and-big-dataApouc 2014-business-analytics-and-big-data
Apouc 2014-business-analytics-and-big-data
 
Developing Applications with MySQL and Java
Developing Applications with MySQL and JavaDeveloping Applications with MySQL and Java
Developing Applications with MySQL and Java
 

Más de Mats Kindahl

High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL FabricMats Kindahl
 
Elastic Scalability in MySQL Fabric Using OpenStack
Elastic Scalability in MySQL Fabric Using OpenStackElastic Scalability in MySQL Fabric Using OpenStack
Elastic Scalability in MySQL Fabric Using OpenStackMats Kindahl
 
Sharding and Scale-out using MySQL Fabric
Sharding and Scale-out using MySQL FabricSharding and Scale-out using MySQL Fabric
Sharding and Scale-out using MySQL FabricMats Kindahl
 
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
 
Replication Tips & Trick for SMUG
Replication Tips & Trick for SMUGReplication Tips & Trick for SMUG
Replication Tips & Trick for SMUGMats 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
 

Más de Mats Kindahl (10)

Why rust?
Why rust?Why rust?
Why rust?
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL Fabric
 
Elastic Scalability in MySQL Fabric Using OpenStack
Elastic Scalability in MySQL Fabric Using OpenStackElastic Scalability in MySQL Fabric Using OpenStack
Elastic Scalability in MySQL Fabric Using OpenStack
 
Sharding and Scale-out using MySQL Fabric
Sharding and Scale-out using MySQL FabricSharding and Scale-out using MySQL Fabric
Sharding and Scale-out using MySQL Fabric
 
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
 
Replication Tips & Trick for SMUG
Replication Tips & Trick for SMUGReplication Tips & Trick for SMUG
Replication Tips & Trick for SMUG
 
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
 

Último

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Último (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

MySQL Sharding: Tools and Best Practices for Horizontal Scaling

  • 1. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1 Insert Picture Here 2013-09-21 MySQL Sharding: Tools and Best Practices for Horizontal Scaling Mats Kindahl (mats.kindahl@oracle.com) Alfranio Correia (alfranio.correia@oracle.com) Narayanan Venkateswaran (v.narayanan@oracle.com) 2013-09-21
  • 2. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2 2013-09-21 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 © 2013, Oracle and/or its affiliates. All rights reserved.3 Program Agenda  Handling Scaling  What is sharding?  Managing a Sharded Database  Working with a Sharded Database
  • 4. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4 2013-09-21 What is this sharding? What are the benefits of sharding? How do I shard my database?
  • 5. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5 2013-09-21 It's all about scaling... ● Start with a single server The Growing Enterprise
  • 6. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6 2013-09-21 It's all about scaling... ● Start with a single server ● More and more page requests ● ...more and more reads ● What to do? ● Scale out! The Growing Enterprise
  • 7. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7 2013-09-21 It's all about scaling... ● Start with a single server ● More and more page requests ● ...more and more reads ● What to do? ● Scale out! ● Replicate to read servers The Growing Enterprise
  • 8. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8 2013-09-21 It's all about scaling... ● Start with a single server ● More and more page requests ● ...more and more reads ● What to do? ● Scale out! ● Replicate to read servers ● Perform a read-write split ● Writes go to master ● Reads go to read servers The Growing Enterprise
  • 9. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9 2013-09-21 It's all about scaling... ● More and more updates ● Write load increases ● What now? The Growing Enterprise
  • 10. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10 2013-09-21 It's all about scaling... ● More and more updates ● Write load increases ● What now? ● Add another master? The Growing Enterprise
  • 11. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11 2013-09-21 It's all about scaling... ● More and more updates ● Write load increases ● What now? ● Add another master? ● Doesn't work... ● Write load is replicated The Growing Enterprise
  • 12. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12 2013-09-21 It's all about scaling... ● More and more updates ● Write load increases ● What now? ● Add another master? ● Doesn't work... ● Write load is replicated ● Partition database ● Distribute writes ● Called sharding The Growing Enterprise UID 10000-20000 UID 20001-40000
  • 13. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13 2013-09-21 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
  • 14. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14 Insert Picture Here Architecture of a Sharding Solution
  • 15. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15 What do you need to consider?  High level architecture  Transaction and sharding key handling  Granularity of sharding
  • 16. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16 2013-09-21 High-level Architecture ● What components do we need? ● How are they deployed?
  • 17. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17 2013-09-21 Components for a Sharding Solution Shard #2 Shard #1 Shard #3 Switch State Store Executor QUERY KEY KEY QUERY Contain decision logic for distributing queries Contain information about location of shards SHARD#
  • 18. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18 2013-09-21 Deployment of the Sharding Solution Shard #2 Shard #1 Shard #3 Switch State Store Executor Network hop! Performance? Protocol? Single Points of Failure! Caches can be used to avoid performance impact
  • 19. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19 2013-09-21 Deployment of the Sharding Solution Shard #2 Shard #1 Shard #3 Switch State Store Executor Deployed with application (e.g., inside connector) API simple to add
  • 20. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20 2013-09-21 Transaction and Shard Key Handling ● How are the transactions handled? ● How do get the shard key for a transaction? ● How to compute shard from key?
  • 21. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21 2013-09-21 BEGIN SELECT salary INTO @s FROM salaries WHERE emp_no = 20101; SET @s = 1.1 * @s; INSERT INTO salaries VALUES (20101, @s); COMMIT BEGIN INSERT INTO ...  COMMIT 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 shard? What about the session state? Transaction Handling
  • 22. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22 2013-09-21 Transaction Handling ● Detecting transaction boundaries ● 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 What about crashes? Where do I store the session state?
  • 23. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23 2013-09-21 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
  • 24. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24 2013-09-21 Granularity of Sharding ● Can multiple tables be sharded with the same key? ● Can we shard different tables different ways? ● Do we allow global tables? ● Do we allow cross-database queries?
  • 25. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25 2013-09-21 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
  • 26. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26 2013-09-21 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
  • 27. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27 2013-09-21 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
  • 28. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28 2013-09-21 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 ● How do we update global tables?
  • 29. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29 Insert Picture Here Managing a Sharded Database
  • 30. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30 Insert Picture Here An extensible and easy-to-use framework for managing a farm of MySQL server supporting high-availability and sharding MySQL Fabric
  • 31. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31 2013-09-21 MySQL Fabric: What is it? ● “Farm” Management System ● High-Availability ● Sharding ● Distributed ● Procedure Execution ● Extensible ● Written in Python ● Early alpha ● Long road ahead ● Open Source ● You can participate ● Suggest features ● Report bugs ● Contribute patches ● MySQL 5.6 is focus
  • 32. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32 2013-09-21 MySQL Fabric: Features ● Decision logic in connector ● Reducing network load ● Support Transactions ● API to provide sharding key ● Global Updates ● Global Tables ● Schema updates ● Procedure Executor ● Shard Multiple Tables ● Using same key ● Sharding Functions ● Range ● (Consistent) Hash ● Shard Operations ● Using built-in executor ● Shard move ● Shard split
  • 33. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33 2013-09-21 Birds-eye View of a Sharded Database High Availability Groups (Shards) MySQL Fabric Node Application XML-RPC SQL SQL Connector Connector Connector Operator
  • 34. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34 2013-09-21 MySQL Fabric Node Architecture MySQL MySQL Fabric Framework Executor State Store (Persister) Sh ?HA MySQLAMQP XML-RPC ?? Connector Connector Connector Protocols Extensions Backing Store
  • 35. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35 2013-09-21 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/
  • 36. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.36 2013-09-21 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
  • 37. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.37 2013-09-21 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
  • 38. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.38 2013-09-21 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
  • 39. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.39 2013-09-21 Sharding Architecture Shards MySQL Fabric Node Application Connector Connector Connector Global Group Global Updates Shard Updates Replication Support global update for off-line shards
  • 40. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.40 2013-09-21 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
  • 41. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.41 2013-09-21 MySQL Fabric: Create Groups and add Servers ● Define a group mysqlfabric group create my_global ● Add servers to group mysqlfabric group add my_global global.example.com    mats xyzzy mysqlfabric group add my_global … User + Password (Likely to go away)
  • 42. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42 2013-09-21 MySQL Fabric: Create Groups and add Servers ● Promote one server to be primary mysqlfabric group promote my_global ● Tell failure detector to monitor group mysqlfabric group activate my_global
  • 43. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43 2013-09-21 MySQL Fabric: Set up Shard Mapping ● Define shard mapping mysqlfabric sharding define hash my_global ● Add tables that should be sharded mysqlfabric sharding add_mapping 1    employees.employees emp_no mysqlfabric sharding add_mapping 1    employees.salaries emp_no ● Tables not added are global Will show the shard map identifier (a number) Shard map identifier
  • 44. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44 2013-09-21 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
  • 45. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45 2013-09-21 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
  • 46. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46 Insert Picture Here Working with a Sharded Database
  • 47. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47 2013-09-21 Fabric-aware Connector API ● Support Transactions ● Sharding key out of band ● Fabric-aware Connectors ● Connector/J ● Connector/Python ● Connector/PHP ● Fabric-aware Frameworks ● Doctrine ● Hibernate ● Focus on Connector/Python
  • 48. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.48 2013-09-21 Fabric-aware Connector API import mysql.connector.fabric as connector conn = connector.MySQLFabricConnection(     fabric={"host": "fabric.example.com", "port" : 8080},     user='mats', database="employees") ● Establish a “virtual” connection ● Real server connection established lazily ● Provide connection information for the Fabric node ● Fabric node will provide information about real servers
  • 49. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.49 2013-09-21 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
  • 50. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.50 2013-09-21 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 Transactions work fine!
  • 51. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.51 2013-09-21 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
  • 52. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.52 2013-09-21 Connector API: Global Update ● Provide tables in query ● Property: tables ● Fabric will compute map 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
  • 53. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.53 Insert Picture Here Closing Remarks
  • 54. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.54 2013-09-21 Thoughts for the Future ● Connector multi-cast ● Scatter-gather ● 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?
  • 55. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.55 2013-09-21 Thoughts for the Future ● “More transparent” sharding ● Single-query transactions ● Cross-shard joins 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
  • 56. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.56 2013-09-21 MySQL Connect Sessions ● MySQL High Availability: Managing Farms of Distributed Servers ● September 22, 5:30pm-6:30pm in Imperial Ballroom B ● Scaling PHP Applications ● September 22, 10:00am-11:00am in Union Square Room ¾ ● MySQL Sharding, Replication, and HA ● September 21, 5:30-6:30pm in Imperial Ballroom B
  • 57. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.57 2013-09-21 References ● 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 ● Migrating From an Unsharded to a Sharded Setup ● http://vnwrites.blogspot.com/2013/09/mysqlfabric-sharding-migration.html
  • 58. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.58 2013-09-21 Mats Kindahl Twitter: @mkindahl Blog: http://mysqlmusings.blogspot.com Alfranio Correia Twitter: @alfranio Blog: http://alfranio-distributed.blogspot.com Narayanan Venkateswaran Twitter: @vn_tweets Blog: http://vnwrites.blogspot.com Keeping in Touch
  • 59. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.59 2013-09-21 Thank you!