everything you need to know about mysql group replication ?· title: everything you need to know...

Download Everything You Need to Know About MySQL Group Replication ?· Title: Everything You Need to Know About…

Post on 25-Jul-2018

213 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

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

    Everything You Need to Know AboutMySQL Group Replication

    Lus Soares (luis.soares@oracle.com)Principal Software Engineer, MySQL Replication Lead

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Safe Harbor Statement

    The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracles products remains at the sole discretion of Oracle.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US 2

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Program Agenda

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Background

    Use cases

    Deployment modes

    Features

    Performance

    Architecture

    Conclusion

    Program Agenda

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    1

    2

    3

    4

    5

    6

    4

    7

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Background

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    1

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Database Replication

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    ServerB

    ServerA

    App

    INSERT ...

    INSERT ... INSERT ...

    ReplicationThe process of generating and reproducing multiple copies of data at one or more sites.,Database Systems: A Practical Approach to Design, Implementation, and Management, Thomas M. Connolly, Carolyn E. Begg, Third Edition, 2002.

    6

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    MySQL Database Replication: Overview

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    INSERT ...Server

    B

    binary log

    INSERT ...

    relay log

    INSERT ...Server

    A

    binary log

    App

    ReceiverMeta-data

    Update

    ApplierMeta-data

    Update

    INSERT ...

    Comm. Framework

    7

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Coordination Between Servers

    MySQL Database Replication: Some Notes

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    A B Since 3.23

    A B

    semi-synchronous (plugin)

    A CB

    group replication (plugin)

    transactions

    transactions

    Since 5.5

    Since 5.7.17

    asynchronous (native)

    transactions, membership, coordination

    acks

    And now in MySQL 8 as of 8.0.1

    8

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    MySQL Group Replication

    What is MySQL Group Replication?

    Single/Multi-primary update everywhere replication plugin for MySQL with built-in automatic distributed recovery, conflict detection and group membership.

    What does the MySQL Group Replication plugin do for the user? Removes the need for handling server fail-over.

    Provides fault tolerance.

    Enables update everywhere setups.

    Automates group reconfiguration (handling of crashes, failures, re-connects).

    Provides a highly available replicated database.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US 9

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    MySQL Group Replication

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    P P P P P

    Replication Group

    Clients

    10

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |Friday, 28th April 2017 MySQL Innovation Day, CA, US

    GR 0.8.0 labs (beta)performance enhancementsreplication stream compressionSSL supportIP whitelistingread-only modeerror log enhancementssplit brain handling

    The Road to Group Replication in MySQL 8 and InnoDB Clusters

    MySQL 5.6.10

    MySQL 5.7.9lifecycle interfacesP_S tables for GRServer side changes

    GR 0.2.0 labsHello world!

    GR 0.3.0 labssupport for corosync 2.x

    GR 0.4.0 labsversion handling

    GR 0.5.0 labsauto-inc fields handlingrecovery enhancements

    GR 0.6.0 labsmulti-platform supportPaxos-based consensus

    GR 0.7.0 labsbug fixes

    GR 0.9.0 labs (RC)multi-threaded appliersupport

    Single-primary mode

    GR is GA inMySQL Server5.7.17

    ...

    GR is released withMySQL 8.0.1 andInnoDB Cluster GA

    11

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Use cases

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    2

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Use Cases

    Elastic Replication

    Environments that require a very fluid replication infrastructure, where the number of servers has to grow or shrink dynamically and with as little pain as possible.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    P P P P P

    13

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Use Cases

    Highly Available Shards

    Sharding is a popular approach to achieve write scale-out. Users can use MySQL Group Replication to implement highly available shards. Each shard can map into a Replication Group.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    P P P P P P P P P P P P P P P

    14

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Use Cases

    Alternative to Master-Slave replication

    Single-primary mode provides further automation on such setups

    Automatic PRIMARY/SECONDARY roles assignment

    Automatic new PRIMARY election on PRIMARY failures

    Automatic setup of read/write modes on PRIMARY and SECONDARIES

    Global consistent view of which server is the PRIMARY

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    S S S S P S

    Primary

    15

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    ArchitectureIntroduction

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    6

    6.1

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    MySQL Group Replication is

    Built on top of proven technology!

    Shares many pieces of MySQL Replication.

    Multi-primary approach to replication.

    Built on reusable components! Layered implementation approach.

    Interface driven development.

    Decoupled from the server core.

    The plugin registers as listener to server events.

    Reuses the capture procedure from regular replication.

    Provides further decoupling from the communication infrasctructure.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US 17

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Major Building Blocks

    ArchitectureIntroduction

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    6

    6.1

    6.2

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Major Building Blocks

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    M M M M M

    Com. API

    ReplicationPlugin

    API

    MySQLServer

    Group Comm.

    System (Corosync)Group Com. Engine

    19

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    The Complete Stack

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    API

    ReplicationPlugin

    API

    MySQLServer

    Performance Schema Tables: Monitoring

    MySQL

    APIs: Lifecycle / Capture / Applier

    InnoDB

    Replication Protocol

    Group Com. API

    Group Com. Engine

    Network

    Plu

    ginCapture Applier

    ConflictsHandler

    Group Comm.System (Corosync)

    Group Com. EngineGroup Com. Binding

    Recovery

    20

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Single-primary

    Deployment modes

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    3

    3.1

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Single-primary mode

    Configuration mode that makes a single member act as a writeable master (PRIMARY) and the rest of the members act as hot-standbys (SECONDARIES).

    The group itself coordinates automatically to figure out which is the member that will act as the PRIMARY, through a primary election mechanism.

    Single-primary mode is the default mode Closer to classic asynchronous replication setups, simpler to reason about from the

    beginning.

    Avoids some of the limitations of multi-primary mode by default.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US 22

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Single-primary mode

    Automatic primary election mechanism.

    Secondaries are automatically set to read-only.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    S S S S P S

    Primary

    23

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

    Single-primary mode

    Automatic primary election mechanism.

    Friday, 28th April 2017 MySQL Innovation Day, CA, US

    S S S P S

    Primary

    24

  • Copyright 2017, Oracle and/or its affiliates. All rights reserved. |

Recommended

View more >