Azure Database for MySQL Flexible Server – a fully managed service running community version by Parikshit Savjani

This article first appeared in the SQLServerGeeks Magazine.
Author: Parikshit Savjani 
Subscribe to get your copy.

The year 2021 has started as an eventful year and continuous to be challenging times for people, businesses and economies around the world. As our CEO Satya Nadella puts it – “We have seen two years of digital transformation in two months”. The Azure Database for MySQL service is at the heart of this transformation empowering online education, video streaming services, digital payment solutions, e-commerce platform, gaming services and govt and healthcare websites to support unprecedented growth, save cost and enable our customers to scale. It is immensely satisfying to see Azure Database for MySQL service is enabling our customers to meet the growing demands for their services during these critical times. Azure database for MySQL service with community version of MySQL is powering mission critical applications and services like healthcare services for Denmark citizens, digital payment application for Hong Kong citizens, music and video streaming platforms for Indian, Korean and Japanese citizens, online news websites, mobile gaming services including our very own Minecraft Realms.

What applications run on MySQL?
MySQL is one of the popular choices of database engine for designing internet scale consumer applications. Internet scale consumer applications are highly transactional online applications with short chatty transactions against a relatively small database size. These applications are typically developed in Java or Php framework and migrated to run on Azure VMs, Azure App Services or containerized to run on Azure Kubernetes Services (AKS). The database is typically required to scale high volume of incoming transactions. Majority of our customers leverage proxysql load balancer proxy and read replicas, to scale out and meet the workload demands for their business. MySQL 5.7 and 8.0 continuous to be the popular choice for our customers which enables them to meet their performance and scale goals.

What is Flexible Server in Azure Database for MySQL?
With over two years since general availability of Azure Database for MySQL , we’ve listened and learned a lot from you who use our MySQL managed database service on Azure. As a developer, you appreciate the ease of provisioning, built-in high availability, and manageability of fully managed service. But for some of you, moving to a managed service can be seen as loss of database level control and flexibility when it comes to configuring your MySQL servers—which has prevented you from taking advantage of the benefits of a managed service but hopefully, not anymore.

Now in preview: Introducing Azure Database for MySQL – Flexible Server

We designed the new Flexible server deployment option for MySQL with these goals in mind:
• Simplify developer experiences – Make it easier for you to quickly onboard, connect, and get started.
Maximize Database Controls – Provide maximum control on your server configurations to provide experiences at par with running your own MySQL deployments.
More Cost Optimization Controls – Provide more options for you to optimize and save costs.
Enable Zone Resilient & Aware Applications – Allow you to build highly available, zone resilient and performant applications, with your MySQL database co-located in the same zone, so you can tolerate zone level failures.

Let us now dive into what you can expect from the new Flexible server deployment option on Azure Database for MySQL—as well as a bit about what your experience will be like.

Create a Flexible server with single Azure CLI command
As a developer, you are probably familiar with Azure CLI commands in Azure Cloud Shell. Now, you can create a new Flexible server deployment option for MySQL using a single Azure CLI command, as shown below:

Requires Azure CLI > 2.12.0 or Azure Cloud Shell

az mysql flexible-server create -l location

As of today, Flexible Servers offering for Azure Database for MySQL is live in 14 Azure regions. You can check our documentation for most up to date information.

Use familiar tools to connect to your server & it just works!
With Flexible Server deployment option for MySQL, you can use familiar tools like MySQL Workbench and drivers to connect and it just works !!!.

If you would like to get a guided quick start, I recommend you start here. Here is the detailed list of commands you can expect.

More Server Parameter Control with Flexible Server
With Flexible Server, we have exposed 30% more parameters compared to Single server which you can now modify and customize based on the needs and dependencies of your application.

Network Isolation Control
With Flexible Server on Azure Database for MySQL, you can run and select your server to be in either be in public access mode or secure it in private access mode.

With Private access, you can deploy your Flexible server into your Azure Virtual Network. Azure virtual networks provide private and secure network communication. Resources in a virtual network can communicate through private IP addresses only. Flexible server in private access mode has no public endpoints and cannot be reached from outside the virtual network. In addition, you can create a flexible server in virtual network using a single command show below. The subnet should not have any other resource deployed in it and this subnet will be delegated to Microsoft.DBforMySQL/flexibleServers, if not already delegated. See Networking concepts for more details.

az mysql flexible-server create –subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNetName}/subnets/{SubnetName}

By default, SSL is enabled with TLS 1.2 encryption enforced but it can be disabled by setting the require_secure_transport to OFF from portal.

Control your Planned Maintenance schedule
The service performs automated patching of the underlying hardware, OS, and database engine. The patching includes security and software updates. For MySQL engine, minor version upgrades are also included as part of the planned maintenance release. When managing and running mission critical business application, it is critical for you to be able to control the maintenance schedule as it directly impacts the availability of the database server and application for your business. You may also want to test the impact of the patch on your application behavior and performance. This is where you may want to apply and release

the patch on pre-production and test environments first as soon as service releases it to test it and plan to roll out in production at a later schedule. With the new Flexible Server option for Azure Database for MySQL, you can now schedule your maintenance at a time which works best for you. From the Maintenance blade in Azure portal, you can specify the day of the week and 1 hour time window in a month, which works best for you to perform server patching which may involve restarts. For more details, refer Scheduled Maintenance concepts.

Scale out your workload with up to 10 read replicas
MySQL is one of the popular database engines for running internet-scale web and mobile applications. Many of our customers use it for their online education services, video streaming services, digital payment solutions, e-commerce platforms, gaming services, news portals, government, and healthcare websites. These services are required to serve and scale as the traffic on the web or mobile application increases.

On the applications side, the application is typically developed in Java or php and migrated to run on  Azure virtual machine scale sets or Azure App Services or are containerized to run on Azure Kubernetes Service (AKS). With virtual machine scale set, App Service or AKS as underlying infrastructure, application scaling is simplified by instantaneously provisioning new VMs and replicating the stateless components of applications to cater to the requests but often, database ends up being a bottleneck as centralized stateful component.

The read replica feature allows you to replicate data from an Azure Database for MySQL flexible server to a read-only server. You can replicate from the source server to up to 10 replicas. Replicas are updated asynchronously using the MySQL engine’s native binary log (binlog) file position-based replication technology. You can use a load balancer proxy solution like ProxySQL to seamlessly scale-out your application workload to read replicas without any application refactoring cost.

See Read Replica concepts to learn more.

Start with burstable SKUs starting at $13 per month
This has been one of the long standing asks from many of you looking to use MySQL server for personal projects or development purposes. With Flexible Server on Azure Database for MySQL, you can now start with a burstable SKU if your workload doesn’t need 100% of CPU time all the time. Burstable SKUs are generally preferred for dev/test scenarios. The lowest available burstable compute tier B1S starts at $13 per month. See Compute and Storage sizes in documentation for more details.

Stop your server when not in use to save cost!
This is again one of the highly requesting asks from many of you who are looking to save compute cost when not in use by simply stopping the server. See Server concepts for more details.

Build Zone resilient applications with Flexible Server
With Azure Kubernetes Services (AKS) or Virtual Machine Scale sets, you can build and deploy zone resilient application that can tolerate zonal failures. With Flexible server on Azure Database for MySQL, you can now enable zone redundancy for your MySQL database server as well.
When you enable zone redundant high availability for your MySQL server with Flexible server, the service provisions a hot standby server on the secondary availability zone with synchronous replication of data. In case of zonal failures, the MySQL database server will automatically failover to bring the standby server on secondary availability zone online to ensure your applications and database is highly available and fault tolerant to Availability zone level failures. See high availability concepts for more details

Here is the latest update on MySQL Flexible Server release –
MySQL 8.0.21, Zone placement, and IOPs scaling now available in Flexible Server!!! -Microsoft Tech …

Getting Started
You can quickly get started by creating your first server using the quickstarts in our documentation on docs.microsoft.com:
Create an Azure Database for MySQL Flexible server using Azure portal
Create an Azure Database for MySQL Flexible server using Azure CLI
Create an Azure Database for MySQL Flexible server using ARM template
To learn more, you can read our Flexible server documentation for MySQL.

For any questions or suggestions you might have about working with Azure Database for MySQL, you can send an email to the (Ask Azure DB for MySQL. To provide feedback or request new features, we would appreciate it if you could make an entry via UserVoice which can help us to prioritize.

Flexible server is available in preview on Azure Database for MySQL, with no SLAs and hence is not meant for production deployments yet. Single Server deployment option continues to be our enterprise-ready platform, supporting mission critical application and services as I shared in my last service update.

To help you compare Single server and Flexible server for Azure Database for MySQL so you can figure out which deployment option is right for you, we’ve created a handy feature comparison matrix for you in our documentation.

This article first appeared in the SQLServerGeeks Magazine.
Author: Parikshit Savjani 
Subscribe to get your copy.

Leave a Reply

Your email address will not be published. Required fields are marked *