Upgrading to MySQL 8 on all SiteGround servers

Korea Data Forum Fosters Collaboration and Growth
Post Reply
tasnimsanika1
Posts: 14
Joined: Wed Dec 18, 2024 3:09 am

Upgrading to MySQL 8 on all SiteGround servers

Post by tasnimsanika1 »

A few weeks ago we started upgrading our servers to MySQL 8. This was the result of a long process of monitoring and compatibility testing this version with our clients' websites, until we concluded that MySQL 8 is highly compatible with the main applications hosted on our platform and it is safe to make the change.

MySQL is a fundamental piece of software in our stack, used by the vast majority of our customers to power their databases. Its optimal functioning has a huge impact on overall website performance and availability. That’s why the SiteGround team dedicates a lot of resources to optimizing and customizing our MySQL, always with the goal of ever-better performance. To achieve this goal over the years, we have introduced various customizations, such as our unique MySQL configuration, and we carefully plan and test any new MySQL release, making sure the benefits outweigh the potential harms such an upgrade could bring. We are now confident that MySQL version 8 is largely supported and our customers can safely take advantage of the improved database performance, scalability, and coding optimizations it brings with it.

What is the plan for MySQL upgrade?
First, we would like to announce that all new websites created on our shared servers and all newly created Cloud accounts now come with MySQL 8 by default.

Secondly, the migration process to MySQL 8 for existing shared sites is already in progress. Once our shared servers are upgraded, we will start upgrading the Cloud instances as well. The process will continue over the next few months. According to our schedule, we plan to have all our customers migrated to MySQL 8 by the end of June this year.

To make the transition as smooth as possible, we send you emails at least a week in advance to let you know exactly when we will upgrade your website to MySQL 8. The upgrade procedure is performed late at night when server traffic is at its lowest. A brief service interruption may occur while the software is being updated. No action is required on your part regarding the migration.

What's new in MySQL 8?
MySQL 8 introduces a variety of new features and improvements to legacy functionality, all with the goal of improving overall performance and scalability, as well as the developer experience. The most notable ones are detailed below.

Better performance and scalability
MySQL 8 offers improved performance and scalability. Benchmark tests show improved results in terms of performance and scalability for MySQL 8 compared to MySQL 5.7. The tests show that MySQL 8 handles read/write operations much better and the number of transactions processed is much higher.

Additionally, tests show that MySQL 8 utilizes the hardware much better compared to version 5.7.

Here are some of the improvements that make this possible:

Scaling read/write workloads
MySQL 8 shows improved read/write performance and more than 2x better performance under high loads compared to MySQL 5.7.

Better performance in high containment loads
Performance for high contention workloads has been significantly improved in MySQL 8. A high contention workload occurs when multiple transactions are waiting for a lock on the same row in a table, causing transaction queues to form.

In MySQL 8, such bursts are handled much better in terms of transactions per second and latency. This leads to better hardware utilization (efficiency), as the system needs fewer additional resources and can therefore operate under a higher average load.

Native Partitioning/Improved InnoDB Pool
MySQL 8 supports native partitioning for the InnoDB engine. This allows you to split large tables into smaller partitions. This can improve query performance and reduce storage requirements, especially for large tables. The new version of MySQL also introduces improvements to the InnoDB pool. The pool is responsible for caching data and reducing I/O operations.

Common Table Expressions (CTE)
With the latest release of MySQL 8, you can now also take advantage of common table expressions. A common table expression is a result set that exists only temporarily while a statement is being executed that can then be used in the same statement.

These CTEs allow you to build more complex queries using simpler blocks, based on temporary tables. In other words, common table expressions allow you to use temporary named result sets.

Changing the default character
The default character set in MySQL 8 is changed to utf8mb4.

One of the most notable differences between utf8, utf8mb3, and utf8mb4 is the maximum number of bytes per character. While utf8 and utf8mb3 can only store characters in Unicode's Basic Multilingual Plane (BMP), utf8mb4 can store characters in the Supplementary Plane. utf8mb4 supports a wide range of characters, including emojis and other special characters.

Invisible indexes
Another new feature in MySQL 8 is invisible indexes. Generally, indexes are used by denmark whatsapp number data the MySQL query optimizer to improve the speed with which data is retrieved, while invisible indexes are those that are hidden from the MySQL query optimizer and allow the removal of an index to be tested on query performance, without making a destructive change.

For example, you are working with a very large table with a few indexes, and you want to optimize it further by dropping certain indexes and adding new ones. Imagine that you know that you will need these indexes in the future. Dropping them in the first place can be dangerous, because building them again is very resource intensive. To avoid this, you can now simply use invisible indexes: make some existing ones invisible, test what you need with the new ones, and when you need them, make them visible again.


Image

Why is now the right time to migrate?
Because MySQL is such a foundational technology, major upgrades happen rarely and take a long time to be universally adopted. MySQL 8 was first released in 2018, but it took several years for most websites and their underlying applications to become supported. We have been constantly monitoring the level of support and have chosen the current update timing as we have seen that the risk of negatively impacting a website with the update has now greatly decreased. Since the update began a few weeks ago, we have already migrated hundreds of thousands of sites to MySQL 8.
Post Reply