Meniu

Facebook is migrating to MySQL 8.0

MySQL is an open source database developed by Oracle. Each new major version of MySQL requires significant time and effort to migrate workloads. The latest major version used by Facebook is MySQL 5.6 .

Migration challenges include:

- Porting features to the new version
- Ensuring replication is compatible between major versions
- Minimizing the changes needed for existing application queries
- Fixing performance regressions that prevent the server from supporting workloads

This version of MySQL includes new features, such as write-based parallel replication and a transactional data dictionary with atomic DDL support.

Facebook team: Version 5.6 was coming to an end and we wanted to stay active in the MySQL community, especially with our work on the MyRocks storage engine. Improvements in 8.0, such as DDL, could speed up changes to the MyRocks schema, but we need to be in code 8.0 to use it. Given the benefits of updating the code, I decided to migrate to 8.0. We share how we approached our 8.0 migration project - and some of the surprises we discovered in the process.

We group several mysqld instances into a single set of MySQL replicas. Each instance of a replica set contains the same data, but is geographically distributed to a different data center to provide data availability and failover support. Each set of lines has a main instance. The rest of the courts are all secondary. The mayor handles all write traffic and replicates the data asynchronously to all secondary.

Each set of replicas can go through each of the above steps independently and can stay on one step for as long as necessary. We separated the replica sets into much smaller groups, which we kept in each transition. If we find problems, we could return to the previous step. In some cases, the replica sets managed to reach the last step before others began.

To automate the transition of a large number of replica sets, we had to build a new software infrastructure. We could group sets of replicas together and move them through each step by simply changing a line in a configuration file. Any set of lines that encountered problems could then be reduced individually.

MySQL 8.0 combines the NoSQL features and the relational database model into a single hybrid model. This combines the benefits of NoSQL, such as agility, scalability and high speed, with the advantages of relational databases, such as guaranteed consistency between entities. All these are priorities of modern and native cloud developers. They can continue to build traditional relational database applications; and with MySQL 8.0, it can also create schema-free document database (NoSQL) applications - using products from a single vendor.

Among the many pivotal features of MySQL 8.0 led by developers and DBA are the window functions, which are promoted as one of the coolest new additions. Window functions collect a group of results in a set of rows and then return a single set of aggregate values. Using window functions for applications that require analysis and queries that involve grouping or comparing information changes lives for developers and DBAs.

Source: engineering.fb.com

FlorinM

Utilizator Linux - Solus OS, pasionat de calatorii.
  • | 2708 articole

Nici un comentariu inca. Fii primul!
  • powered by Verysign