SlideShare a Scribd company logo
Evan Elias
Velocity Europe 2011
Massively Sharded MySQL
Massively Sharded MySQL
Tumblrʼs Size and Growth
1 Year Ago Today
Impressions
Total Posts
Total Blogs
Developers
Sys Admins
Total Staff (FT)
3 Billion/month 15 Billion/month
1.5 Billion 12.5 Billion
9 Million 33 Million
3 17
1 5
13 55
Massively Sharded MySQL
• Machines dedicated to MySQL: over 175
• Thatʼs roughly how many production machines we had total a year ago
• Relational data on master databases: over 11 terabytes
• Unique rows: over 25 billion
Our databases and dataset
Massively Sharded MySQL
• Asynchronous
• Single-threaded SQL execution on slave
• Masters can have multiple slaves
• A slave can only have one master
• Can be hierarchical, but complicates failure-handling
• Keep two standby slaves per pool: one to promote when a master fails, and
the other to bring up additional slaves quickly
• Scales reads, not writes
MySQL Replication 101
Massively Sharded MySQL
• No other way to scale writes beyond the limits of one machine
• During peak insert times, youʼll likely start hitting lag on slaves before your
master shows a concurrency problem
Reason 1: Write scalability
Why Partition?
Massively Sharded MySQL
Reason 2: Data size
Why Partition?
• Working set wonʼt fit in RAM
• SSD performance drops as disk fills up
• Risk of completely full disk
• Operational difficulties: slow backups, longer to spin up new slaves
• Fault isolation: all of your data in one place = single point of failure affecting
all users
Massively Sharded MySQL
• Divide a table
• Horizontal Partitioning
• Vertical Partitioning
• Divide a dataset / schema
• Functional Partitioning
Types of Partitioning
Massively Sharded MySQL
Divide a table by relocating sets of rows
Horizontal Partitioning
• Some support internally by MySQL, allowing you to divide a table into several
files transparently, but with limitations
• Sharding is the implementation of horizontal partitioning outside of MySQL
(at the application level or service level). Each partition is a separate table.
They may be located in different database schemas and/or different instances
of MySQL.
Massively Sharded MySQL
Divide a table by relocating sets of columns
Vertical Partitioning
• Not supported internally by MySQL, though you can do it manually by
creating separate tables.
• Not recommended in most cases – if your data is already normalized, then
vertical partitioning introduces unnecessary joins
• If your partitions are on different MySQL instances, then youʼre doing these
“joins” in application code instead of in SQL
Massively Sharded MySQL
Divide a dataset by moving one or more tables
Functional Partitioning
• First eliminate all JOINs across tables in different partitions
• Move tables to new partitions (separate MySQL instances) using selective
dumping, followed by replication filters
• Often just a temporary solution. If the table eventually grows too large to fit on
a single machine, youʼll need to shard it anyway.
Massively Sharded MySQL
• Sharding is very complex, so itʼs best not to shard until itʼs obvious that you
will actually need to!
• Predict when you will hit write scalability issues — determine this on spare
hardware
• Predict when you will hit data size issues — calculate based on your growth
rate
• Functional partitioning can buy time
When to Shard
Massively Sharded MySQL
• Sharding key — a core column present (or derivable) in most tables.
• Sharding scheme — how you will group and home data (ranges vs hash vs
lookup table)
• How many shards to start with, or equivalently, how much data per shard
• Shard colocation — do shards coexist within a DB schema, a MySQL
instance, or a physical machine?
Sharding Decisions
Massively Sharded MySQL
Determining which shard a row lives on
Sharding Schemes
• Ranges: Easy to implement and trivial to add new shards, but requires
frequent and uneven rebalancing due to user behavior differences.
• Hash or modulus: Apply function on the sharding key to determine which
shard. Simple to implement, and distributes data evenly.  Incredibly difficult to
add new shards or rebalance existing ones.
• Lookup table: Highest flexibility, but impacts performance and adds a single
point of failure. Lookup table may eventually become too large.
Massively Sharded MySQL
• Sharding key must be available for all frequent look-up operations. For
example, canʼt efficiently look up posts by their own ID anymore, also need
blog ID to know which shard to hit.
• Support for read-only and offline shards. App code needs to gracefully handle
planned maintenance and unexpected failures.
• Support for reading and writing to different MySQL instances for the same
shard range — not for scaling reads, but for the rebalancing process
Application Requirements
Massively Sharded MySQL
• ID generation for PK of sharded tables
• Nice-to-have: Centralized service for handling common needs
• Querying multiple shards simultaneously
• Persistent connections
• Centralized failure handling
• Parsing SQL to determine which shard(s) to send a query to
Service Requirements
Massively Sharded MySQL
• Automation for adding and rebalancing shards, and sufficient monitoring to
know when each is necessary
• Nice-to-have: Support for multiple MySQL instances per machine — makes
cloning and replication setup simpler, and overhead isnʼt too bad
Operational Requirements
Massively Sharded MySQL
Option 1: Transitional migration with legacy DB
How to initially shard a table
• Choose a cutoff ID of the tableʼs PK (not the sharding key) which is slightly
higher than its current max ID. Once that cutoff has been reached, all new
rows get written to shards instead of legacy.
• Whenever a legacy row is updated by app, move it to a shard
• Migration script slowly saves old rows (at the app level) in the background,
moving them to shards, and gradually lowers cutoff ID
• Reads may need to check shards and legacy, but based on ID you can make
an informed choice of which to check first
Massively Sharded MySQL
Option 2: All at once
How to initially shard a table
1. Dark mode: app redundantly sends all writes (inserts, updates, deletes) to
legacy database as well as the appropriate shard. All reads still go to legacy
database.
2. Migration: script reads data from legacy DB (sweeping by the sharding
key) and writes it to the appropriate shard.
3. Finalize: move reads to shards, and then stop writing data to legacy.
Massively Sharded MySQL
Tumblrʼs custom automation software can:
Shard Automation
• Crawl replication topology for all shards
• Manipulate server settings or concurrently execute arbitrary UNIX
commands / administrative MySQL queries, on some or all shards
• Copy large files to multiple remote destinations efficiently
• Spin up multiple new slaves simultaneously from a single source
• Import or export arbitrary portions of the dataset
• Split a shard into N new shards
Massively Sharded MySQL
• Rebalance an overly-large shard by dividing it into N new shards, of even or
uneven size
• Speed
• No locks
• No application logic
• Divide a 800gb shard (hundreds of millions of rows) in two in only 5 hours
• Full read and write availability: shard-splitting process has no impact on live
application performance, functionality, or data consistency
Splitting shards: goals
Massively Sharded MySQL
• All tables using InnoDB
• All tables have an index that begins with your sharding key, and sharding scheme is range-based.
This plays nice with range queries in MySQL.
• No schema changes in process of split
• Disk is < 2/3 full, or thereʼs a second disk with sufficient space
• Keeping two standby slaves per shard pool (or more if multiple data centers)
• Uniform MySQL config between masters and slaves: log-slave-updates, unique server-id, generic log-
bin and relay-log names, replication user/grants everywhere
• No real slave lag, or already solved in app code
• Redundant rows temporarily on the wrong shard donʼt matter to app
Splitting shards: assumptions
Massively Sharded MySQL
Large “parent” shard divided into N “child” shards
Splitting shards: process
1. Create N new slaves in parent shard pool — these will soon become
masters of their own shard pools
2. Reduce the data set on those slaves so that each contains a different subset
of the data
3. Move app reads from the parent to the appropriate children
4. Move app writes from the parent to the appropriate children
5. Stop replicating writes from the parent; take the parent pool offline
6. Remove rows that replicated to the wrong child shard
Massively Sharded MySQL
Splitting shards: process
Large “parent” shard divided into N “child” shards
1. Create N new slaves in parent shard pool — these will soon become
masters of their own shard pools
2. Reduce the data set on those slaves so that each contains a different subset
of the data
3. Move app reads from the parent to the appropriate children
4. Move app writes from the parent to the appropriate children
5. Stop replicating writes from the parent; take the parent pool offline
6. Remove rows that replicated to the wrong child shard
Massively Sharded MySQL
Replication
R/W
Parent Master, blogs 1-1000,
all app reads/writes
Standby Slave Standby Slave
Massively Sharded MySQL
Clone Clone
Standby Slave
Replication
R/W
Parent Master, blogs 1-1000,
all app reads/writes
Standby Slave Standby Slave Standby Slave
Massively Sharded MySQL
To a single destination
Aside: copying files efficiently
• Our shard-split process relies on creating new slaves quickly, which involves
copying around very large data sets
• For compression we use pigz (parallel gzip), but there are other alternatives
like qpress
• Destination box: nc -l [port] | pigz -d | tar xvf -
• Source box: tar vc . | pigz | nc [destination hostname] [port]
Massively Sharded MySQL
To multiple destinations
Aside: copying files efficiently
• Add tee and a FIFO to the mix, and you can create a chained copy to multiple
destinations simultaneously
• Each box makes efficient use of CPU, memory, disk, uplink, downlink
• Performance penalty is only around 3% to 10% — much better than copying
serially or from copying in parallel from a single source
• http://engineering.tumblr.com/post/7658008285/efficiently-copying-files-to-
multiple-destinations
Massively Sharded MySQL
Splitting shards: process
Large “parent” shard divided into N “child” shards
1. Create N new slaves in parent shard pool — these will soon become
masters of their own shard pools
2. Reduce the data set on those slaves so that each contains a different subset
of the data
3. Move app reads from the parent to the appropriate children
4. Move app writes from the parent to the appropriate children
5. Stop replicating writes from the parent; take the parent pool offline
6. Remove rows that replicated to the wrong child shard
Massively Sharded MySQL
• Divide ID range into many chunks, and then execute export queries in
parallel. Likewise for import.
• Export via SELECT * FROM [table] WHERE [range clause] INTO
OUTFILE [file]
• Use mysqldump to export DROP TABLE / CREATE TABLE statements, and
then run those to get clean slate
• Import via LOAD DATA INFILE
Importing/exporting in chunks
Massively Sharded MySQL
• Disable binary logging before import, to speed it up
• Disable any query-killer scripts, or filter out SELECT ... INTO OUTFILE
and LOAD DATA INFILE
• Benchmark to figure out how many concurrent import/export queries can be
run on your hardware
• Be careful with disk I/O scheduler choices if using multiple disks with different
speeds
Importing/exporting gotchas
Massively Sharded MySQL
R/W
Parent Master, blogs 1-1000,
all app reads/writes
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Massively Sharded MySQL
R/W
Parent Master, blogs 1-1000,
all app reads/writes
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Child Shard
Master,
blogs 1-500
Child Shard
Master,
blogs 501-1000
Two slaves export different
halves of the dataset, drop
and recreate their tables,
and then import the data
Massively Sharded MySQL
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
R/W
Parent Master, blogs 1-1000,
all app reads/writes
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Child Shard
Master,
blogs 1-500
Child Shard
Master,
blogs 501-1000
Every pool needs two
standby slaves, so spin
them up for the child
shard pools
Massively Sharded MySQL
Splitting shards: process
Large “parent” shard divided into N “child” shards
1. Create N new slaves in parent shard pool — these will soon become
masters of their own shard pools
2. Reduce the data set on those slaves so that each contains a different subset
of the data
3. Move app reads from the parent to the appropriate children
4. Move app writes from the parent to the appropriate children
5. Stop replicating writes from the parent; take the parent pool offline
6. Remove rows that replicated to the wrong child shard
Massively Sharded MySQL
Moving reads and writes separately
• If configuration updates do not simultaneously reach all of your web/app
servers, this would create consistency issues if reads/writes moved at same
time
• Web A gets new config, writes post for blog 200 to 1st child shard
• Web B is still on old config, renders blog 200, reads from parent shard, doesnʼt find the new
post
• Instead only move reads first; let writes keep replicating from parent shard
• After first config update for reads, do a second one moving writes
• Then wait for parent master binlog to stop moving before proceeding
Massively Sharded MySQL
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
R/W
Parent Master, blogs 1-1000,
all app reads/writes
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Child Shard
Master,
blogs 1-500
Child Shard
Master,
blogs 501-1000
Massively Sharded MySQL
Reads now go to children
for appropriate queries to
these ranges
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
Parent Master, blogs 1-1000,
all app writes (which then
replicate to children)
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Child Shard
Master,
blogs 1-500
Child Shard
Master,
blogs 501-1000
W
RR
Massively Sharded MySQL
Splitting shards: process
Large “parent” shard divided into N “child” shards
1. Create N new slaves in parent shard pool — these will soon become
masters of their own shard pools
2. Reduce the data set on those slaves so that each contains a different subset
of the data
3. Move app reads from the parent to the appropriate children
4. Move app writes from the parent to the appropriate children
5. Stop replicating writes from the parent; take the parent pool offline
6. Remove rows that replicated to the wrong child shard
Massively Sharded MySQL
Reads now go to children
for appropriate queries to
these ranges
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
Parent Master, blogs 1-1000,
all app writes (which then
replicate to children)
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Child Shard
Master,
blogs 1-500
Child Shard
Master,
blogs 501-1000
W
RR
Massively Sharded MySQL
Reads and writes now go to
children for appropriate
queries to these ranges
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
Parent Master, blogs 1-1000,
no longer in use by app
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Child Shard
Master,
blogs 1-500
Child Shard
Master,
blogs 501-1000
R/W R/W
Massively Sharded MySQL
Splitting shards: process
Large “parent” shard divided into N “child” shards
1. Create N new slaves in parent shard pool — these will soon become
masters of their own shard pools
2. Reduce the data set on those slaves so that each contains a different subset
of the data
3. Move app reads from the parent to the appropriate children
4. Move app writes from the parent to the appropriate children
5. Stop replicating writes from the parent; take the parent pool offline
6. Remove rows that replicated to the wrong child shard
Massively Sharded MySQL
Reads and writes now go to
children for appropriate
queries to these ranges
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
Parent Master, blogs 1-1000,
no longer in use by app
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Child Shard
Master,
blogs 1-500
Child Shard
Master,
blogs 501-1000
R/W R/W
Massively Sharded MySQL
These are now complete
shards of their own
(but with some surplus data
that needs to be removed)
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
Parent Master, blogs 1-1000
Global read-only set
App user dropped
Standby Slave,
blogs 1-1000
Standby Slave,
blogs 1-1000
Shard
Master,
blogs 1-500
Shard
Master,
blogs 501-1000
R/W R/W
Massively Sharded MySQL
Standby Slaves
blogs 1-500
Standby Slaves
blogs 501-1000
Deprecated Parent Master, blogs 1-1000
Recycle soon
Standby Slave,
blogs 1-1000
Recycle soon
Shard
Master,
blogs 1-500
Shard
Master,
blogs 501-1000
R/W R/W
X X
X
Standby Slave,
blogs 1-1000
Recycle soon
These are now complete
shards of their own
(but with some surplus data
that needs to be removed)
Massively Sharded MySQL
Splitting shards: process
Large “parent” shard divided into N “child” shards
1. Create N new slaves in parent shard pool — these will soon become
masters of their own shard pools
2. Reduce the data set on those slaves so that each contains a different subset
of the data
3. Move app reads from the parent to the appropriate children
4. Move app writes from the parent to the appropriate children
5. Stop replicating writes from the parent; take the parent pool offline
6. Remove rows that replicated to the wrong child shard
Massively Sharded MySQL
• Until writes are moved to the new shard masters, writes to the parent shard
replicate to all its child shards
• Purge this data after shard split process is finished
• Avoid huge single DELETE statements — they cause slave lag, among other
issues (huge long transactions are generally bad)
• Data is sparse, so itʼs efficient to repeatedly do a SELECT (find next sharding
key value to clean) followed by a DELETE.
Splitting shards: cleanup
Massively Sharded MySQL
• Sizing shards properly: as small as you can operationally handle
• Choosing ranges: try to keep them even, and better if they end in 000ʼs than
999ʼs or, worse yet, random ugly numbers. This matters once shard naming is
based solely on the ranges.
• Cutover: regularly create new shards to handle future data. Take the max
value of your sharding key and add a cushion to it.
• Before: highest blog ID 31.8 million, last shard handles range [30m, ∞)
• After: that shard now handles [30m, 32m) and new last shard handles [32m, ∞)
General sharding gotchas
Massively Sharded MySQL
Email: evan -at- tumblr.com
Questions?

More Related Content

What's hot

Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentation
eraz
 
Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus
Ashnikbiz
 
Learn how zheap works
 Learn how zheap works Learn how zheap works
Learn how zheap works
EDB
 
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational DatabasesDesign Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databases
guestdfd1ec
 
What Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database ScalabilityWhat Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database Scalability
jbellis
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
zpinter
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
Bob Ward
 
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
SQL Server In-Memory OLTP: What Every SQL Professional Should KnowSQL Server In-Memory OLTP: What Every SQL Professional Should Know
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
Bob Ward
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera, Inc.
 
Avoid boring work_v2
Avoid boring work_v2Avoid boring work_v2
Avoid boring work_v2
Marcin Przepiórowski
 
NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
Tobias Lindaaker
 
SQL Server to Redshift Data Load Using SSIS
SQL Server to Redshift Data Load Using SSISSQL Server to Redshift Data Load Using SSIS
SQL Server to Redshift Data Load Using SSIS
Marc Leinbach
 
MongoDB
MongoDBMongoDB
MongoDB
fsbrooke
 
SQL Server It Just Runs Faster
SQL Server It Just Runs FasterSQL Server It Just Runs Faster
SQL Server It Just Runs Faster
Bob Ward
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptx
Ike Ellis
 
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
Etu Solution Day 2014 Track-D: 掌握Impala和SparkEtu Solution Day 2014 Track-D: 掌握Impala和Spark
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
James Chen
 
Incorta spark integration
Incorta spark integrationIncorta spark integration
Incorta spark integration
Dylan Wan
 
Oracle Database 12c - Features for Big Data
Oracle Database 12c - Features for Big DataOracle Database 12c - Features for Big Data
Oracle Database 12c - Features for Big Data
Abishek V S
 
Oracle 12c Parallel Execution New Features
Oracle 12c Parallel Execution New FeaturesOracle 12c Parallel Execution New Features
Oracle 12c Parallel Execution New Features
Randolf Geist
 
Breaking data
Breaking dataBreaking data
Breaking data
Terry Bunio
 

What's hot (20)

Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentation
 
Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus
 
Learn how zheap works
 Learn how zheap works Learn how zheap works
Learn how zheap works
 
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational DatabasesDesign Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databases
 
What Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database ScalabilityWhat Every Developer Should Know About Database Scalability
What Every Developer Should Know About Database Scalability
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
 
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
SQL Server In-Memory OLTP: What Every SQL Professional Should KnowSQL Server In-Memory OLTP: What Every SQL Professional Should Know
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
 
Avoid boring work_v2
Avoid boring work_v2Avoid boring work_v2
Avoid boring work_v2
 
NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
 
SQL Server to Redshift Data Load Using SSIS
SQL Server to Redshift Data Load Using SSISSQL Server to Redshift Data Load Using SSIS
SQL Server to Redshift Data Load Using SSIS
 
MongoDB
MongoDBMongoDB
MongoDB
 
SQL Server It Just Runs Faster
SQL Server It Just Runs FasterSQL Server It Just Runs Faster
SQL Server It Just Runs Faster
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptx
 
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
Etu Solution Day 2014 Track-D: 掌握Impala和SparkEtu Solution Day 2014 Track-D: 掌握Impala和Spark
Etu Solution Day 2014 Track-D: 掌握Impala和Spark
 
Incorta spark integration
Incorta spark integrationIncorta spark integration
Incorta spark integration
 
Oracle Database 12c - Features for Big Data
Oracle Database 12c - Features for Big DataOracle Database 12c - Features for Big Data
Oracle Database 12c - Features for Big Data
 
Oracle 12c Parallel Execution New Features
Oracle 12c Parallel Execution New FeaturesOracle 12c Parallel Execution New Features
Oracle 12c Parallel Execution New Features
 
Breaking data
Breaking dataBreaking data
Breaking data
 

Viewers also liked

Panduan solat sunat dan solat sunat istikarah
Panduan solat sunat dan solat sunat istikarahPanduan solat sunat dan solat sunat istikarah
Panduan solat sunat dan solat sunat istikarah
kriptonium
 
Joomla! security jday2015
Joomla! security jday2015Joomla! security jday2015
Joomla! security jday2015
kriptonium
 
Solat jamak dan qasar
Solat jamak dan qasarSolat jamak dan qasar
Solat jamak dan qasar
Khairul Anwar
 
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
Ulf Wendel
 
Doa, solat sunat dan zikir munajat
Doa, solat sunat dan zikir munajatDoa, solat sunat dan zikir munajat
Doa, solat sunat dan zikir munajat
Biskut Crackers
 
Keith - intro astro-Ecliptic Worksheet
Keith - intro astro-Ecliptic WorksheetKeith - intro astro-Ecliptic Worksheet
Keith - intro astro-Ecliptic Worksheet
Keith Spencer
 
ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016
ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016
ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016
Panayotis Sofianopoulos
 
amit
amitamit
رعاية أمهات التسمين - هبرد كلاسيك
رعاية أمهات التسمين - هبرد كلاسيك رعاية أمهات التسمين - هبرد كلاسيك
رعاية أمهات التسمين - هبرد كلاسيك
دكتور سيد صبحي - طبيب أمراض الدواجن
 
A234 a234m − 14
A234 a234m − 14A234 a234m − 14
A234 a234m − 14
Sameer Ahmed
 
ΠΟΛ. 1162/16
ΠΟΛ. 1162/16ΠΟΛ. 1162/16
ΠΟΛ. 1162/16
Panayotis Sofianopoulos
 
Cocina ayudas de diseño
Cocina ayudas de diseñoCocina ayudas de diseño
Cocina ayudas de diseño
Cynthia Lujan Pallin
 
Xinghuo - ultra slim led down light
Xinghuo - ultra slim led down lightXinghuo - ultra slim led down light
Xinghuo - ultra slim led down light
Nancy Xu
 
Appletree Presentation[1]
Appletree Presentation[1]Appletree Presentation[1]
Appletree Presentation[1]
Mary Beth Levin
 
Wat te spenderen.
Wat te spenderen.Wat te spenderen.
Wat te spenderen.
Patrick ten Bruggencate
 
Aprobación de la fusión voluntaria de los municipios de cerdedo y cotobade
Aprobación de la fusión voluntaria de los municipios de cerdedo y cotobadeAprobación de la fusión voluntaria de los municipios de cerdedo y cotobade
Aprobación de la fusión voluntaria de los municipios de cerdedo y cotobade
Daniel Nogueira Martínez
 
SmirnovGarciaFinalProject
SmirnovGarciaFinalProjectSmirnovGarciaFinalProject
SmirnovGarciaFinalProject
Denis Smirnov
 
ΔΕΑΦ 1160724 ΕΞ2016
ΔΕΑΦ 1160724 ΕΞ2016ΔΕΑΦ 1160724 ΕΞ2016
ΔΕΑΦ 1160724 ΕΞ2016
Panayotis Sofianopoulos
 
Marcon Presentation_01
Marcon Presentation_01Marcon Presentation_01
Marcon Presentation_01
Eric Robinson, CMRP
 

Viewers also liked (20)

Panduan solat sunat dan solat sunat istikarah
Panduan solat sunat dan solat sunat istikarahPanduan solat sunat dan solat sunat istikarah
Panduan solat sunat dan solat sunat istikarah
 
Joomla! security jday2015
Joomla! security jday2015Joomla! security jday2015
Joomla! security jday2015
 
Solat jamak dan qasar
Solat jamak dan qasarSolat jamak dan qasar
Solat jamak dan qasar
 
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
 
Doa, solat sunat dan zikir munajat
Doa, solat sunat dan zikir munajatDoa, solat sunat dan zikir munajat
Doa, solat sunat dan zikir munajat
 
Keith - intro astro-Ecliptic Worksheet
Keith - intro astro-Ecliptic WorksheetKeith - intro astro-Ecliptic Worksheet
Keith - intro astro-Ecliptic Worksheet
 
ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016
ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016
ΥΠ.ΟΙΚ. ΔΕΑΦ Β 1167345 ΕΞ2016
 
amit
amitamit
amit
 
sistemas
sistemas sistemas
sistemas
 
رعاية أمهات التسمين - هبرد كلاسيك
رعاية أمهات التسمين - هبرد كلاسيك رعاية أمهات التسمين - هبرد كلاسيك
رعاية أمهات التسمين - هبرد كلاسيك
 
A234 a234m − 14
A234 a234m − 14A234 a234m − 14
A234 a234m − 14
 
ΠΟΛ. 1162/16
ΠΟΛ. 1162/16ΠΟΛ. 1162/16
ΠΟΛ. 1162/16
 
Cocina ayudas de diseño
Cocina ayudas de diseñoCocina ayudas de diseño
Cocina ayudas de diseño
 
Xinghuo - ultra slim led down light
Xinghuo - ultra slim led down lightXinghuo - ultra slim led down light
Xinghuo - ultra slim led down light
 
Appletree Presentation[1]
Appletree Presentation[1]Appletree Presentation[1]
Appletree Presentation[1]
 
Wat te spenderen.
Wat te spenderen.Wat te spenderen.
Wat te spenderen.
 
Aprobación de la fusión voluntaria de los municipios de cerdedo y cotobade
Aprobación de la fusión voluntaria de los municipios de cerdedo y cotobadeAprobación de la fusión voluntaria de los municipios de cerdedo y cotobade
Aprobación de la fusión voluntaria de los municipios de cerdedo y cotobade
 
SmirnovGarciaFinalProject
SmirnovGarciaFinalProjectSmirnovGarciaFinalProject
SmirnovGarciaFinalProject
 
ΔΕΑΦ 1160724 ΕΞ2016
ΔΕΑΦ 1160724 ΕΞ2016ΔΕΑΦ 1160724 ΕΞ2016
ΔΕΑΦ 1160724 ΕΞ2016
 
Marcon Presentation_01
Marcon Presentation_01Marcon Presentation_01
Marcon Presentation_01
 

Similar to Massively sharded my sql at tumblr presentation

Evan Ellis "Tumblr. Massively Sharded MySQL"
Evan Ellis "Tumblr. Massively Sharded MySQL"Evan Ellis "Tumblr. Massively Sharded MySQL"
Evan Ellis "Tumblr. Massively Sharded MySQL"
Alexey Mahotkin
 
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase
 
Scaling MySQL Using Fabric
Scaling MySQL Using FabricScaling MySQL Using Fabric
Scaling MySQL Using Fabric
Remote MySQL DBA
 
Scaling MySQL using Fabric
Scaling MySQL using FabricScaling MySQL using Fabric
Scaling MySQL using Fabric
Karthik .P.R
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityNOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
Ivan Zoratti
 
BigData, NoSQL & ElasticSearch
BigData, NoSQL & ElasticSearchBigData, NoSQL & ElasticSearch
BigData, NoSQL & ElasticSearch
Sanura Hettiarachchi
 
MySQL NDB Cluster 8.0
MySQL NDB Cluster 8.0MySQL NDB Cluster 8.0
MySQL NDB Cluster 8.0
Ted Wennmark
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
Bogdan Kecman
 
Cassandra an overview
Cassandra an overviewCassandra an overview
Cassandra an overview
PritamKathar
 
M6d cassandrapresentation
M6d cassandrapresentationM6d cassandrapresentation
M6d cassandrapresentation
Edward Capriolo
 
Life After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data CloudLife After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data Cloud
OSCON Byrum
 
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Clustrix
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
elliando dias
 
One to Many: The Story of Sharding at Box
One to Many: The Story of Sharding at BoxOne to Many: The Story of Sharding at Box
One to Many: The Story of Sharding at Box
Florian Jourda
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
Marco Tusa
 
Where do I put this data? #lessql
Where do I put this data? #lessqlWhere do I put this data? #lessql
Where do I put this data? #lessql
Ezra Zygmuntowicz
 
Big Data Storage Concepts from the "Big Data concepts Technology and Architec...
Big Data Storage Concepts from the "Big Data concepts Technology and Architec...Big Data Storage Concepts from the "Big Data concepts Technology and Architec...
Big Data Storage Concepts from the "Big Data concepts Technology and Architec...
raghdooosh
 
Revision
RevisionRevision
Revision
David Sherlock
 
MySQL Multi Master Replication
MySQL Multi Master ReplicationMySQL Multi Master Replication
MySQL Multi Master Replication
Moshe Kaplan
 
MySQL Multi-Master Replication
MySQL Multi-Master ReplicationMySQL Multi-Master Replication
MySQL Multi-Master Replication
Michael Naumov
 

Similar to Massively sharded my sql at tumblr presentation (20)

Evan Ellis "Tumblr. Massively Sharded MySQL"
Evan Ellis "Tumblr. Massively Sharded MySQL"Evan Ellis "Tumblr. Massively Sharded MySQL"
Evan Ellis "Tumblr. Massively Sharded MySQL"
 
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
 
Scaling MySQL Using Fabric
Scaling MySQL Using FabricScaling MySQL Using Fabric
Scaling MySQL Using Fabric
 
Scaling MySQL using Fabric
Scaling MySQL using FabricScaling MySQL using Fabric
Scaling MySQL using Fabric
 
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More FlexibilityNOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
NOSQL Meets Relational - The MySQL Ecosystem Gains More Flexibility
 
BigData, NoSQL & ElasticSearch
BigData, NoSQL & ElasticSearchBigData, NoSQL & ElasticSearch
BigData, NoSQL & ElasticSearch
 
MySQL NDB Cluster 8.0
MySQL NDB Cluster 8.0MySQL NDB Cluster 8.0
MySQL NDB Cluster 8.0
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Cassandra an overview
Cassandra an overviewCassandra an overview
Cassandra an overview
 
M6d cassandrapresentation
M6d cassandrapresentationM6d cassandrapresentation
M6d cassandrapresentation
 
Life After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data CloudLife After Sharding: Monitoring and Management of a Complex Data Cloud
Life After Sharding: Monitoring and Management of a Complex Data Cloud
 
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
Tech Talk Series, Part 2: Why is sharding not smart to do in MySQL?
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
 
One to Many: The Story of Sharding at Box
One to Many: The Story of Sharding at BoxOne to Many: The Story of Sharding at Box
One to Many: The Story of Sharding at Box
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
 
Where do I put this data? #lessql
Where do I put this data? #lessqlWhere do I put this data? #lessql
Where do I put this data? #lessql
 
Big Data Storage Concepts from the "Big Data concepts Technology and Architec...
Big Data Storage Concepts from the "Big Data concepts Technology and Architec...Big Data Storage Concepts from the "Big Data concepts Technology and Architec...
Big Data Storage Concepts from the "Big Data concepts Technology and Architec...
 
Revision
RevisionRevision
Revision
 
MySQL Multi Master Replication
MySQL Multi Master ReplicationMySQL Multi Master Replication
MySQL Multi Master Replication
 
MySQL Multi-Master Replication
MySQL Multi-Master ReplicationMySQL Multi-Master Replication
MySQL Multi-Master Replication
 

Recently uploaded

7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
ukwwuq
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 

Recently uploaded (20)

7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 

Massively sharded my sql at tumblr presentation

  • 1. Evan Elias Velocity Europe 2011 Massively Sharded MySQL
  • 2. Massively Sharded MySQL Tumblrʼs Size and Growth 1 Year Ago Today Impressions Total Posts Total Blogs Developers Sys Admins Total Staff (FT) 3 Billion/month 15 Billion/month 1.5 Billion 12.5 Billion 9 Million 33 Million 3 17 1 5 13 55
  • 3. Massively Sharded MySQL • Machines dedicated to MySQL: over 175 • Thatʼs roughly how many production machines we had total a year ago • Relational data on master databases: over 11 terabytes • Unique rows: over 25 billion Our databases and dataset
  • 4. Massively Sharded MySQL • Asynchronous • Single-threaded SQL execution on slave • Masters can have multiple slaves • A slave can only have one master • Can be hierarchical, but complicates failure-handling • Keep two standby slaves per pool: one to promote when a master fails, and the other to bring up additional slaves quickly • Scales reads, not writes MySQL Replication 101
  • 5. Massively Sharded MySQL • No other way to scale writes beyond the limits of one machine • During peak insert times, youʼll likely start hitting lag on slaves before your master shows a concurrency problem Reason 1: Write scalability Why Partition?
  • 6. Massively Sharded MySQL Reason 2: Data size Why Partition? • Working set wonʼt fit in RAM • SSD performance drops as disk fills up • Risk of completely full disk • Operational difficulties: slow backups, longer to spin up new slaves • Fault isolation: all of your data in one place = single point of failure affecting all users
  • 7. Massively Sharded MySQL • Divide a table • Horizontal Partitioning • Vertical Partitioning • Divide a dataset / schema • Functional Partitioning Types of Partitioning
  • 8. Massively Sharded MySQL Divide a table by relocating sets of rows Horizontal Partitioning • Some support internally by MySQL, allowing you to divide a table into several files transparently, but with limitations • Sharding is the implementation of horizontal partitioning outside of MySQL (at the application level or service level). Each partition is a separate table. They may be located in different database schemas and/or different instances of MySQL.
  • 9. Massively Sharded MySQL Divide a table by relocating sets of columns Vertical Partitioning • Not supported internally by MySQL, though you can do it manually by creating separate tables. • Not recommended in most cases – if your data is already normalized, then vertical partitioning introduces unnecessary joins • If your partitions are on different MySQL instances, then youʼre doing these “joins” in application code instead of in SQL
  • 10. Massively Sharded MySQL Divide a dataset by moving one or more tables Functional Partitioning • First eliminate all JOINs across tables in different partitions • Move tables to new partitions (separate MySQL instances) using selective dumping, followed by replication filters • Often just a temporary solution. If the table eventually grows too large to fit on a single machine, youʼll need to shard it anyway.
  • 11. Massively Sharded MySQL • Sharding is very complex, so itʼs best not to shard until itʼs obvious that you will actually need to! • Predict when you will hit write scalability issues — determine this on spare hardware • Predict when you will hit data size issues — calculate based on your growth rate • Functional partitioning can buy time When to Shard
  • 12. Massively Sharded MySQL • Sharding key — a core column present (or derivable) in most tables. • Sharding scheme — how you will group and home data (ranges vs hash vs lookup table) • How many shards to start with, or equivalently, how much data per shard • Shard colocation — do shards coexist within a DB schema, a MySQL instance, or a physical machine? Sharding Decisions
  • 13. Massively Sharded MySQL Determining which shard a row lives on Sharding Schemes • Ranges: Easy to implement and trivial to add new shards, but requires frequent and uneven rebalancing due to user behavior differences. • Hash or modulus: Apply function on the sharding key to determine which shard. Simple to implement, and distributes data evenly.  Incredibly difficult to add new shards or rebalance existing ones. • Lookup table: Highest flexibility, but impacts performance and adds a single point of failure. Lookup table may eventually become too large.
  • 14. Massively Sharded MySQL • Sharding key must be available for all frequent look-up operations. For example, canʼt efficiently look up posts by their own ID anymore, also need blog ID to know which shard to hit. • Support for read-only and offline shards. App code needs to gracefully handle planned maintenance and unexpected failures. • Support for reading and writing to different MySQL instances for the same shard range — not for scaling reads, but for the rebalancing process Application Requirements
  • 15. Massively Sharded MySQL • ID generation for PK of sharded tables • Nice-to-have: Centralized service for handling common needs • Querying multiple shards simultaneously • Persistent connections • Centralized failure handling • Parsing SQL to determine which shard(s) to send a query to Service Requirements
  • 16. Massively Sharded MySQL • Automation for adding and rebalancing shards, and sufficient monitoring to know when each is necessary • Nice-to-have: Support for multiple MySQL instances per machine — makes cloning and replication setup simpler, and overhead isnʼt too bad Operational Requirements
  • 17. Massively Sharded MySQL Option 1: Transitional migration with legacy DB How to initially shard a table • Choose a cutoff ID of the tableʼs PK (not the sharding key) which is slightly higher than its current max ID. Once that cutoff has been reached, all new rows get written to shards instead of legacy. • Whenever a legacy row is updated by app, move it to a shard • Migration script slowly saves old rows (at the app level) in the background, moving them to shards, and gradually lowers cutoff ID • Reads may need to check shards and legacy, but based on ID you can make an informed choice of which to check first
  • 18. Massively Sharded MySQL Option 2: All at once How to initially shard a table 1. Dark mode: app redundantly sends all writes (inserts, updates, deletes) to legacy database as well as the appropriate shard. All reads still go to legacy database. 2. Migration: script reads data from legacy DB (sweeping by the sharding key) and writes it to the appropriate shard. 3. Finalize: move reads to shards, and then stop writing data to legacy.
  • 19. Massively Sharded MySQL Tumblrʼs custom automation software can: Shard Automation • Crawl replication topology for all shards • Manipulate server settings or concurrently execute arbitrary UNIX commands / administrative MySQL queries, on some or all shards • Copy large files to multiple remote destinations efficiently • Spin up multiple new slaves simultaneously from a single source • Import or export arbitrary portions of the dataset • Split a shard into N new shards
  • 20. Massively Sharded MySQL • Rebalance an overly-large shard by dividing it into N new shards, of even or uneven size • Speed • No locks • No application logic • Divide a 800gb shard (hundreds of millions of rows) in two in only 5 hours • Full read and write availability: shard-splitting process has no impact on live application performance, functionality, or data consistency Splitting shards: goals
  • 21. Massively Sharded MySQL • All tables using InnoDB • All tables have an index that begins with your sharding key, and sharding scheme is range-based. This plays nice with range queries in MySQL. • No schema changes in process of split • Disk is < 2/3 full, or thereʼs a second disk with sufficient space • Keeping two standby slaves per shard pool (or more if multiple data centers) • Uniform MySQL config between masters and slaves: log-slave-updates, unique server-id, generic log- bin and relay-log names, replication user/grants everywhere • No real slave lag, or already solved in app code • Redundant rows temporarily on the wrong shard donʼt matter to app Splitting shards: assumptions
  • 22. Massively Sharded MySQL Large “parent” shard divided into N “child” shards Splitting shards: process 1. Create N new slaves in parent shard pool — these will soon become masters of their own shard pools 2. Reduce the data set on those slaves so that each contains a different subset of the data 3. Move app reads from the parent to the appropriate children 4. Move app writes from the parent to the appropriate children 5. Stop replicating writes from the parent; take the parent pool offline 6. Remove rows that replicated to the wrong child shard
  • 23. Massively Sharded MySQL Splitting shards: process Large “parent” shard divided into N “child” shards 1. Create N new slaves in parent shard pool — these will soon become masters of their own shard pools 2. Reduce the data set on those slaves so that each contains a different subset of the data 3. Move app reads from the parent to the appropriate children 4. Move app writes from the parent to the appropriate children 5. Stop replicating writes from the parent; take the parent pool offline 6. Remove rows that replicated to the wrong child shard
  • 24. Massively Sharded MySQL Replication R/W Parent Master, blogs 1-1000, all app reads/writes Standby Slave Standby Slave
  • 25. Massively Sharded MySQL Clone Clone Standby Slave Replication R/W Parent Master, blogs 1-1000, all app reads/writes Standby Slave Standby Slave Standby Slave
  • 26. Massively Sharded MySQL To a single destination Aside: copying files efficiently • Our shard-split process relies on creating new slaves quickly, which involves copying around very large data sets • For compression we use pigz (parallel gzip), but there are other alternatives like qpress • Destination box: nc -l [port] | pigz -d | tar xvf - • Source box: tar vc . | pigz | nc [destination hostname] [port]
  • 27. Massively Sharded MySQL To multiple destinations Aside: copying files efficiently • Add tee and a FIFO to the mix, and you can create a chained copy to multiple destinations simultaneously • Each box makes efficient use of CPU, memory, disk, uplink, downlink • Performance penalty is only around 3% to 10% — much better than copying serially or from copying in parallel from a single source • http://engineering.tumblr.com/post/7658008285/efficiently-copying-files-to- multiple-destinations
  • 28. Massively Sharded MySQL Splitting shards: process Large “parent” shard divided into N “child” shards 1. Create N new slaves in parent shard pool — these will soon become masters of their own shard pools 2. Reduce the data set on those slaves so that each contains a different subset of the data 3. Move app reads from the parent to the appropriate children 4. Move app writes from the parent to the appropriate children 5. Stop replicating writes from the parent; take the parent pool offline 6. Remove rows that replicated to the wrong child shard
  • 29. Massively Sharded MySQL • Divide ID range into many chunks, and then execute export queries in parallel. Likewise for import. • Export via SELECT * FROM [table] WHERE [range clause] INTO OUTFILE [file] • Use mysqldump to export DROP TABLE / CREATE TABLE statements, and then run those to get clean slate • Import via LOAD DATA INFILE Importing/exporting in chunks
  • 30. Massively Sharded MySQL • Disable binary logging before import, to speed it up • Disable any query-killer scripts, or filter out SELECT ... INTO OUTFILE and LOAD DATA INFILE • Benchmark to figure out how many concurrent import/export queries can be run on your hardware • Be careful with disk I/O scheduler choices if using multiple disks with different speeds Importing/exporting gotchas
  • 31. Massively Sharded MySQL R/W Parent Master, blogs 1-1000, all app reads/writes Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000
  • 32. Massively Sharded MySQL R/W Parent Master, blogs 1-1000, all app reads/writes Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Child Shard Master, blogs 1-500 Child Shard Master, blogs 501-1000 Two slaves export different halves of the dataset, drop and recreate their tables, and then import the data
  • 33. Massively Sharded MySQL Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 R/W Parent Master, blogs 1-1000, all app reads/writes Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Child Shard Master, blogs 1-500 Child Shard Master, blogs 501-1000 Every pool needs two standby slaves, so spin them up for the child shard pools
  • 34. Massively Sharded MySQL Splitting shards: process Large “parent” shard divided into N “child” shards 1. Create N new slaves in parent shard pool — these will soon become masters of their own shard pools 2. Reduce the data set on those slaves so that each contains a different subset of the data 3. Move app reads from the parent to the appropriate children 4. Move app writes from the parent to the appropriate children 5. Stop replicating writes from the parent; take the parent pool offline 6. Remove rows that replicated to the wrong child shard
  • 35. Massively Sharded MySQL Moving reads and writes separately • If configuration updates do not simultaneously reach all of your web/app servers, this would create consistency issues if reads/writes moved at same time • Web A gets new config, writes post for blog 200 to 1st child shard • Web B is still on old config, renders blog 200, reads from parent shard, doesnʼt find the new post • Instead only move reads first; let writes keep replicating from parent shard • After first config update for reads, do a second one moving writes • Then wait for parent master binlog to stop moving before proceeding
  • 36. Massively Sharded MySQL Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 R/W Parent Master, blogs 1-1000, all app reads/writes Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Child Shard Master, blogs 1-500 Child Shard Master, blogs 501-1000
  • 37. Massively Sharded MySQL Reads now go to children for appropriate queries to these ranges Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 Parent Master, blogs 1-1000, all app writes (which then replicate to children) Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Child Shard Master, blogs 1-500 Child Shard Master, blogs 501-1000 W RR
  • 38. Massively Sharded MySQL Splitting shards: process Large “parent” shard divided into N “child” shards 1. Create N new slaves in parent shard pool — these will soon become masters of their own shard pools 2. Reduce the data set on those slaves so that each contains a different subset of the data 3. Move app reads from the parent to the appropriate children 4. Move app writes from the parent to the appropriate children 5. Stop replicating writes from the parent; take the parent pool offline 6. Remove rows that replicated to the wrong child shard
  • 39. Massively Sharded MySQL Reads now go to children for appropriate queries to these ranges Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 Parent Master, blogs 1-1000, all app writes (which then replicate to children) Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Child Shard Master, blogs 1-500 Child Shard Master, blogs 501-1000 W RR
  • 40. Massively Sharded MySQL Reads and writes now go to children for appropriate queries to these ranges Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 Parent Master, blogs 1-1000, no longer in use by app Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Child Shard Master, blogs 1-500 Child Shard Master, blogs 501-1000 R/W R/W
  • 41. Massively Sharded MySQL Splitting shards: process Large “parent” shard divided into N “child” shards 1. Create N new slaves in parent shard pool — these will soon become masters of their own shard pools 2. Reduce the data set on those slaves so that each contains a different subset of the data 3. Move app reads from the parent to the appropriate children 4. Move app writes from the parent to the appropriate children 5. Stop replicating writes from the parent; take the parent pool offline 6. Remove rows that replicated to the wrong child shard
  • 42. Massively Sharded MySQL Reads and writes now go to children for appropriate queries to these ranges Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 Parent Master, blogs 1-1000, no longer in use by app Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Child Shard Master, blogs 1-500 Child Shard Master, blogs 501-1000 R/W R/W
  • 43. Massively Sharded MySQL These are now complete shards of their own (but with some surplus data that needs to be removed) Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 Parent Master, blogs 1-1000 Global read-only set App user dropped Standby Slave, blogs 1-1000 Standby Slave, blogs 1-1000 Shard Master, blogs 1-500 Shard Master, blogs 501-1000 R/W R/W
  • 44. Massively Sharded MySQL Standby Slaves blogs 1-500 Standby Slaves blogs 501-1000 Deprecated Parent Master, blogs 1-1000 Recycle soon Standby Slave, blogs 1-1000 Recycle soon Shard Master, blogs 1-500 Shard Master, blogs 501-1000 R/W R/W X X X Standby Slave, blogs 1-1000 Recycle soon These are now complete shards of their own (but with some surplus data that needs to be removed)
  • 45. Massively Sharded MySQL Splitting shards: process Large “parent” shard divided into N “child” shards 1. Create N new slaves in parent shard pool — these will soon become masters of their own shard pools 2. Reduce the data set on those slaves so that each contains a different subset of the data 3. Move app reads from the parent to the appropriate children 4. Move app writes from the parent to the appropriate children 5. Stop replicating writes from the parent; take the parent pool offline 6. Remove rows that replicated to the wrong child shard
  • 46. Massively Sharded MySQL • Until writes are moved to the new shard masters, writes to the parent shard replicate to all its child shards • Purge this data after shard split process is finished • Avoid huge single DELETE statements — they cause slave lag, among other issues (huge long transactions are generally bad) • Data is sparse, so itʼs efficient to repeatedly do a SELECT (find next sharding key value to clean) followed by a DELETE. Splitting shards: cleanup
  • 47. Massively Sharded MySQL • Sizing shards properly: as small as you can operationally handle • Choosing ranges: try to keep them even, and better if they end in 000ʼs than 999ʼs or, worse yet, random ugly numbers. This matters once shard naming is based solely on the ranges. • Cutover: regularly create new shards to handle future data. Take the max value of your sharding key and add a cushion to it. • Before: highest blog ID 31.8 million, last shard handles range [30m, ∞) • After: that shard now handles [30m, 32m) and new last shard handles [32m, ∞) General sharding gotchas
  • 48. Massively Sharded MySQL Email: evan -at- tumblr.com Questions?