Upgrading Uber’s MySQL Fleet  to version 8.0

Siddharth Singh, Sriram Rao Udupi, Raja Sriram Ganesan, Debadarsini Nayak
12 min readadvanced
--
View Original

Overview

The article discusses Uber's upgrade of its MySQL fleet from version 5.7 to 8.0, detailing the motivations, challenges, and solutions implemented during the process. It emphasizes the importance of automation and careful planning to ensure minimal disruption to services while enhancing performance and security.

What You'll Learn

1

How to automate the MySQL upgrade process to minimize downtime

2

Why upgrading to MySQL 8.0 enhances performance and security

3

When to implement rollback mechanisms during database upgrades

Prerequisites & Requirements

  • Understanding of MySQL database management and upgrade processes
  • Familiarity with automation tools for database management(optional)

Key Questions Answered

What motivated Uber to upgrade its MySQL fleet to version 8.0?
Uber's decision to upgrade was driven by the end-of-life concerns for MySQL v5.7, the need for improved performance and concurrency, and the introduction of new functionalities in MySQL v8.0. These factors were essential for maintaining data integrity and enhancing user experience.
How did Uber navigate the challenges during the MySQL upgrade process?
Uber implemented a comprehensive, multi-step upgrade strategy that included automated workflows, extensive testing, and rollback mechanisms to ensure minimal downtime and compatibility with existing applications. This meticulous planning was crucial for maintaining service level objectives.
What were the key improvements observed after upgrading to MySQL 8.0?
Post-upgrade, Uber experienced significant performance enhancements, including a 29% improvement in p99 latency for 1 million inserts and a 33% improvement for reads at 1024 threads. These improvements directly contributed to a better user experience and operational efficiency.
What issues did Uber face during the MySQL upgrade?
The upgrade introduced unexpected changes in query execution plans, leading to increased latencies and resource consumption. Additionally, syntax changes and SQL mode requirements in MySQL 8.0 disrupted some existing queries, necessitating careful configuration adjustments.

Key Statistics & Figures

Improvement in p99 latency for inserts
29%
This improvement was observed during tests with 1 million inserts at 1024 threads.
Improvement in p99 latency for reads
33%
This improvement was noted during tests with 1 million reads at 1024 threads.
Reduction in overall database lock time
~94%
This reduction significantly enhances application performance and user experience.
Reduction in query time for some queries
~78%
This improvement indicates the efficiency gains achieved post-upgrade.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Implement a phased rollout strategy for database upgrades to minimize risks.
By gradually transitioning to new database versions, teams can identify and resolve issues early, ensuring a smoother upgrade process and reducing the likelihood of service disruptions.
2
Utilize automated rollback mechanisms during upgrades to safeguard data integrity.
Having rollback capabilities allows teams to quickly revert to previous versions in case of failures, thus protecting against potential data loss and maintaining service reliability.
3
Conduct thorough testing of new database versions in a staging environment before production deployment.
Testing helps identify compatibility issues and performance bottlenecks, ensuring that the new version meets operational requirements without impacting user experience.

Common Pitfalls

1
Failing to account for syntax changes and SQL modes during the upgrade can lead to production issues.
Many existing queries may break if they rely on deprecated syntax or SQL modes not enabled by default in MySQL 8.0. Careful review and testing of queries are essential to avoid disruptions.
2
Neglecting to upgrade client libraries can result in compatibility issues with the new database version.
Incompatibilities between existing client libraries and MySQL 8.0 necessitate upgrades and thorough testing to ensure seamless interactions with the database.

Related Concepts

Database Upgrade Strategies
Performance Optimization Techniques
Automation In Database Management