More about Azure Database
- Azure PostgreSQL: Managed or Self-Managed?
- Azure MySQL: MySQL as a Service vs. Self-Managed in the Cloud
- Azure Disk Storage for SQL Server
- Oracle on Azure: Fully Managed vs Self Managed
- Azure SQL Database Backup & Recovery: The Abridged Guide
- Azure SQL Server: Managed Service vs Self Managed
- Azure SQL Managed Instance Explained: Key Features & Challenges
- Azure Backup: SQL Server Backups on Azure and How to Use Them
- Azure Oracle: Your First Oracle Database on Azure
- Azure Database Migration Service: Automate Your Cloud DB Migration
- Azure Database Review: Your Guide for Database Assessment
- How to Back Up SQL Server to Azure
- Azure SQL Database: 18 Options for SQL Server on the Cloud
- SQL Server End of Life Challenges and How Cloud Volumes ONTAP Can Help
Subscribe to our blog
Thanks for subscribing to the blog.
There are several options for running MySQL databases as a service on the Microsoft Azure cloud:
- Azure Database for MySQL—an Azure database service that lets you run a managed database instance, offloading database administration tasks from your team, including scalability, backups and high availability.
- Azure Database for MySQL: Flexible Server—currently in preview, is a managed service that provides more control over the setup of the MySQL database, and enables high availability across multiple availability zones.
- Self-managed MySQL on Azure virtual machines—this provides the highest level of control over the database server, and allows you to set up environment, configuration, and tuning just like you would in your local data center.
In this post, we’ll review the two managed MySQL deployment options, and explain their pros and cons compared to the self-managed option—running MySQL in an Azure virtual machine.
If you need to customize your MySQL server for an enterprise environment, jump forward to read about the self-managed option.
If you want to run other databases on Azure, see our guides to:
- Azure SQL Database: 18 Options for SQL Server on the Cloud (SQL Server on Azure)
- Azure Oracle: Your First Oracle Database on Azure
In this article, you will learn:
- How Can you Run MySQL on Azure?
- Azure MySQL Pricing for Managed Deployment
- Azure MySQL Backup and Replication for Managed Deployment
- Fully Managed vs. Self Managed Deployment of MySQL on Azure
- SQL Server on Azure with Cloud Volumes ONTAP: The Best of Both Worlds
Azure MySQL: Managed Deployment Options
You can use two main methods to deploy Azure Database for MySQL—Single Server or Flexible Server (in Preview).
Azure Database for MySQL: Single Server
Azure Database for MySQL Single Server offers a fully managed database service built for minimal database customization requirements. The platform supports the community edition of MySQL, including versions 5.6, 5.7 and 8.0.
The platform is built to handle the majority of database management capabilities, including backups, patching, and high availability, as well as security that comes with minimal user configuration and control.
The architecture of Single Server is designed with built-in high availability, and provides a 99.99% availability on individual availability zones (AZ). The service is generally available across a wide scope of Azure regions.
Single servers are ideal for cloud-native applications that are built for automated patching. Preferably, applications that do not require granular control for patching scheduling and customized MySQL configurations.
Azure Database for MySQL: Flexible Server (in Preview)
Azure Database for MySQL Flexible Server offers a fully managed database service that provides extended flexibility and granular control over database management features and configurations, based on user requirements.
The architecture of Flexible Server is designed to enable users to leverage high availability across multiple AZs as well as an individual AZ. The service offers controls for cost optimization and lets users stop or start servers and burstable compute tiers.
Flexible servers are highly recommended for workloads that do not require a continuous full-compute capacity. You can leverage flexible servers for application development workloads that need extended customization and control, zone redundant high availability, and managed maintenance windows.
The service supports the MySQL 5.7 community version and is in public preview.
Azure MySQL: Pricing for Managed Deployment
The Azure Database for MySQL managed service is offered under three pricing models:
- Basic—suitable for databases that require light compute power and moderate I/O performance. For example, development or testing databases.
- General Purpose—provides compute capability and memory for average production databases, with scalable I/O throughput. For example, a database used for a web or enterprise application.
- Memory Optimized—can support databases that require very fast transaction processing and/or a large number of concurrent users. For example, a database used for real time analytics.
The table below summarizes the capabilities and pricing for each tier. For more details and up-to-date pricing check the official pricing page.
Database Instance Capabilities
Gen 5 compute with 1-2 vCores, 2GB memory and storage 1-5TB
$0.034-$0.068/hour for compute
$0.10 per GB/month for storage
Gen 5 compute with up to 64 vCores, 5GB memory, and storage between 5-16TB
$0.115 per GB/month
Gen 5 compute, up to 32 vCores, 10GB memory, between 5-16TB storage
$0.115 per GB/month
Azure MySQL Backup and Replication in Managed Deployment
Azure Database for MySQL provides automated backups of an entire MySQL server, including data files and transaction logs. If there is an issue with an Azure MySQL server, you can do a point-in-time restore from backup. The backup retention period is one week by default, and can be extended up to 35 days.
You can choose to store backups in locally-redundant storage or on more resilient geo-redundant storage. Azure backups are encrypted using AES 256 encryption.
In addition, Azure Database for MySQL provides two main replication options:
- Data-in replication—synchronizing a MySQL database deployed locally, or in another cloud provider, with an Azure-based MySQL database. This is suitable for hybrid scenarios.
- Read replicas—lets you copy data from Azure Database on MySQL to up to 5 read-only MySQL replicas. Replication is performed asynchronously. This is mainly suitable for databases with a high load of read operations.
Fully Managed vs. Self-Managed Deployment of MySQL on Azure
The first part of this article introduced a fully managed option for deploying MySQL on Azure using Azure Database for MySQL. This is a good fit if you are running workloads on the cloud in a platform as a service (PaaS) model, or you are refactoring applications for the cloud.
But there is another way—the self-managed option. This option is more suitable in larger deployments with enterprise-grade requirements, and involves running MySQL independently on a virtual machine in Azure. You can deploy MySQL using a preconfigured image (either your own image or one from the Azure Marketplace). This is an infrastructure as a service (IaaS) deployment model, which is suitable if you need fine-grained control over the database and need to customize your environment.
Let’s see what is involved in deploying MySQL to Azure in each of these approaches and discuss the pros and cons of each option.
Learn how to migrate your database to Azure in our guide to Azure Database Migration Service (DMS).
How Does Self-Managed MySQL on Azure Work?
In many cases, particularly for large or mission critical databases, a good alternative to Azure managed database services is to deploy MySQL on an Azure VM. This means you need to install and deploy the database on an Azure VM instance and add Azure Managed Disks as durable storage.
If you manage MySQL yourself, you have to set it up and maintain it just as you would do in your own datacenter. However, you can use VM images to make things easier:
- You can create an Azure VM image and use it as a template for new MySQL VMs.
- You can download an Azure Marketplace VM image, with MySQL preinstalled, and with configuration already in place, including high availability. Note that some machine images are free, and some have a flat or per-hour cost.
Pros and Cons of Managed Deployment with Azure Database for MySQL
Let’s review the pros and cons of deploying MySQL on Azure in a fully managed model.
Pros of managed option—Azure Database for MySQL
- Availability—SLA of 99.99%
- Backups—automated database backups with retention of up to 35 days
- Encryption—backups automatically encrypted using AES 256-bit encryption
- Upgrades—management tasks like patches and upgrades are managed without user intervention
- Scalability—supports automatic scaling via asynchronous replication between MySQL master server and up to 5 read replicas in the same region
- Storage—in Azure Database for MySQL, storage is an integrated part of the service, and scales automatically based on usage up to 4TB.
Cons of managed option—Azure Database for MySQL
Though many DB administration activities are offloaded in Azure Database for MySQL, customers could find them to be restrictive in certain circumstances. For example:
- Version support—Azure Database for MySQL supports MySQL versions 5.6, 5.7, and 8.0 only, so you will need to migrate databases with older versions.
- Storage limitation—database size limited to 4TB
- Database maintenance—no guarantee of exact time database maintenance takes place. Planned maintenance events run for 15 hours; maintenance is done at some point during this period. Microsoft advises not performing long running transactions during the planned maintenance window, as it may cause consistency issues.
- Hybrid scenarios—database services are deployed in Azure. Integrating them with local data centers must be managed by the user and requires special configuration and technical expertise.
- Storage engines—the following MySQL storage engines are not supported by Azure: MyISAM, BLACKHOLE, ARCHIVE, and FEDERATED. If your databases use these, you will need to migrate the data to InnoDB or MEMORY.
- Backup automation—Azure SQL Database backup is fully automated, and does not provide control over backup schedule and frequency. This may not be in line with your requirements. To perform backups at specific times, you will need to manually create snapshots or write custom scripts.
- Storage customization—Azure Database for MySQL provides specific storage capabilities, depending on the Azure VM SKUs you select for the managed service. If you need different storage capabilities not provided by these SKUs, for example higher performance, you will not be able to change storage.
- Learning curve—Azure Database for MySQL is a different operating environment from the traditional data center. For experienced MySQL administrators, there will be a learning curve involved in switching to the managed service.
- Vendor lock-in—once your MySQL database is running in Azure, it will not be possible to seamlessly migrate it outside Azure without meticulous tuning and testing.
Option #2: Self-Managed—Deploying MySQL in an Azure VM with Managed Storage
Now let’s review the pros and cons of the self-managed option, which provides much greater flexibility for deploying MySQL on Azure.
Pros of self-managed option—MySQL in an Azure VM
- Complete control—provides complete control over the database, like in an on-premises deployment, together with the flexibility and scalability provided by the Azure cloud.
- Cost savings—less expensive than the managed options, because you are only paying for compute and storage resources (as well as for the Marketplace image, if you selected a paid option).
- No storage limitation—database size only limited by the storage capability of the Azure VM or attached storage.
- No version limitation—run any version of MySQL, even those not supported by Azure Database for MySQL.
- Control database maintenance—avoid Azure planned maintenance windows which can disrupt mission critical workloads.
- Hybrid scenarios—make it much easier to integrate your cloud-based MySQL with on-premises systems.
- Storage engines—use any MySQL storage engine, not just InnoDB or MEMORY.
- Backup customization—customize backup to your schedule and specific disaster recovery requirements.
- Storage customization—you can select any Azure storage resource that meets your performance requirements, without being limited to the specific type of storage provisioned by the managed service.
- Learning curve—much smoother learning curve, because you can manage MySQL very similarly to the way you do in the on-premises data center.
- No vendor lock-in—easy to migrate the database from Azure to any other provider or take it back on-premises.
Cons of self-managed option—MySQL in an Azure VM
- Management overhead—it is your responsibility to manage configuration issues such as backups, high availability, and patching.
- Auto scaling—you need to manage the auto scaling feature provided by Azure VMs to build your sizing strategy.
- Storage management—to provision storage for your database, you need to use Azure managed disks. For large deployments requiring several disks with a RAID configuration, this can be complex to manage.
This deployment option grants you more control over MySQL databases, optimization and tuning, lets you select the level of performance you need, and can significantly save costs compared to the managed version.
SQL Server on Azure with Cloud Volumes ONTAP: The Best of Both Worlds
For organizations that need to customize their MySQL deployments, and need to overcome the limitations of the Azure Database for MySQL managed service, the self-managed Azure VM option is the most appropriate. However, this option comes with the complexity of managing storage.
NetApp Cloud Volumes ONTAP, the leading enterprise-grade storage management solution, delivers secure, proven storage management services on AWS, Azure and Google Cloud. Cloud Volumes ONTAP supports up to a capacity of 368TB, and supports various use cases such as file services, databases, DevOps, or any other enterprise workload, with a strong set of features including high availability, data protection, storage efficiencies, Kubernetes integration, and more.
NetApp Cloud Volumes ONTAP can help customers meet the performance, availability, and agility requirements of MySQL in a self-managed environment.
Cloud Volumes ONTAP allows you to leverage self-managed MySQL in Azure with enterprise capabilities, achieving the following benefits:
- Run any version of MySQL
- No limitations on instances configuration, scalability or storage volume
- No vendor lock-in
- No SLA limitations
- Pay only for actual resources used
- Full control over database configuration
- Full control over disaster recovery and data protection
In addition, Cloud Volumes ONTAP augments the Azure cloud storage layer with a set of storage management features and capabilities, uniquely suited to enterprise deployments, including:
- Hybrid deployments, supporting consistent deployment of MySQL workloads irrespective of whether they are deployed on-premises or in any cloud.
- Storage efficiency through deduplication, compression, and thin provisioning, which reduce storage footprint and monthly Azure storage costs.
- NetApp Snapshot™ copies for point-in-time, application-consistent database snapshots to recover the database in case of disaster or data corruption.
- Easy migration across hybrid environments through NetApp Cloud Sync service or SnapMirror® data replication.
- The Azure high availability architecture configuration assures zero data loss (RPO=0) and minimal recovery times (RTO< less than 60 seconds).
- Full support for other database engines, including Oracle, MySQL, MariaDB, MongoDB, and more.
- High performance through intelligent caching technology that reduces data access latencies.
- FlexClone® data cloning technology creates storage-efficient, writable clones of database volumes that can be used in testing and development scenarios.