Table of Contents
Overview On Azure Database for MySQL
Azure offers many Platforms as Services and Azure MySQL is one of the most used services. As every organization is moving towards the cloud and trying to minimize the management efforts of their infrastructure resource. And that’s why we have a good option to use databases as PaaS.
Likely Microsoft is supporting Open Source and most of the Microsoft workload is running on Linux OS. Its key that Microsoft is supporting Open-Source culture. Azure Database for MySQL is a relational database service powered by the MySQL community edition.
- Azure Subscription
- MySQL Client installed on the machine
- Basic Understanding about Databases
Step 01: - Deployment of Azure Database for MySQL
First, search the service Azure Database for MySQL in your subscription. As per the below image you can see the service under Database Service.
Before deploying the Database Server for MySQL, we must select the option for MySQL. Azure offers us two options one is a Single Server and the other is a Flexible server. Before choosing one of them let's understand the key difference between them.
Let’s talk about the key differences between these two options. Everything is the same apart from Single Server is that Flexible Server comes with HA Configuration, it Supports Zone Redundant HA and it gives us the flexibility to choose the underlying compute VM. Attaching the document link for the difference between these two options.
Now let’s proceed with deploying the Single Server option. As we all know creating any resource in azure would require following a basic wizard in which we have to specify the values requested to deploy that resource.
Server Name: We must specify the name of our MySQL Server name.
Data Source: Data source is nothing but if you want to use your backup database or existing one you can choose from here.
Location and Version are self-explanatory options.
Compute + Storage: With this option, we can choose the configuration for our Database.
Admin Username and Password is something that we have to set to access Database.
As per the below image you can see multiple SKU available for MySQL Server. We have three options here Basic, General Purpose, and Memory Optimized. For Production, General Purpose and Memory Optimized are recommended. And in Storage we have a feature of auto-growth it is really useful when we are running out of storage then it automatically scales the storage size.
In the next tab, you can see the additional setting, and here you can opt for an extra layer of security. You just have to opt-in for Data Encryption and check the box.
And then click on the Next tab it will take you to the Review and Create tab. Once you review everything click on Review + Create. And it will take 5-10 Min to deploy the database server for you.
Step 02: - Understanding MySQL Server key options
Once our service is deployed, we can see the Overview page as per the below image. In this pane on top, we have options to Start and Stop the server on demand. That is something very useful in the scenario where you want to save cost.
In the same pane you can see the Server Name using this you can access your server over the internet. And in the same, you can see the resource utilization and other things.
As part of every organization, security is an important aspect. And Azure Database for MySQL does offer us that feature. If you click on Connection Security, you can see the option to Deny Public Access that simply means you can block traffic from the internet. Then you can add, or whitelist specified IP addresses. In the same way, you can integrate your Database with Virtual Network so it can talk only over the Private IP.
And of course, you will integrate this database with your application. Then this PaaS Database provides us with the connections strings. As per the below image you can see the connection strings.
And we have Server Parameters here and you can configure them as per your Database optimization and best practice.
As discussed in the overview feature, we have the option to Add Read Replica here. Read Replica is nothing, but you add another copy of the database with continuous synchronization of the database.
And one more interesting feature is Private Endpoints which is nothing but you can have Private IP for your database with Private DNS.
Step 03: - How to connect to the Database
First download MySQL Workbench from the below link. And as per the below image, you can see the download page. Click on download and it will start downloading the setup file.
After installing that launch the application. You can fill up the values Host Name and Username from Portal.
And another method of connecting to the Database is using Azure Cloud Shell. As per the below image.
One thing to keep in mind is that you must whitelist your IP In Connection Security. As per the below image you can see I have added my IP before connecting to Database.
Step 04: - Monitoring the Azure MySQL Server
Monitoring the database is the key responsibility of every Database Administrator and azure makes it easy to monitor and understand the behavior of the application.
In Monitoring Pane, you have multiple options to monitor performance. We are using Metrics to understand the behavior of our Database.
If you drop down the Metric, you can see multiple parameters.
And These are the benefits of using Database as a Platform as a Service.
As in this article, we understood the deployment and benefits of using Managed Service on Azure especially in the case of using Database Service. It is used for performing database management functions at a flexible rate. The service is used to store volumes of data at a scale according to the server capacity chosen by the user company. Cost reduction is also the primary consideration for the company to move toward the managed database.
- Comparison chart - Azure Database for PostgreSQL Single Server and Flexible Server
- MySQL :: Download MySQL Workbench
- General availability: Azure Database for MySQL | Azure updates | Microsoft Azure