To Shard or Not to Shard That is the question! Peter Zaitsev April 21, 2016

Similar documents
Architecture and Design of MySQL Powered Applications. Peter Zaitsev CEO, Percona Highload Moscow, Russia 31 Oct 2014

Accelerate MySQL for Demanding OLAP and OLTP Use Case with Apache Ignite December 7, 2016

Using MySQL for Distributed Database Architectures

Best Practices for MySQL Scalability. Peter Zaitsev, CEO, Percona Percona Technical Webinars May 1, 2013

MySQL In the Cloud. Migration, Best Practices, High Availability, Scaling. Peter Zaitsev CEO Los Angeles MySQL Meetup June 12 th, 2017.

What s New in MySQL and MongoDB Ecosystem Year 2017

Practical MySQL Performance Optimization. Peter Zaitsev, CEO, Percona July 02, 2015 Percona Technical Webinars

Accelerate MySQL for Demanding OLAP and OLTP Use Cases with Apache Ignite. Peter Zaitsev, Denis Magda Santa Clara, California April 25th, 2017

MySQL: Scaling & High Availability

MySQL Replication Options. Peter Zaitsev, CEO, Percona Moscow MySQL User Meetup Moscow,Russia

MySQL High Availability

How Percona Contributes to Open Source Database Ecosystem. Peter Zaitsev 5 October 2016

Practical MySQL Performance Optimization. Peter Zaitsev, CEO, Percona July 20 th, 2016 Percona Technical Webinars

DATABASE SCALE WITHOUT LIMITS ON AWS

MySQL Performance Optimization and Troubleshooting with PMM. Peter Zaitsev, CEO, Percona

Percona Software & Services Update

MySQL Performance Optimization and Troubleshooting with PMM. Peter Zaitsev, CEO, Percona Percona Technical Webinars 9 May 2018

SSD/Flash for Modern Databases. Peter Zaitsev, CEO, Percona November 1, 2014 Highload Moscow,Russia

InnoDB Scalability Limits. Peter Zaitsev, Vadim Tkachenko Percona Inc MySQL Users Conference 2008 April 14-17, 2008

Percona Software & Services Update

Percona XtraDB Cluster

MariaDB MaxScale 2.0, basis for a Two-speed IT architecture

Scaling Without Sharding. Baron Schwartz Percona Inc Surge 2010

Massive Scalability With InterSystems IRIS Data Platform

Compression in Open Source Databases. Peter Zaitsev April 20, 2016

A GridGain Systems In-Memory Computing White Paper

Percona Software & Services Update

Percona XtraDB Cluster 5.7 Enhancements Performance, Security, and More

MySQL 5.6: Advantages in a Nutshell. Peter Zaitsev, CEO, Percona Percona Technical Webinars March 6, 2013

Big Data Technology Ecosystem. Mark Burnette Pentaho Director Sales Engineering, Hitachi Vantara

Improvements in MySQL 5.5 and 5.6. Peter Zaitsev Percona Live NYC May 26,2011

SSD/Flash for Modern Databases. Peter Zaitsev, CEO, Percona October 08, 2014 Percona Technical Webinars

Upgrading MySQL Best Practices. Apr 11-14, 2011 MySQL Conference and Expo Santa Clara,CA by Peter Zaitsev, Percona Inc

<Insert Picture Here> MySQL Web Reference Architectures Building Massively Scalable Web Infrastructure

MySQL 5.7 For Operational DBAs an Introduction. Peter Zaitsev, CEO, Percona February 16, 2016 Percona Technical Webinars

Beyond MySQL 5.1 What is happening in MySQL Space. Feb 16, 2011 Percona Live San Francisco,CA by Peter Zaitsev, Percona Inc

Bring Context To Your Machine Data With Hadoop, RDBMS & Splunk

Percona Server for MySQL 8.0 Walkthrough

MyRocks deployment at Facebook and Roadmaps. Yoshinori Matsunobu Production Engineer / MySQL Tech Lead, Facebook Feb/2018, #FOSDEM #mysqldevroom

Enterprise Open Source Databases

CIB Session 12th NoSQL Databases Structures

New Oracle NoSQL Database APIs that Speed Insertion and Retrieval

Scaling Applications with Caching Sharding and Replication

Innodb Performance Optimization

Performance Test Results for ScaleArc for MySQL on Aurora RDS Nov ScaleArc. All Rights Reserved. 1

Matthias Wobben working in Berlin, Germany. Senior Sales Engineer at Nextcloud

MariaDB MaxScale 2.0 and ColumnStore 1.0 for the Boston MySQL Meetup Group Jon Day, Solution Architect - MariaDB

DEMYSTIFYING BIG DATA WITH RIAK USE CASES. Martin Schneider Basho Technologies!

TWOO.COM CASE STUDY CUSTOMER SUCCESS STORY

MariaDB 10.3 vs MySQL 8.0. Tyler Duzan, Product Manager Percona

Choosing Storage for MySQL. Peter Zaitsev CEO, Percona Inc Percona Live, Washington,DC 11 January 2012

Design Patterns for Large- Scale Data Management. Robert Hodges OSCON 2013

Redis as a Reliable Work Queue. Percona University

Achieving Horizontal Scalability. Alain Houf Sales Engineer

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Choosing Hardware and Operating Systems for MySQL. Apr 15, 2009 O'Reilly MySQL Conference and Expo Santa Clara,CA by Peter Zaitsev, Percona Inc

MySQL usage of web applications from 1 user to 100 million. Peter Boros RAMP conference 2013

Highly Available Database Architectures in AWS. Santa Clara, California April 23th 25th, 2018 Mike Benshoof, Technical Account Manager, Percona

MySQL Replication: What's New In MySQL 5.7 and MySQL 8. Luís Soares Software Development Director MySQL Replication

Accelerate Database Performance and Reduce Response Times in MongoDB Humongous Environments with the LSI Nytro MegaRAID Flash Accelerator Card

Architekturen für die Cloud

Five Common Myths About Scaling MySQL

Open Source Database Ecosystem in Peter Zaitsev 3 October 2016

Case Study. Performance Optimization & OMS Brainvire Infotech Pvt. Ltd Page 1 of 1

New Data Architectures For Netflow Analytics NANOG 74. Fangjin Yang - Imply

Private Cloud Database Consolidation Name, Title

Data-Intensive Distributed Computing

Scaling for Humongous amounts of data with MongoDB

SCYLLA: NoSQL at Ludicrous Speed. 主讲人 :ScyllaDB 软件工程师贺俊

Crescando: Predictable Performance for Unpredictable Workloads

Datasheet FUJITSU Software Cloud Monitoring Manager V2.0

MySQL Cluster Ed 2. Duration: 4 Days

Performance and Scalability Overview

CIS 601 Graduate Seminar. Dr. Sunnie S. Chung Dhruv Patel ( ) Kalpesh Sharma ( )

Conceptual Modeling on Tencent s Distributed Database Systems. Pan Anqun, Wang Xiaoyu, Li Haixiang Tencent Inc.

MySQL Replication Advanced Features In 20 minutes

Evolution of Big Data Facebook. Architecture Summit, Shenzhen, August 2012 Ashish Thusoo

Performance improvements in MySQL 5.5

Scaling with mongodb

@unterstein #bedcon. Operating microservices with Apache Mesos and DC/OS

Chapter 5. The MapReduce Programming Model and Implementation

MySQL Database Scalability

MySQL High Availability Solutions. Alex Poritskiy Percona

Total Cost of Ownership: Database Software and Support

Tungsten Replicator for Kafka, Elasticsearch, Cassandra

Jargons, Concepts, Scope and Systems. Key Value Stores, Document Stores, Extensible Record Stores. Overview of different scalable relational systems

Amazon s Database Migration Service, a magical wand for moving from closed source solutions? Dimitri Vanoverbeke Solution Percona

NOSQL DATABASE SYSTEMS: DECISION GUIDANCE AND TRENDS. Big Data Technologies: NoSQL DBMS (Decision Guidance) - SoSe

ScaleArc Performance Benchmarking with sysbench

Scaling Pinterest. Marty Weiner Level 83 Interwebz Geek

Big Data Architect.

Aurora, RDS, or On-Prem, Which is right for you

Beyond Relational Databases: MongoDB, Redis & ClickHouse. Marcos Albe - Principal Support Percona

10 Million Smart Meter Data with Apache HBase

Migrating to Aurora MySQL and Monitoring with PMM. Percona Technical Webinars August 1, 2018

MongoDB and Mysql: Which one is a better fit for me? Room 204-2:20PM-3:10PM

CISC 7610 Lecture 2b The beginnings of NoSQL

IBM Db2 Event Store Simplifying and Accelerating Storage and Analysis of Fast Data. IBM Db2 Event Store

HA solution with PXC-5.7 with ProxySQL. Ramesh Sivaraman Krunal Bauskar

Hadoop 2.x Core: YARN, Tez, and Spark. Hortonworks Inc All Rights Reserved

Transcription:

To Shard or Not to Shard That is the question! Peter Zaitsev April 21, 2016

Story Let s start with the story 2

First things to decide Before you decide how to shard you d best understand whether or not you really need to shard 3

Modern Technology Can go much further without sharding 4

Single MySQL Can Do 100K+ queries per second 100K+ rows inserted/updated/deleted per second 5M+ rows scanned per second 10K+ concurrent connections 10TB+ data size 5

MySQL 5.7 Performance Improvements Sysbench Benchmark Starts with 8 Threads What about 2-4 threads? 6 *Information from Oracle OpenWorld presentation by Geir Hoydalsvik

Let s do some math 3M daily active users 30 interactions per user per day 10 queries per interaction 3x peak versus average use 7

How many QPS would it be? 31250 Queries/sec 8

Avoided Sharding Enterprise with 200K+ employees Internal Drupal Installation E-commerce merchant with $10M+ sales per month 9

Sharding = Pain It is painful! Though you may have gotten used to it. 10

Sharding Pains Developer Complexity Operational Complexity Technology Complexity Complex Failures Complex Performance Profile 11

MySQL Sharding Especially painful 12

Can t Avoid? Delay! 13

Strategies to Delay Sharding Architecture Functional Partitioning Replication Caching Queuing Supplemental Technologies 14

Architecture Building up from small blocks Each owning its data Microservices 15

Functional Partitioning Keep separate data separate 16

Replication Scale reads Beware they are asynchronous Consider Percona XtraDB Cluster 17

Caching Scale Reads Query Cache Application Server Cache Memcache/Redis Summary Tables HTTP Cache 18

Queueing Scale Writes Balance Demand Spikes Batch Work Redis RabbitMQ ActiveMQ Kafka 19

Beyond MySQL Analytics Hadoop Vertica Spark Full Text Search ElasticSearch Sphinx Solr Document Store MongoDB CouchBase RethinkDB 20

Optimize! Do simple optimizations before you decide to shard 21

Hardware Fast CPUs Plenty of memory Fast flash storage Good network (keep it close) 22

Environment Linux is the most common OS New MySQL versions scale better Use a recent GA version (MySQL 5.7 ) Consider Percona Server and PXC 23

Configuration Configure MySQL Server Properly http://bit.ly/1j8ljad What storage engine is right for you? Consider TokuDB for high compression 24

Sharding When? Too early Waste resources Too late Run into the wall 25

Architectural Runway Sharding is architecture consideration Make it part of your architecture runway planning How long would it take you to implement Sharding? 26

Capacity Planning Know where your wall is! Be conservative in your estimates! Do not plan for linear scalability! 27

Benefits of Sharding Yes there are! 28

Ultimate Scalability The only way to scale to Facebook Scale 29

Avoid other complexities Complex caching layer Asynchronous replication for scaling 30

Isolation Security Compliance Keeping data close to user 31

Costs Can use lower power systems Especially important in the cloud 32

When to Shard Summary Easy in your case Think development and operations Scaling up is impossible or too expensive Your application grow making sharding imminent Enterprise? Cloud? Other optimizations give too short of a runway to care 33

Sharding Questions Sharding Level Sharding Key Sharding Unit Sharding HA Sharding Technology 34

Sharding Level Database Level? Deployment Unit Level? 35

Sharding Key(s) Most small accesses go to single shard No shard is too large in terms of data or load May double-store date with different sharding keys if needed 36

Sharding Unit Shard = Physical MySQL Instance Shard = Schema Multiple Shards Per Schema/Table 37

Sharding HA Many Servers = higher chance of failure Sharding Increases need for HA Sharding over Master-Slave Clusters Sharding over PXC Clusters 38

Sharding Technology Roll-your-own Vitess Jetpants Shard-Query Clustrix MySQL Cluster 39

Sharding Technology MySQL Fabric Tesora Database Virtualization Engine ScaleArc Official solution from MySQL team at Oracle (Open Source) Automated Open Source Rule Based Commercial MariaDB MaxScale Basic Routing 40

In Summary There are multiple technologies for Sharding There is no standard solution used across the board 41

Thank you! pz@percona.com https://www.linkedin.com/in/peterzaitsev https://twitter.com/peterzaitsev 42