Mysql deployment on AKS vs Azure database for mysql question

sql user 86 Reputation points

I would like to deploy Mysql for an application running on Azure kubernetes service. I would like to decide whether i would go for mysql as a pod as part of AKS or should i use Azure database for mysql as managed service?. I would like to understand the pros and cons for each deployment ?.

Pls help.

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
466 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,196 questions
No comments
{count} votes

Accepted answer
  1. shiva patpi 9,661 Reputation points Microsoft Employee

    Hello @sql user ,
    Thanks for reaching out to Microsoft Q&A. It's a very good question but there is no straightforward answer. Please read out...

    If you go for MySQL as a POD

    1) As Kubernetes PODs are stateless , you will have to deploy those PODS as a statefulset
    2) You will have to create corresponding PV , PVC & use the storage classes.
    3) Those statefulset should pods should be backed by a Managed Disk ( This is one of typical approach to setup persistent storage in an Azure cloud environment is to use Azure Managed Disks. So, when its pod is terminated and recreated, the data can be re-attached to the MySQL pod. They are attached to only one VM Node where its containing pods can only read/write to. As a result, there is relatively tighter security and lower latency between the VM Node and Azure Managed Disk. )
    4) If the application is running in AKS and if the database needs to be accessed only by that running application - this will be the preferred approach !
    5) Deployments wise it's easily manageable using YAML files and scalable depending upon the load.

    But the availability of the database depends on the AKS cluster resource health

    See the article:

    To gain the benefits of using a MySQL database in a Kubernetes application, one of the common strategies is to provision the database in a container running in a pod. In doing so, the database will use the cluster resources. Accessing the database from other pods in the same AKS cluster running client apps is possible via Kubernetes networking. However, if for some reason cluster resources become unavailable, both the application and the database will be unavailable, as both rely on cluster health.

    Using Azure database for mysql is one of the simplest options for sure!

    To address the issue of cluster resources being shared between the application and database, you can substitute the local database in AKS with Azure Database for MySQL, which separates the database from the AKS cluster. Thus, cluster resources will remain focused on delivering infrastructure required to run the app and database availability will not be impacted by AKS availability.

    Read out the below complete article:-

    Also consider the pricing factors for Azure SQL PAAS DB Service:

    Let us know if that helps in taking a decision!

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful