All of the tips in this article are important and relevant in the cloud as well. It is important to monitor and understand your workload, to design proper schemas, and to change settings only when necessary. Tools like MySQL Enterprise Monitor and the open source Percona Monitoring and Management can be a great help for monitoring your servers.
MySQL performance tip No. 10: Keep the replicas up to date
In recent years there have been many improvements around MySQL replication, which could not keep up with the write workload on the primary server in many instances. In the latest MySQL major version, replication is parallel by default, which means that multiple replication threads are running and trying to apply transactions at the same time.
Of course the efficiency depends heavily on the write workload of your application, but in most cases parallel replication can help the replicas to keep up. You can control this with the replica_parallel_type
and replica_parallel_workers
variables. With the LOGICAL_CLOCK
type, transactions are applied in parallel and dependencies are tracked based on the timestamps.
Overall, MySQL is the leading open source database for millions of developers and it will continue to be the platform of choice for many applications created around the world. By looking at issues around schema design, indexing, tuning, and I/O, you can improve the performance of your application dramatically. And don’t forget, deployment approaches like moving to the cloud will have their own performance implications too.
Tibor Köröcz is an architect for Percona, and Francisco Bordenave is a senior architect for Percona. They work on large-scale open source database deployments and services, covering MySQL, PostgreSQL, and MongoDB. Percona is a leading provider of unbiased open source database solutions.