Scaling Without Sharding. Baron Schwartz Percona Inc Surge 2010

Similar documents
MySQL Performance Improvements

MySQL Database Scalability

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

Distributed Computation Models

Using MySQL for Distributed Database Architectures

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

Scalability of web applications

Massive Scalability With InterSystems IRIS Data Platform

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

MySQL High Availability

CISC 7610 Lecture 5 Distributed multimedia databases. Topics: Scaling up vs out Replication Partitioning CAP Theorem NoSQL NewSQL

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

VOLTDB + HP VERTICA. page

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

Which technology to choose in AWS?

Scaling MongoDB. Percona Webinar - Wed October 18th 11:00 AM PDT Adamo Tonete MongoDB Senior Service Technical Service Engineer.

Architekturen für die Cloud

MongoDB Schema Design for. David Murphy MongoDB Practice Manager - Percona

ScaleArc Performance Benchmarking with sysbench

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

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

Forecasting MySQL Scalability. Baron Schwartz O'Reilly MySQL Conference & Expo 2011

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

The Google File System

Architecting & Tuning IIB / extreme Scale for Maximum Performance and Reliability

CPS 512 midterm exam #1, 10/7/2016

Real World Web Scalability. Ask Bjørn Hansen Develooper LLC

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

Running MySQL on AWS. Michael Coburn Wednesday, April 15th, 2015

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

Warehouse-Scale Computing

Part 1: Indexes for Big Data

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

How To Rock with MyRocks. Vadim Tkachenko CTO, Percona Webinar, Jan

Bringing code to the data: from MySQL to RocksDB for high volume searches

The Google File System

High-Performance Distributed DBMS for Analytics

Can "scale" cloud applications "on the edge" by adding server instances. (So far, haven't considered scaling the interior of the cloud).

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

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

Design of Parallel Algorithms. Course Introduction

Performance and Scalability with Griddable.io

CS252 S05. CMSC 411 Computer Systems Architecture Lecture 18 Storage Systems 2. I/O performance measures. I/O performance measures

(Refer Slide Time: 01:25)

Migrating Oracle Databases To Cassandra

Innodb Performance Optimization

CS 61C: Great Ideas in Computer Architecture. MapReduce

Best Practices for Database Administrators

Lecture 21 11/27/2017 Next Lecture: Quiz review & project meetings Streaming & Apache Kafka

4 Chip Multiprocessors (I) Chip Multiprocessors (ACS MPhil) Robert Mullins

4 Myths about in-memory databases busted

Exadata Implementation Strategy

Choosing a MySQL HA Solution Today. Choosing the best solution among a myriad of options

Indexing Large-Scale Data

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

Be Fast, Cheap and in Control with SwitchKV. Xiaozhou Li

CLOUD-SCALE FILE SYSTEMS

Fusion iomemory PCIe Solutions from SanDisk and Sqrll make Accumulo Hypersonic

Secrets of PostgreSQL Performance. Frank Wiles Revolution Systems

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

Scaling App Engine Applications. Justin Haugh, Guido van Rossum May 10, 2011

Scaling with mongodb

Large-Scale Web Applications

Building High Performance Apps using NoSQL. Swami Sivasubramanian General Manager, AWS NoSQL

Cost-Effective Virtual Petabytes Storage Pools using MARS. FrOSCon 2017 Presentation by Thomas Schöbel-Theuer

Next-Generation Cloud Platform

ProxySQL - GTID Consistent Reads. Adaptive query routing based on GTID tracking

Architectural Support for Operating Systems

Next Generation Architecture for NVM Express SSD

It also performs many parallelization operations like, data loading and query processing.

Distributed File Systems II

Megastore: Providing Scalable, Highly Available Storage for Interactive Services & Spanner: Google s Globally- Distributed Database.

CISC 7610 Lecture 2b The beginnings of NoSQL

There And Back Again

Achieving Horizontal Scalability. Alain Houf Sales Engineer

Percona XtraDB Cluster powered by Galera. Peter Zaitsev CEO, Percona Slide Credits: Vadim Tkachenko Percona University, Washington,DC Sep 12,2013

Practical MySQL indexing guidelines

EVCache: Lowering Costs for a Low Latency Cache with RocksDB. Scott Mansfield Vu Nguyen EVCache

RocksDB Key-Value Store Optimized For Flash

Ambry: LinkedIn s Scalable Geo- Distributed Object Store

NewSQL Without Compromise

Performance improvements in MySQL 5.5

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

Introduction to Distributed Data Systems

Building a Scalable Architecture for Web Apps - Part I (Lessons Directi)

GFS: The Google File System. Dr. Yingwu Zhu

Elasticsearch Scalability and Performance

Life as a Service. Scalability and Other Aspects. Dino Esposito JetBrains ARCHITECT, TRAINER AND CONSULTANT

Delegates must have a working knowledge of MariaDB or MySQL Database Administration.

NoSQL Databases Analysis

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

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

Aerospike Scales with Google Cloud Platform

Increasing Performance of Existing Oracle RAC up to 10X

Today: World Wide Web! Traditional Web-Based Systems!

Write On Aws. Aws Tools For Windows Powershell User Guide using the aws tools for windows powershell (p. 19) this section includes information about

MySQL 101. Designing effective schema for InnoDB. Yves Trudeau April 2015

Amazon Aurora Relational databases reimagined.

02 - Distributed Systems

Performance comparisons and trade-offs for various MySQL replication schemes

Transcription:

Scaling Without Sharding Baron Schwartz Percona Inc Surge 2010

Web Scale!!!! http://www.xtranormal.com/watch/6995033/

A Sharding Thought Experiment 64 shards per proxy [1] 1 TB of data storage per node Including room for compaction, nodes need 2 TB of disk With a single proxy, maximum 64 TB of data 128 or perhaps 192 server nodes, depending on the level of redundancy required by the system Continued on the next slide... [1] This thought experiment is quoted almost word-for-word from a recently published book on a specific database, which I will not mention because it doesn't matter. The thought process is what is interesting for this discussion.

Going to Web Scale Basic arithmetic: with three layers of proxies 262 petabytes on thousands of machines. Conservative estimate: latency per layer ~100ms Overall response times of 300 ms Even without performance tuning! We should be able to manage queries over exabyte datasets in less than a second. Now, what's wrong with this theoretical process of scaling to handle exabyte datasets?

Web-Scale Reality 192 ^ 4 = 1,358,954,496 servers [1] [1] My hasty math was wrong when I gave this talk. It should be (64^4)*3, which is more than 50 million servers. Note to self: check the math more carefully.

Web-Scale Reality

Beating the Dead Horse Remember, 1TB... nodes need 2 TB of disk So for 1 exabyte of storage, we need 1 exabyte of idle storage. That's roughly 40 megawatts of idle storage. Surely there is a better way to architect this system? Many other things are questionable. Network bandwidth at upper-level proxies? Is the estimated latency really achievable? And so on. Some solvable, some not.

Shard Early, Shard Often? Where are we today? Really?

Sharding was required when... MySQL 5.0 with InnoDB that couldn't scale. SSDs were only seen in Popular Mechanics.

What is Scaling?

What is Scaling? The ability to do more of X while ensuring that Y is acceptable The ability to add capacity to a system.

3 Fundamental Techniques Add more capacity to do X Make the system do X faster Stop doing so much X

In other words, scaling is...

Scaling is about performance.

Performance Is... Response time (time per task) Throughput (tasks per time)

Digression! The art of optimizing performance TM 1)Measure [1] where X spends its time 2)Reduce time consumption [1] cf. Neil Gunther: All measurements are wrong by definition.

Scaling Directions Scale-out -vs- Scale-up

Scaling Directions Scale-out -vs- Scale-up is not very helpful. Understanding the whole application is helpful.

Let's think about the whole application.

What makes scaling easy? If scaling is about performance, and Performance is about tasks and time, then Generally, what makes a task consume time? It is utilizing a resource. It is waiting for a response. It is waiting for synchronization. What do these activities have in common?

Scaling is easy when... Components are decoupled from each other. Components are stateless. Components operate asynchronously.

App Servers are Easy to Scale App servers are easy to scale because they: Are usually decoupled. Delegate inter-request statefulness. Delegate inter-process synchronization. This means that...

Delegation is Key App servers are easy to scale because of delegation. Generally, app servers delegate their writes. They have to delegate this work somewhere. Database servers are usually on the receiving end.

ACID Database Servers Are... Stateful Synchronous (Internally) centralized, i.e. not decoupled Therefore, Hard to optimize for performance Hard to scale

Now, how about scaling? So much for motivating the discussion How do we actually scale something? Anything?

Back to performance Scalability = Performance = Tasks and Time Two fundamental tasks to perform with data: Read Write Each presents different opportunities.

The Nature of Reads Reads are inherently synchronous. Reads are cachable. Reads can be combined. Reads require 100% of necessary resources. Reads can be done anywhere the data is.

The Nature of Writes Writes can be asynchronous (fire-and-forget). Writes can be buffered (delegated/queued). Writes can be combined. Writes can be done with partial resources. Writes must be done everywhere the data is.

Two Fundamental Patterns Get more out of one server Advantages: too many to mention Disadvantages:??? Use multiple servers Advantages: when one server isn't enough Disadvantages: too many to mention

Single Server Method #1 Add more resources. Storage (Disk, RAM) CPU Communication (Network, Bus) This is hard in the cloud. Most (non-cloud) deployments can go very far

Single Server Method #2 Avoid using slow resources Disk (yes, even SSD) Primarily, this means fit the working set in RAM Archiving, purging Locality of hot data Summarizing Compression Choice of data types Schema design and physical layout Clustered indexes

When One Isn't Enough When demand exceeds resources... What kind of demand? Writes? Reads? Options: Duplication: Make multiple copies of the data Sharding: Partition the data

Strategy: Duplicated Data Caching Indexes Replication CDNs Materialized views

Strategy: Duplicated Data Useful for increasing read capacity Because reads can be done anywhere the data is.

Strategy: Duplicated Data Hard problems: Expiring stale data Knowing whether data is consistent Updating the copies when the master copy changes Drawback: Each copy consumes resources Hard to exploit locality of reference Works best when application is mostly reads Because writes must be done everywhere

Strategy: Sharding Sharding should be your last resort. Forced when write demand exceeds capacity. Not as much of a problem as it used to be. SSDs change things somewhat. But: MySQL replication is single-threaded. Replica can't keep up with the primary. Cloud platforms don't have SSD performance.

Avoiding Sharding Buffer writes. Buffering permits write-combining (click counting?) Lets the caller fire-and-forget (queue). Pre-process writes. Don't store and aggregate in the database. Store outside the database, aggregate, then load in. Aggregate on a replica, load results to the primary. Combine pushing and pulling. Push (synchronous) to a buffer or queue. Asynchronously pull and process.

Avoiding Sharding Combine buffering with caching Send the changes to a buffer or queue Duplicate the changes to the cache Hit the cache on reads Delay full updates Just log the change instead of performing it Later, process the result, doing 100% of the work Hit the hot data last Avoid the contended data until the last minute Then modify it and commit ASAP

Questions & Comments <first name>@percona.com