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: https://techcommunity.microsoft.com/t5/azure-database-for-mysql-blog/provisioning-azure-database-for-mysql-single-server-from-aks/ba-p/2695317
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:-
https://irp-cdn.multiscreensite.com/61571848/files/uploaded/Azure%20Database%20for%20MySQL%20and%20Azure%20Kubernetes%20Service_c9j3WTi8R9qC6rWHsAZ5.pdf
https://roykim.ca/2020/05/19/database-patterns-with-azure-kubernetes-service-part-1-mysql-azure-managed-disk/
Also consider the pricing factors for Azure SQL PAAS DB Service: https://azure.microsoft.com/en-in/pricing/details/mysql/server/
Let us know if that helps in taking a decision!