Facebook presents lessons learned from MySQL 8.0 migration
Facebook described its migration to MySQL 8.0, a plethora of headaches and a timeline that highlights that these upgrades can be painful, even for a company known for its engineering prowess and scale.
In a blog post, Facebook’s engineering team described upgrading MySQL from 5.6 to 8.0. MySQL is the foundation for Facebook’s storage engine, replication, and workloads. Facebook had custom functionality with the open source database, needed to ensure replication was compatible, and had to minimize changes while boosting performance.
The upgrade is worth reading because it shows how businesses can customize open source software and end up with all the complications of a proprietary system. Here are some takeaways from Facebook’s MySQL 8.0 upgrade dissection.
- The project lasted a few years.
- Facebook’s last major update to MySQL 5.6 took over a year to roll out. Facebook decided to skip an upgrade to version 5.7 while developing its MyRocks storage engine.
- MySQL 8.0 was announced when MyRocks was completed, so Facebook chose to upgrade to add improvements to its storage engine.
- Facebook had 1,700 code fixes to port from its custom MySQL 5.6 branch to version 8.0. The effort was complicated by the new features and fixes to Facebook MySQL continually added to the 5.6 codebase.
- Upgrading from 5.6 to 8.0 skipped 5.7 completely and some APIs were either deprecated or removed altogether. Any application using the old APIs needed an update.
- Documentation of custom code was spotty. Facebook said most of its custom code had good comments and documentation. The other code was also not documented, and Facebook had to dig through old documents, posts, and code comments to understand the history.
- The more complex features required significant changes from MySQL 8.0 and there were compatibility issues to be addressed.
- In the end, Facebook evaluated over 2,300 fixes and ported 1,500 to MySQL 8.0.
Was the upgrade worth it? Facebook argued that upgrading from MySQL 8.0 significantly improves what the company can do. However, Facebook may already want to start thinking about future upgrades.