Azure Database For MySQL Deployment [Step-By-Step]


Azure

Author: Sahil Hulage
Reviewer: Deepak Prasad

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.

 

Prerequisite

  • 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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

And we have Server Parameters here and you can configure them as per your Database optimization and best practice.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

And one more interesting feature is Private Endpoints which is nothing but you can have Private IP for your database with Private DNS.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

https://dev.mysql.com/downloads/workbench/

Azure Database For MySQL Deployment [ Step-By-Step]

 

After installing that launch the application. You can fill up the values Host Name and Username from Portal.

Azure Database For MySQL Deployment [ Step-By-Step]

 

And another method of connecting to the Database is using Azure Cloud Shell. As per the below image.

Azure Database For MySQL Deployment [ Step-By-Step]

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

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.

Azure Database For MySQL Deployment [ Step-By-Step]

 

If you drop down the Metric, you can see multiple parameters.

Azure Database For MySQL Deployment [ Step-By-Step]

And These are the benefits of using Database as a Platform as a Service.

 

Summary

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.

 

References

 

Sahil Hulage

Sahil Hulage

He possesses over 5+ years of experience as a Cloud Consultant, specializing in Azure DevOps and CloudLinux. With his expertise, he implements and optimizes cloud solutions, ensuring seamless operations and efficient resource management. You can connect with him on his LinkedIn profile.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to admin@golinuxcloud.com

Thank You for your support!!

Leave a Comment