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

Similar documents
MySQL High Availability

Using MySQL for Distributed Database Architectures

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

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

Percona XtraDB Cluster 5.7 Enhancements Performance, Security, and More

Percona XtraDB Cluster

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

What s New in MySQL and MongoDB Ecosystem Year 2017

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

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

Which technology to choose in AWS?

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

MySQL Replication Advanced Features In 20 minutes

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

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

MySQL High Availability Solutions. Alex Poritskiy Percona

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

Migrating to XtraDB Cluster 2014 Edition

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

FromDual Annual Company Meeting

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

MySQL Database Scalability

Introduction to MySQL InnoDB Cluster

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

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

Choosing a MySQL HA Solution Today

High Availability Solutions for the MySQL Database

Various MySQL High Availability (HA) Solutions

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

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

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

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

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

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

Percona Software & Services Update

Future-Proofing MySQL for the Worldwide Data Revolution

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

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

How to Scale MongoDB. Apr

Everything You Need to Know About MySQL Group Replication

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

MySQL Group Replication & MySQL InnoDB Cluster

Scaling Without Sharding. Baron Schwartz Percona Inc Surge 2010

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

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

How to Implement ProxySQL with AWS Aurora. Written by Marco Tusa Wednesday, 04 April :00 - Last Updated Wednesday, 04 April :37

MySQL HA Solutions. Keeping it simple, kinda! By: Chris Schneider MySQL Architect Ning.com

Percona Software & Services Update

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

Percona Software & Services Update

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

High availability with MariaDB TX: The definitive guide

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

HA for OpenStack: Connecting the dots

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

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

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

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

MySQL Group Replication. Bogdan Kecman MySQL Principal Technical Engineer

Lessons from database failures

Scalability of web applications

PolarDB. Cloud Native Alibaba. Lixun Peng Inaam Rana Alibaba Cloud Team

Modern Database Concepts

MySQL Architecture Options:

MySQL: Scaling & High Availability

How Facebook Got Consistency with MySQL in the Cloud Sam Dunster

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

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

CSE 444: Database Internals. Section 9: 2-Phase Commit and Replication

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

NoSQL systems: sharding, replication and consistency. Riccardo Torlone Università Roma Tre

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

Multi-Data Center MySQL with Continuent Tungsten

TARGET instant payments settlement (TIPS) how? Massimiliano Renzetti Banca d Italia (4CB) Focus session, 7 July 2017, Frankfurt

High Noon at AWS. ~ Amazon MySQL RDS versus Tungsten Clustering running MySQL on AWS EC2

MySQL Cluster An Introduction

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

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

MySQL High-Availability

Percona XtraDB Cluster

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson

Using MHA in and out of the Cloud. Garrick Peterson Percona University, Toronto 2013

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

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

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

BERLIN. 2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

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

MySQL Multi-Site/Multi-Master Done Right

PNUTS and Weighted Voting. Vijay Chidambaram CS 380 D (Feb 8)

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

Innodb Performance Optimization

How to evaluate which MySQL High Availability solution best suits you

Scaling with mongodb

Performance improvements in MySQL 5.5

Migrating to Vitess at (Slack) Scale. Michael Demmer Percona Live - April 2018

Scale out Read Only Workload by sharing data files of InnoDB. Zhai weixiang Alibaba Cloud

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

Use Cases for Partitioning. Bill Karwin Percona, Inc

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

What s new in Mongo 4.0. Vinicius Grippa Percona

Transcription:

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

Few Words About Percona 2 Your Partner in MySQL and MongoDB Success 100% Open Source Software We work with MySQL, MariaDB, MongoDB, Amazon RDS and Aurora No Lock in Required Solutions and Services 2

In This Presentation Why Replication? How to think about Replication Overview of what MySQL Has to Offer 3

Replication Having Multiple Copies of the data, updated with changes 4

Why Replication Availability Scalability Performance 5

Availability Service Stays up when component fails 6

Availability via Redundancy Have more than one system Works well for stateless systems Is not enough for databases 7

Availability via Replication Redundant Computing Resource Paired with Replicated Data 8

Component Failure Node Failures Total Crash Process Crash Stall/Unresponsive Consistency Issues Network Failures Single Port Failures Partitions Complicated Failures 9

Scalability Scales Reads Does not Scale Writes very well Data Distribution is needed for scaling writes 10

Performance Reduce response time by maintaining replica closer to user 11

Talking about Full Database Replication System of Record Partial Database Replication Can be used as Cache Synchronization of Client Data 12

Where Replication Happens Storage Level Database Level Application Level 13

Storage Level Replication Replication RAID Typically provides cold standby Simple choice which works with many systems Amazon Aurora Smart Storage 14

Database level Most Flexible Most Common Hot/Warm Spare Some can do Active-Active 15

Application Level Hard to get right Rarely used, even more so used right Partial Replication/Syncronization Smart conflict resolution Cross Vendor Redundancy 16

Replication Properties 17

Number of Writable Nodes Single Writer (Master) Write Anywhere (Multi Master) 18

Single Master All writes go to the single node One way replication stream Simple No Conflicts Replication aware Application or Connector 19

Multiple Active Masters Can write to multiple masters Replication is multi-directional More Complicated Possibility of Conflicts 20

Sync or Async Synchronous Replication Asynchronous Replication 21

Synchronous Replication Data Persisted on Target Server Guarantees No Data Loss if Source server fails Conflicts can be easily prevented Expensive 22

What Persisted means? In Memory Assumes power loss of both servers does not happen On Disk Handles Total Loss of Master and Power loss on the Slave 23

Asynchronous Replication Anything not Synchronous Many different variants exist! 24

Asynchronous Properties Commit on Master What happens with Persistence? What happens with Visibility? 25

Persistence Uncommitted Data on Master Committed Data on Master Date in Slave s memory Data on Slave s Disk (log) 26

Visibility Results be visible by concurrent sessions before acknowledgement Phantom Reads Results can t be visible by concurrent sessions No Phantom Reads 27

Conflits No Conflict Handling Conflict Detection Conflict Resolution Conflict Prevention 28

Acknowledgements Applies both to Sync and Some Async How many node have successfully replicated data? All? One? Majority? 29

Level of Control Global Control vs Database Control Control by Writer vs Reader 30

Number of Replicas On (2 nodes) Two or more (3+ nodes) 31

2 nodes Basic Redundancy Need Help with Failure detection and Split Brain No Redundancy in case of node maintainance 32

3+ Nodes Much better Redundancy Quorum based failure handling works out of the box Can do node maintenance without redundancy loss 33

Failure Detection and Promotion Built-In Handled by External Tools 34

Replica Provisioning Manual Automatic 35

Gotchas Distributed systems are complicated. All products have their own gotchas. 36

MySQL Replication 37

Classic MySQL Replication Fully Asynchronous No Failure Detection and Promotion Manual Provisioning Can run Multi-Master No Conflict Handling 38

Semi-Sync Replication 5.6 Wait for one of the slaves to ack update before response to client Commits too soon on the Master Phantom Reads / Possible loss of visible changes Can switch to asynchronous mode 39

Semi-Sync Replication 5.7 Commits on the Master only after slave acknowledges Update invisible to other clients until slave acknowledges Can be Configured to have MySQL 5.6 behavior 40

Making MySQL Replication Better MHA MySQL Failover PRM 41

Percona XtraDB Cluster and Galera 42

Percona XtraDB Cluster Virtually Synchronous Replication Well known Innodb Storage Engine All Reads are Local Parallel Replication Write to any node behavior Built in Node Provisioning and HA Works great in the Cloud! 43

PXC vs Galera Galera Is replication technology/library Compare to Linux Kernel Percona XtraDB Cluster Percona Server Enabling Enhancements Galera Library Provisioning Tools HA and Load Balancing Integrated together and Tested Compare to Linux Distribution 44

PXC Data Architecture 45

Architecture Concepts All Nodes Have Full copy of Data Every Node is Equal No Central Management No SPOF 46

Understanding Cluster The cluster can be seen as a meeting! 47

PXC (Galera cluster) is a meeting 4 8 bfb912e5-f560-11e2-0800-1eefab05e57d 48

PXC (Galera cluster) is a meeting 4 9 bfb912e5-f560-11e2-0800-1eefab05e57d 49

PXC (Galera cluster) is a meeting 5 0 bfb912e5-f560-11e2-0800-1eefab05e57d 50

PXC (Galera cluster) is a meeting 5 1 bfb912e5-f560-11e2-0800-1eefab05e57d 51

PXC (Galera cluster) is a meeting 5 2 bfb912e5-f560-11e2-0800-1eefab05e57d 52

PXC (Galera cluster) is a meeting 5 3 bfb912e5-f560-11e2-0800-1eefab05e57d 53

PXC (Galera cluster) is a meeting 5 4 bfb912e5-f560-11e2-0800-1eefab05e57d 54

PXC (Galera cluster) is a meeting 5 5 55

PXC (Galera cluster) is a meeting 5 6??? 56

5 7 New meeting! 4fd8824d-ad5b-11e2-0800-73d6929be5cf 57

Cluster Reads Reads are always Local Stale Reads can be allowed or disallowed 58

Cluster Writes Write on one node or Write Anywhere Certification Based Replication Communication on Commit only Asynchronous Application Parallel Replication 59

Transaction Commit Flow 60

Loss of connectivity Quorum 6 1 Network Problem Does not accept Reads & Writes 61

Automatic Node Provisioning 6 2 new node joining data is copied via SST or IST writes writes writes 62

Automatic Node Provisioning 6 3 when ready new node joining writes writes writes writes 63

Dedicated shared HAProxy 6 4 application server 1 application server 2 application server 3 HA PROXY PXC node 1 PXC node 2 PXC node 3 64

HAProxy on application side 6 5 application server 1 application server 2 application server 3 HA PROXY HA PROXY HA PROXY PXC node 1 PXC node 2 PXC node 3 65

Scaling Writes? Shard over PXC Cluster rather than MySQL Replicas 66

Thinks To Keep in Mind Use Innodb storage engine Primary Key on all tables Avoid Large write transactions (changing many rows) Plan Data size for SST time correctly Hot Rows Optimistic Locking 67

MySQL Group Replication Similar to Galera Currently in Development Better integrated with MySQL No Automated provisioning (yet) 68

MySQL Cluster Mostly In Memory Storage Synchronous Replication Pessimistic Locking Conflict Detection with Async Replication Niche Use Only 69

New Developments MySQL Fabric MySQL Router MariaDB Max Scale 70

Percona Live 2016 call for papers is Open 7 1 Call for Papers Open until November 29, 2015 MySQL, MongoDB, NoSQL, Data in The Cloud Anything to make Data Happy! http://bit.ly/pl16call 71

Thank You! Peter Zaitsev pz@percona.com P.S We re Hiring http://bit.ly/perconajobs 72