Options for Adding Relational Database to Kubernetes Cluster?

Siegfried Heintze 1,906 Reputation points
2020-10-21T16:22:35.207+00:00

Since I'd like to have the option of debugging my app on Docker for Desktop Kubernetes, I am trying to follow theses instructions in the book Kubernetes Up and Running 2nd Ed (KUAR) (page 181) to create a Reliable (Statefull) Singleton by creating a (1) persistent volume (2) a Pod that will run MySQL and (3) a service that will expose this pod to other containers.

Since I had trouble with MSSQL server on docker for desktop, I thought I would try postgresql or MySQL.

  1. If I were to use Azure SQL server instead of creating my own postreSQL or MySQL Kubernetes pod, would I still be able to run my app on my development destkop machine in Docker For Desktop/Kubernetes and have my web app connect to azure sql server from my desktop?
  2. I see that the KUAR book is creating an nfs-volume for maximum portability. Are there other options I should consider like azure-disks-dynamic-pv, azure-disk-volume or azure-nfs-volume that would work with PostgreSQL or MySQL? What might be the advantages?
  3. Let's assume that I am using just a tiny database to test my web app during development. I suspect using a nsf-volume, or azure-disk for PostgreSQL would be cheaper than a tiny database in Azure SQL Server. Is this true?

Thank you

Siegfried

Tue Nov 10 2020 Morning Update:

Ah! Connecting to that serverless database from SSMS on my development computer at home sounds good and I'd like to know (a lot!) more.

(1) Is Azure SQL the only candidate for serverless databases? While looking at the pricing calculator, I could not find the option for serverless MySQL or serverless PostgreSQL. If PostgreSQL & MySQL are options for serverless databases, please point me to the pricing calculator and the directions for creating them.

(2) I'd like to confirm that creating a tiny serverless SQL SVR database (1 MB data max) for development purposes will not cost me $528/mo for MS SQLSVR license fees. What defaults should I override to save money if I am not concerned about performance?

(3) I'd like to confirm that the pricing calculator for serverless (about $4.20/mo) includes the cost for the three steps of "az sql server create", "az sql server firewall create" and "az sql db create".

(4) I'd like to also confirm that after completing the those three steps and using the "--enable-public-network true" on the "az sql server create" step that I will be able to use SSMS or SQLCMD.EXE to manipulate the database in the absence of a kubernetess cluster with the port-forwarding feature (because I typically tear down my AKS clusters at the end of the work day to save money). If this is not true, please point me to the documentation to configure the proper network to use SSMS/SQLCMD on my home computer to access the serverless database. Please also confirm that I will be able to access this database from inside an AKS Cluster as well.

(5) Please explain the logic of having to "az sql server create" for a serverless database! This is confusing.

Fri Nov 20 2020 Update:
Another question: I thought there would be serverless cosmos available too but I could not find it in the pricing calculator. Did I miss it or does it not exist?

Tue Dec 8 2020 Morning Update:
This will be a tiny database containing sample data for developing a prototype web site (probably only a few megabytes) with some small simple queries a couple of times a day.

Fri Dec 11 2020 Update:
Let me retry rephrasing question #3. Please tell me about the charges for step 1 ("az sql create"). If this sits completely idle for couple of days, will there be any compute charges if there is no activity? I know from experience that there are significant daily compute charges for "az aks create" (with all the defaults) that sits completely idle for a couple of days. Apparently there are no compute charges for step 3 ("az sql db create") when this sits idle for a couple of days because this is the serverless part.

Thank you

Siegfried

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,902 questions
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
{count} votes

2 answers

Sort by: Most helpful
  1. prmanhas-MSFT 17,946 Reputation points Microsoft Employee Moderator
    2020-11-06T06:04:41.45+00:00

    @Siegfried Heintze Firstly, apologies for the delay in responding on this and any inconvenience this issue may have caused

    Below are answers to your queries:

    1. If I were to use Azure SQL server instead of creating my own postreSQL or MySQL Kubernetes pod, would I still be able to run my app on my development destkop machine in Docker For Desktop/Kubernetes and have my web app connect to azure sql server from my desktop?

    This is possible. You can just get the connection string from your Azure SQL instance and connect to it.

    2.I see that the KUAR book is creating an nfs-volume for maximum portability. Are there other options I should consider like azure-disks-dynamic-pv, azure-disk-volume or azure-nfs-volume that would work with PostgreSQL or MySQL? What might be the advantages?

    For storage, I would start here: https://learn.microsoft.com/en-us/azure/aks/operator-best-practices-storage. What storage you choose will depend on the application and performance requirements of your database workload. To get started, choosing a PV backed by a storage class that’s included with AKS by default (‘managed-premium’, ‘default’) is a good place to start for smaller apps.

    1. Let's assume that I am using just a tiny database to test my web app during development. I suspect using a nsf-volume, or azure-disk for PostgreSQL would be cheaper than a tiny database in Azure SQL Server. Is this true?

    It depends. With Azure SQL DB, there is serverless pricing, so if you don’t use it, you don’t pay for it. If you are already using AKS then you are just paying the additional storage costs for the database PVs. More information here:

    https://learn.microsoft.com/en-us/azure/azure-sql/database/serverless-tier-overview

    Hope it helps!!!

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics


  2. prmanhas-MSFT 17,946 Reputation points Microsoft Employee Moderator
    2020-12-10T16:52:19.97+00:00

    @Siegfried Heintze Apologies for the delay in responding on this and any inconvenience this issue may have caused.

    Is Azure SQL the only candidate for serverless databases? While looking at the pricing calculator, I could not find the option for serverless MySQL or serverless PostgreSQL. If PostgreSQL & MySQL are options for serverless databases, please point me to the pricing calculator and the directions for creating them.

    Azure SQL Database serverless is a new compute tier that optimizes price-performance and simplifies performance management for databases with intermittent, unpredictable usage. Serverless automatically scales compute for single databases based on workload demand and bills for compute used per second. Serverless databases automatically pause during inactive periods when only storage is billed and automatically resume when activity returns. Serverless helps users focus on building apps faster and more efficiently. So currently only Azure SQL is available in Azure as serverless database. You can indeed provide it as feedback on our User Voice Forum where our Product Group is active and post with highest number of upvotes are taken into consideration and worked upon.

    I'd like to confirm that creating a tiny serverless SQL SVR database (1 MB data max) for development purposes will not cost me $528/mo for MS SQLSVR license fees. What defaults should I override to save money if I am not concerned about performance?

    The cost for a serverless database is the summation of the compute cost and storage cost.
    When compute usage is between the min and max limits configured, the compute cost is based on vCore and memory used.When compute usage is below the min limits configured, the compute cost is based on the min vCores and min memory configured. When the database is paused, the compute cost is zero and only storage costs are incurred. The storage cost is determined in the same way as in the provisioned compute tier.

    You can refer to this for more information.

    I'd like to confirm that the pricing calculator for serverless (about $4.20/mo) includes the cost for the three steps of "az sql server create", "az sql server firewall create" and "az sql db create".

    You can refer to this for more information.

    Please explain the logic of having to "az sql server create" for a serverless database! This is confusing.

    You can refer to this article for more information.

    Another question: I thought there would be serverless cosmos available too but I could not find it in the pricing calculator. Did I miss it or does it not exist?

    You can refer to this article for information on Serverless cosmos. For Pricing related information you can refer to this.

    Hope it helps!!!

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.