For this last day (25.10.2018) at Oracle Open World my first technical session was “Replication what’s new in MySQL 8“. This session was given by Nuno Carvalho – Oracle MySQL Principal Software Engineer, Vitor Oliveira – Oracle MySQL Performance Architect, Louis Soares – Oracle MySQL Software Development Director. You can find the list of new features linked with MySQL InnoDB Cluster here.

MySQL - high availabiltiy

They introduced the session with the challenges a database has to face today:

  • We share lots of data
  • All things distributed
  • We are not sharing anymore few Ko but Mo
  • Go green requires dynamic and adaptative behavior
  • Moving, transforming and processing data quicker than anyone else means having an edge over competitors
  • We expect service always available even in case of migration/upgrade
  • etc…

Some years ago we solved availability concerns with replication but replication is not anymore able to solve the today’s challenges. Replication was perfect to generate and reproducing multiple copies of data at one or more sites. The MySQL replication technology evolved since version 3.23 where replication was asynchronous. Since version 5.5 thanks to a the semi-synchronous replication plugin, we have semi-synchronous replication and now since version 5.7.17 and 8.01 we have group replication.

MySQL Replication evolution

In order to answer to the today’s challenges, the solution must fit with these requirements:

  • Replicate: The number of servers should grow or shrink dynamically with as little pain as possible
  • Automate: The primary/secondary role assignment has to be automatic. A new primary has to be elected automatically on primary failures. The read/write modes on primary and secondaries have to be setup automatically. A consistent wview of which server is the primary has to be provided.
  • Integrate: MySQL has to fit with other technologies such as Hadoop, Kafka, Solr, Lucene, aso…
  • Scale: Repliacte between clusters for disaster recovery. For read scale out, asynchronous read replicas can be connected to the cluster
  • Enhance: Group replication for higher availability. Asynchronous Replication for Read Scale-out. One-stop shell to deploy and manage the cluster. Seamlessly and automatically route the workload to the proper database server in the cluster (in case of failure). Hide failures from the application.

MySQL role change

Enhancements in MySQL 8 (and 5.7)

The following has been enhanced in version 8 and 5.7:

  • Binary log Enhancements. Thanks to new metadata: Easy to decode what is in the binary log. Further facilitates connecting MySQL to other systems using the binary log stream. Cpaturing data changes through the binary log is simplified. Also more stats showing where the data is/was at a certain point in time.
  • Operations: Preventing Updates On replicas that leave the cluster- Automatic protection against involuntarily tainting of offline replicas. Primary Election Weights – Choose next primary by assigning election weights to the candidates. Trigger primary Election Online – User tells current primary to give up its role and assign it to another server(new in 8.0.13). Relaxed Member Eviction – User controls the amount of time to wait until others decide to evict a member from the group.
  • Performance: Highly efficient Replication Applier – write set parallelization. Fast Group Replication Recovery – Replica quickly online by using WRITESET. High Cluster Througput – More transactions per second while sustaining zero lag on any replica. Efficient Replication of JSON Documents – Replicate only changed fields of documents (Partial JSON Updates).
  • Monitoring: Monitor Lag with microsecond precision – From the immediate master and for each stage of the replication applier process. Global Group Stats Available on Every Server – Version, Role and more

MySQL 8 Group Replication

I finally recommend to have a look on the blogs from the Engineers  where you will find news, technical information and much more: