MySQL Replication Advanced Features In 20 minutes

Similar documents
MySQL High Availability

MySQL Replication. Rick Golba and Stephane Combaudon April 15, 2015

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

Percona XtraDB Cluster

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

Consistent Reads Using ProxySQL and GTID. Santa Clara, California April 23th 25th, 2018

Percona XtraDB Cluster MySQL Scaling and High Availability with PXC 5.7 Tibor Korocz

Using MySQL for Distributed Database Architectures

High availability with MariaDB TX: The definitive guide

MySQL High Availability Solutions. Alex Poritskiy Percona

The Hazards of Multi-writing in a Dual-Master Setup

What s New in MySQL and MongoDB Ecosystem Year 2017

Introduction to MySQL InnoDB Cluster

Mix n Match Async and Group Replication for Advanced Replication Setups. Pedro Gomes Software Engineer

The Exciting MySQL 5.7 Replication Enhancements

MySQL HA Solutions Selecting the best approach to protect access to your data

MySQL Group Replication & MySQL InnoDB Cluster

What s new in Percona Xtradb Cluster 5.6. Jay Janssen Lead Consultant February 5th, 2014

Percona XtraDB Cluster 5.7 Enhancements Performance, Security, and More

Everything You Need to Know About MySQL Group Replication

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8

How to make MySQL work with Raft. Diancheng Wang & Guangchao Bai Staff Database Alibaba Cloud

New Replication Features MySQL 5.1 and MySQL 6.0/5.4

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

Choosing a MySQL High Availability Solution. Marcos Albe, Percona Inc. Live Webinar June 2017

Which technology to choose in AWS?

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

Introduction To MySQL Replication. Kenny Gryp Percona Live Washington DC /

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

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

Why we re excited about MySQL 8

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

Riding the Binlog: an in Deep Dissection of the Replication Stream. Jean-François Gagné jeanfrancois DOT gagne AT booking.com

Kenny Gryp. Ramesh Sivaraman. MySQL Practice Manager. QA Engineer 2 / 60

MariaDB High Availability. MariaDB Training

2) One of the most common question clients asks is HOW the Replication works?

Geographically Dispersed Percona XtraDB Cluster Deployment. Marco (the Grinch) Tusa September 2017 Dublin

Various MySQL High Availability (HA) Solutions

MySQL Group Replication. Bogdan Kecman MySQL Principal Technical Engineer

Percona XtraDB Cluster ProxySQL. For your high availability and clustering needs

Lessons from database failures

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

Choosing a MySQL HA Solution Today

MySQL Replication: Latest Developments

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

MySQL Replication : advanced features in all flavours. Giuseppe Maxia Quality Assurance Architect at

MySQL Replication Update

Replication features of 2011

MySQL High Availability. Michael Messina Senior Managing Consultant, Rolta-AdvizeX /

MySQL 5.6 New Replication Features

MySQL Replication, the Community Sceptic Roundup. Giuseppe Maxia Quality Assurance Architect at

MySQL InnoDB Cluster. MySQL HA Made Easy! Miguel Araújo Senior Software Developer MySQL Middleware and Clients. FOSDEM 18 - February 04, 2018

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

G a l e r a C l u s t e r Schema Upgrades

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

PhxSQL: A High-Availability & Strong-Consistency MySQL Cluster. Ming

Percona XtraDB Cluster

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

FromDual Annual Company Meeting

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

MySQL: Scaling & High Availability

How Facebook Got Consistency with MySQL in the Cloud Sam Dunster

Galera in MariaDB 10.4 State of the Art and Plans

Jailbreaking MySQL Replication Featuring Tungsten Replicator. Robert Hodges, CEO, Continuent

Percona Software & Services Update

MySQL at Scale at Square

Percona Live Europe 2016 Use ProxySQL to Improve Your MySQL High Availability Solution

MySQL HA vs. HA. DOAG Konferenz 2016, Nürnberg. Oli Sennhauser. Senior MySQL Consultant, FromDual GmbH.

What's new in MySQL 5.5 and 5.6 replication

MySQL GTID Implementation, Maintenance, and Best Practices. Brian Cain (Dropbox) Gillian Gunson (GitHub) Mark Filipi (SurveyMonkey)

Migrating to XtraDB Cluster 2014 Edition

MySQL Multi-Site/Multi-Master Done Right

Binlog Servers at Booking.com. Jean-François Gagné jeanfrancois DOT gagne AT booking.com

Enterprise Open Source Databases

The MySQL Ecosystem - understanding it, not running away from it!

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 Cases with Apache Ignite. Peter Zaitsev, Denis Magda Santa Clara, California April 25th, 2017

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

Setting up Multi-Source Replication in MariaDB 10.0

Binlog Servers (and MySQL) at Booking.com. Jean-François Gagné jeanfrancois DOT gagne AT booking.com Presented at Percona Live Santa Clara 2015

Safe Harbor Statement

Percona Live Europe 2016 Use ProxySQL to Improve Your MySQL High Availability Solution Marco Tusa Manager Consulting Amsterdam, Netherlands October 3

State of the Dolphin Developing new Apps in MySQL 8

ShardProxy Replication-Manager. DataOps - Juin 2018 Kentoku SHIBA - Stephane VAROQUI

MySQL InnoDB Cluster. New Feature in MySQL >= Sergej Kurakin

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

MySQL Database Scalability

MySQL Multi-Source Replication

Percona Software & Services Update

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

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

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

MySQL Group Replication in a nutshell

Vitess on Kubernetes. followed by a demo of VReplication. Jiten Vaidya

Percona Software & Services Update

Exploring the replication in MongoDB. Date: Oct

The New Replication Features in MySQL 8. Luís Soares Principal Software Engineer, MySQL Replication Lead

High Availability Solutions for the MySQL Database

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

ProxySQL Tutorial. With a GPL license! High Performance & High Availability Proxy for MySQL. Santa Clara, California April 23th 25th, 2018

Transcription:

MySQL Replication Advanced Features In 20 minutes Peter Zaitsev, CEO FOSDEM, Brussels, Belgium February 2nd, 2019 1

Question #1 Who in this room is using some kind of MySQL Replication? 2

Question #2 Which Type of MySQL Replication do you use Classical MySQL Replication MySQL Group Replication Galera Replication (including Percona XtraDB Cluster) 3

Replication in MySQL A brief Time Line 4

MySQL Replication MySQL 3.23 MySQL 4.0 MySQL 5.1 MySQL 5.6 MySQL 5.7 Initial Statement Replication Implemented Split IO Thread and SQL Thread Row and Mixed replication modes supported Per Database Parallel Replication GTID Support General Parallel Replication Multi-Source Replication Group Replication / MySQL Innodb Cluster 5

Alternative Track Galera Based Replication Technology Similar to MySQL Group Replication but more mature Available for MySQL, Percona, MariaDB 6

Replication in MariaDB Is not 100% Same as in MySQL Different GTID Implementation Different parallel replication Not instrumented in the same way Number of features became available in MariaDB Earlier Not covering MariaDB in this Presentation 7

Advanced Replication 8

Basic Replication Topology 9

What is Basic Replication? Statement Replication Replication of the Full Database Using Binary Log Position Single Tier Topology Single Thread Asynchronous Write to Single Master Keep Slave Meta-Data Data in Files Master-Slave- Replication Manual Failover & Traffic Management 10

Statement vs Row Replication Configured on the Master as binlog_format STATEMENT ROW MIXED 11

How Rows are Logged? Full binlog_row_image Minimal Noblob 12

Missing Seeing Queries? Also Log Query For informational Purposes binlog_rows_query_log_events Off by Default 13

Replication of Full Database Full Replication Most Simple for Troubleshooting and Recovery Can replicate only portions of the database Can add additional data to the slaves 14

Replication Filering On the Master (writing binary log) Binlog_do_db Binlog_ignore_db On the Slave Replicate_do_db Replicate_ignore_db Replicate_wild_do_table Replicate_wild_ignore_table 15

Position Identification By Binary Log Position By GTID Position: 73 File: mysqlbin.000003 3E11FA47-71CA- 11E1-9E33- C80AA9429562:23 16

What is in GTID? GTID = source_id:transaction_id Source_id is Server_uuid of Originating Server Always Preserved on the Slaves Track which transactions executed mysql.gtid_executed table (5.7) + binlog 17

GTID Benefits and Drawbacks Automatic Position Discovery Easy Slave Promotion Discovery of Missed Transactions Pain in the Ass with Manual Troubleshooting 18

Replication Topologies Single Tier Master-Slave Bi-Directional Tree Ring Directed Graph 19

Options For Complicated Topologies Log_slave_updates Store copy of applied statements in local binlog Disabled by default until MySQL 8 20

Parallel Replication Single Thread Replication is typical limiting factor Parallel Replication for multiple Databases since 5.6 Parallel Replication for same table since 5.7 21

Managing Parallel Replication slave-parallel-workers slave-parallel-type=database LOGICAL_CLOCK slave_preserve_commit_order 22

Standard MySQL Replication - Asynchronous Data Persisted on the Master Eventually Transferred to the Slave After that Eventually Applied on the Slave Replication Lag is Unbound Data Loss can happen on Master Loss 23

Semi-Synchronous Replication in MySQL Plugin Required Both on Master and Slave Master Slave INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; 24

Semi-Sync Replication Options Master: rpl_semi_sync_master_enabled Master: rpl_semi_sync_master_timeout Master: rpl_semi_sync_master_wait_point=after_sync AFTER_COMMIT Master: rpl_semi_sync_master_wait_for_slave_count Slave: rpl_semi_sync_slave_enabled 25

MySQL Replication Active Multi-Master Recipe for problems with Async/SemiSync Replication Design Application to Avoid Conflicts MySQL Group Replication PXC/Galera Based Solutions 26

Multi-Master with MySQL Classic Replication auto_increment_offset auto_increment_increment slave_exec_mode=idempotent 27

Replication Position information Master_info_repository=FILE TABLE Relay_log_info_repository=FILE TABLE Sync_master_info Sync_relay_log_info Relay_log_recovery Less Problem with GTID Replication 28

Master Slave Replication? Most Commonly Used Variant MySQL Group Replication is other Option Percona XtraDB Cluster/Galera - Community Alternative 29

MySQL Group Replication Overview Inspired by Galera Ideas (and Success) Built on top of standard MySQL Replication Available as Plugin for MySQL 5.7 Considered GA, Very Actively Developed 30

Difference from MySQL Replication No Master/Slave but Group Membership Transactions are committed when they are certified by majority of nodes (Paxos) Does not accept writes if there is no Quorum Flow Control to prevent unlimited replication lag Nodes encountering inconsistency leave the cluster Conflict Detection and Resolution (or avoidance) Simple FailOver 31

MySQL Group Replication - Writes By Default configures itself as Single Primary Can configure to allow writes to any node 32

MySQL Group Replication Limitations No Automated node Provisioning Manual Recovery of nodes with network failure No way (yet) to ensure node does not read stale data 33

MySQL Innodb Cluster 34

Advanced Replication tools to Consider Automating Failover Read Write Splitting and Traffic Management Sharding Orchestrator ProxySQL Vitess 35

DATABASE PERFORMANCE Database Performance Matters MATTERS