MyRocks at Facebook and Roadmaps

Slides:



Advertisements
Similar presentations
Replication for Availability & Durability with MySQL and Amazon RDS Grant McAlister.
Advertisements

2 Proprietary & Confidential What is Sharding Benefits of Sharding Alternatives of Sharding When to start Sharding Agenda.
Faster Than Alter – Less Downtime Chris Schneider.
Amazon RDS (MySQL and Oracle) and SQL Azure Emil Tabakov Telerik Software Academy academy.telerik.com.
1 External Sorting Chapter Why Sort?  A classic problem in computer science!  Data requested in sorted order  e.g., find students in increasing.
Introduction to MySQL Administration.  Server startup and shutdown ◦ How to manually start and stop it from the command line ◦ How to arrange an automated.
Google Bigtable A Distributed Storage System for Structured Data Hadi Salimi, Distributed Systems Laboratory, School of Computer Engineering, Iran University.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos – A. Pavlo How to Scale a Database System.
Module 14: Scalability and High Availability. Overview Key high availability features available in Oracle and SQL Server Key scalability features available.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1 Preview of Oracle Database 12 c In-Memory Option Thomas Kyte
Replication with MySQL 5.1 Ligaya Turmelle Senior Technical Support Engineer - MySQL
Distributed Data Stores – Facebook Presented by Ben Gooding University of Arkansas – April 21, 2015.
Copyright © 2013 NetEase 马进 app DDB introduce.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
MySQL Would You Like Some Transactions With That Table?
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
Goodbye rows and tables, hello documents and collections.
MySQL. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn The main subsystems in MySQL architecture The different storage.
1 Moshe Shadmon ScaleDB Scaling MySQL in the Cloud.
Copyright 2006 MySQL AB The World’s Most Popular Open Source Database MySQL Cluster: An introduction Geert Vanderkelen MySQL AB.
Copyright 2002, Jeremy Zawodny MySQL Backup & Recovery O’Reilly Open Source Convention Jeremy Zawodny Yahoo! Finance July 24th, 2002.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
A Brief Documentation.  Provides basic information about connection, server, and client.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
NoSQL Or Peles. What is NoSQL A collection of various technologies meant to work around RDBMS limitations (mostly performance) Not much of a definition...
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
1 Backup and Replication Integration Techniques MySQL 6.0 Lars Thalmann, PhD Mats Kindahl, PhD Chuck Bell, PhD Replication and Backup Team Sun Microsystems.
Cassandra as Memcache Edward Capriolo Media6Degrees.com.
1 Build Your Own MySQL Time Machine Chuck Bell, PhD Mats Kindahl, PhD Replication and Backup Team Sun Microsystems 1.
DBMS ● What are they? ● Why used ● Examples? – Oracle – Access – MySQL – Postgres – SQLServer – Sqlite.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
1 Gaurav Kohli Xebia Breaking with DBMS and Dating with Relational Hbase.
Backups for Azure SQL Databases and SQL Server instances running on Azure Virtual Machines Session on backup to Azure feature (manual and managed) in SQL.
Would You Like Some Transactions With That Table?
Organizations Are Embracing New Opportunities
Lecture 2: Performance Evaluation
100% Exam Passing Guarantee & Money Back Assurance
Azure SQL Databases - Introduction and Migration
Advanced Topics in Concurrency and Reactive Programming: Case Study – Google Cluster Majeed Kassis.
CSCI5570 Large Scale Data Processing Systems
UFC #1433 In-Memory tables 2014 vs 2016
Learning MongoDB ZhangGang
Example of a page header
Planning an Effective Upgrade from SQL Server 2008
Data Warehouse in the Cloud – Marketing or Reality?
HPE Persistent Memory Microsoft Ignite 2017
The Client/Server Database Environment
Features of TMySQL/TSpider port into MariaDB
The Involuntary DBA Where there is Linux, you most likely will find MySQL or MariaDB. Like it or not, if you're working with Linux, you're a DBA.
MDEV Cross-Engine SQL Backup
Replication Updates on MariaDB 10.2/10.3
Azure SQL Data Warehouse Scaling: Configuration and Guidance
1Z0-888 Oracle - VCE Questions
The Google File System Sanjay Ghemawat, Howard Gobioff and Shun-Tak Leung Google Presented by Jiamin Huang EECS 582 – W16.
Uber How to Stream Data with StorageTapper
An Introduction to MyRocks
HashKV: Enabling Efficient Updates in KV Storage via Hashing
Arrested by the CAP Handling Data in Distributed Systems
SQL 2014 In-Memory OLTP What, Why, and How
Server & Tools Business
Microsoft Virtual Academy
Understanding Azure SQL DB Service Tiers
Cloud computing mechanisms
Sunil Agarwal | Principal Program Manager
Performance And Scalability In Oracle9i And SQL Server 2000
NoSQL databases An introduction and comparison between Mongodb and Mysql document store.
Moving your on-prem data warehouse to cloud. What are your options?
Working with Very Large Tables Like a Pro in SQL Server 2017
The Database World of Azure
QlikView for use with SAP Netweaver Version 5.8 New Features
Presentation transcript:

MyRocks at Facebook and Roadmaps Yoshinori Matsunobu Production Engineer, Facebook Nov 2017

Agenda MySQL at Facebook Production database migration from InnoDB to MyRocks MyRocks Development Roadmaps

“Main MySQL Database (UDB)” at Facebook Storing Social Graph Massively Sharded Low latency Automated Operations Pure Flash Storage Constrained by space, not by CPU/IOPS

What is MyRocks http://myrocks.io/ MySQL on top of RocksDB (RocksDB storage engine) Taking both LSM advantages and MySQL features LSM advantage: Smaller space and lower write amplification MySQL features: SQL, Replication, Connectors and many tools Open Source MySQL Clients SQL/Connector Parser Optimizer Replication etc InnoDB RocksDB MySQL http://myrocks.io/

MyRocks Initial Goal at Facebook InnoDB in UDB MyRocks in UDB 45% Space IO CPU Machine limit 15% 21% CPU IO Space Machine limit 90% 21% 15% 45% 20% 15%

Migration in Production Continuous data consistency check between InnoDB and MyRocks Shadow traffics tests Deployed on slaves Deployed on masters

Created first MyRocks instance without downtime Picking one of the InnoDB slave instances, then starting logical dump and restore Stopping one slave does not affect services Verified data consistency across InnoDB and MyRocks Master (InnoDB) Slave4 (MyRocks) Stop & Dump & Load Slave1 (InnoDB) Slave2 (InnoDB) Slave3 (InnoDB)

Creating second MyRocks instance without downtime Master (InnoDB) Slave4 (MyRocks) myrocks_hotbackup (Online binary backup) Slave1 (InnoDB) Slave2 (InnoDB) Slave3 (MyRocks)

Promoted MyRocks as a master Master (MyRocks) Slave1 (InnoDB) Slave2 (InnoDB) Slave3 (InnoDB) Slave4 (MyRocks)

Copied MyRocks everywhere Master (MyRocks) Slave1 (MyRocks) Slave2 (MyRocks) Slave3 (MyRocks) Slave4 (MyRocks)

Our current production status We COMPLETED InnoDB to MyRocks migration in UDB We saved 50% space in UDB compared to compressed InnoDB We started working on migrating other large database tiers

Important MyRocks/RocksDB Features Mem Comparable Keys CHAR/VARCHAR with latin1_bin |utf8_bin columns can be compared by single memcmp Fast Data Loading, deletes and replication Dynamic Options TTL

Faster Data Loading Normal Write Path in MyRocks/RocksDB Faster Write Path Write Requests Level max SST “SET SESSION rocksdb_bulk_load=1;” or “SET SESSION rocksdb_bulk_load_unsorted=1” Write Requests WAL MemTable Flush Level 0 SST Compaction Level 1 SST …. Compaction Level max SST

Development Roadmaps Matching read performance vs InnoDB https://smalldatum.blogspot.com Supporting Mixed Engines Better Replication Supporting “Bigger Small Data”

Mixed Engines Currently our production use case is either “MyRocks only” or “InnoDB only” instance There are several internal/external use cases that want to use InnoDB and MyRocks within the same instance, though single transaction does not overlap engines Online Backup support and benchmarks are major concerns Current plan is extending xtrabackup to integrate myrocks_hotbackup Considering to backporting gtid_pos_auto_engines

Better Replication Removing engine log Parallel replication apply Both internal and external benchmarks (e.g. Amazon, Alibaba) show that qps improves significantly with binlog disabled Real Problem would be two logs – binlog and engine log, which requires 2pc and ordered commits One Log - use one log as the source of truth for commits -- either binlog, binlog-like service or RocksDB WAL We heavily rely on binlogs (for semisync, binlog consumers), TBD is how much perf we gain by stopping writing to WAL Parallel replication apply Batching Skipping using transactions on slaves

Bigger Small Data (Bigger Instance Size) Problem Statement: Shared Nothing database is not general purpose database MySQL Cluster, Spider, Vitess Good if you have specific purposes. Might have issues if people lack of expertise about atomic transactions, joins and secondary keys Suggestion: Now we have 256GB+ RAM and 10TB+ Flash on commodity servers. Why not put everything there? Bigger instances may help general purpose small-mid applications They don’t have to worry about sharding. Atomic trans, joins and secondary keys just work e.g. Amazon Aurora (supporting up to 60TB instance) and Alibaba PolarDB (~100TB instance)

Features required to support Bigger Instance Parallel Query e.g. how to make mysqldump finish within 24 hours from 20TB table? Parallel binary copy e.g. how quickly can we create a 60TB replica instance in a remote region? Parallel DDL, Parallel Loading Resumable DDL e.g. if the DDL is expected to take 10 days, what will happen if mysqld restarts after 8 days? Better join algorithm Much faster replication Can handle 10x connection requests and queries Good resource control H/W perspective: Shared Storage and Elastic Computing Units Can scale read replicas from the same shared storage