Blog Post

Data Architecture Blog
3 MIN READ

Migrating your workloads to Azure Database for MySQL

geo_walters's avatar
geo_walters
Icon for Microsoft rankMicrosoft
Nov 22, 2022

Migrating your workloads to Azure Database for MySQL

Microsoft has a long history of trying to make software development and administration of IT infrastructure easier overtime. Additionally, Microsoft in the last 10 years has embraced open source broadly.

 

Microsoft Azure supports virtual machines, platform services, containers, serverless, and various other infrastructure. In this article, I will share some options you can make to deploy your software on MySQL in Azure.

 

 

It may help you to look over the relative cost in terms of effort for administering your infrastructure versus physical, virtual on premises, Azure VM, or PaaS for your MySQL choices. The above diagram works for many other products, like SQL Server, or web servers, or other infrastructure as well.

 

MySQL on Azure VMs. This option falls into the industry category of IaaS. With this service, you can run MySQL Server inside a managed virtual machine on the Azure cloud platform. All recent versions and editions of MySQL can be installed in the virtual machine.

 

Azure database for MySQL is a Platform Service (PaaS), fully managed MySQL database engine based on the stable version of MySQL community edition. With a managed instance of MySQL on Azure, you can use built-in features viz automated patching, high availability, automated backups, elastic scaling, enterprise grade security, compliance and governance, monitoring and alerting that require extensive configuration when MySQL Server is either on-premises or in an Azure VM.

Azure Database for MySQL, powered by the MySQL community edition, available in two deployment modes:

  • Flexible Server – A fully managed production-ready database service designed for more granular control and flexibility over database management functions and configuration settings. The flexible server architecture allows users to opt for high availability within a single availability zone and across multiple availability zones. The service supports the community version of MySQL 5.7 and 8.0. The service is generally available today in various Azure regions. Flexible servers are best suited for all new developments and migration of production workloads to Azure Database for MySQL service.
  • Single Server is a fully managed database service designed for minimal customization. The single server platform is designed to handle most database management functions such as patching, backups, high availability, and security with minimal user configuration and control. The architecture is optimized for built-in high availability with 99.99% availability in a single availability zone. It supports the community version of MySQL 5.6 (retired), 5.7, and 8.0. The service is generally available today in various Azure regions. Single servers are best-suited only for existing applications already leveraging single server. A Flexible Server would be the recommended deployment option for all new developments or migrations.

I have two customers, who each had in-house developed applications with MySQL as the database engine, chose Azure Database for MySQL to migrate to as they moved from on-premises to Azure. Each customer has over 200 databases hosted on many MySQL servers.

Migration choices for Azure Database for MySQL

For detailed information and use cases about migrating databases to Azure Database for MySQL, refer to the Database Migration Guide. This document provides pointers to help you successfully plan and execute a MySQL migration to Azure.

Microsoft has a great set of learning on our website, with tutorials to get familiar with tools and processes. Here is the learning path for migrating MySQL from on-premises to Azure.

I hope this article helps clear up the choices of MySQL on Azure, as well as giving you information for how to migrate and learn more.

 

Updated Nov 22, 2022
Version 1.0
  • MySQL (opens new window) is a very powerful database. When you run it on-premises, you are responsible for keeping it up and running and for securing it and making it as performant as possible. When you run your MySQL database in Azure Database for MySQL (opens new window), Azure manages it and ensures that it is highly available, performant and secure, so that you can focus on using the database and building valuable applications with it. To get your existing MySQL database into Azure, you need to migrate it. You can use several tools and techniques to do that

    (opens new window), depending on your MySQL version and where you are running it.

    In this post, we'll migrate a MySQL database that is running in a Virtual Machine
    (opens new window), to a managed MySQL database that runs in an Azure Database for MySQL

    (opens new window) server.

    Prerequisites

    • If you want to follow along, you'll need the following:
    • An Azure subscription (If you don't have an Azure subscription, create a free account
    • (opens new window) before you begin)
      An existing MySQL database that is connected to Azure (with a hybrid connection, like Azure ExpressRoute
      (opens new window), or running in Azure in a Virtual Machine). If you don't have an existing MySQL database, you can create one by installing a MySQL server (opens new window) and running the SQL script in this GitHub repository
      (opens new window) in a schema on the server
      MySQL Workbench
    • (opens new window) that can access the existing MySQL database


    Azure Database Migration for MySQL

    I have a MySQL database that is running in a Virtual Machine in Azure. You might have one that is running on-premises or in another cloud. When that's the case, you need to create a connection between the environment where your MySQL is running and Azure, which is beyond the scope of this article.

    Let's migrate the MySQL database from my VM to Azure Database for MySQL. I'll start by creating an Azure Database for MySQL with the Azure portal.

    • Go to the Azure portal
    • (opens new window)
      Click the Create a resource button (the plus-sign in the top left corner)
      Search for mysql, select the "Azure Database for MySQL" result and click Create
    • This brings you to the create MySQL server blade
    • Select a Resource Group
    • Fill in a Name for the server
    • Select a Location
    • Pick a Version. For this example, we'll use MySQL version 5.7. You need to make sure that the target server (in Azure), is the same version as the existing MySQL server
    • Select the Compute + Storage tier
    • Fill in an Admin username for the server
    • Tye a Password and Confirm the password
    • Click Review + create and Create after that. This creates the Azure Database for MySQL server

    Regards,
    Jennifer