Cost Analysis

Leo Shi 20 Reputation points
2025-04-17T08:23:08.1033333+00:00

Hi All,

I have recently started working on a database, It is a serverless database that is active 1-2 hours a day.

I want to have a better understanding of how the costing works.

Currently, my database is costing $4.25. How does this work? Does the charge get raised based on the number of SQL calls I make a day? Or is it the amount of data that I am inputting to the database?
For example, is it a bad practice if I am deleting an entire table just to update the table, or does it not matter, since it takes up the same amount of storage?

If I am refreshing the database constantly throughout the day, then would this incur a greater cost?

Thanks!

Azure SQL Database
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 27,556 Reputation points MVP Moderator
    2025-04-17T08:47:49.2633333+00:00

    Hi,

    You can check the pricing model here. Overall you are charged based on the number of vCores used per second and also for the provisioned storage per GB. In case you have auto-paused enabled once the database is paused your are not charged for the vCores but you are charged for the storage provisioned. Note that auto-pause is triggered when:

    • Number of sessions = 0
    • CPU = 0 for user workload running in the user resource pool

    So the prices does not increase if you make more SQL calls but if you have auto-paused configured and you make calls that will start the database the cost will increase. So in case you want to save on cost do not make SQL calls that are not necessary when the database is paused. As I have already mentioned you are charged for the provisioned database size not for the used and that charge is happening no matter if the database is paused or not. I would advise you when possible to update the table rather delete it and re-create it. The latter will most likely take more time to execute thus increases your usage of the database and decreases the time when the database can be paused (if pause configured). I do not know what do you mean by refreshing but every time you try to use the database (connect to it) and it was paused it will wake the database and additional cost will occur. Overall you have constant charge of the storage and charge about the vCores used based on the usage of the database if auto-paused is configured. In general if you have database that is used a lot I would configure the auto-pause to be not so aggressive. If you have database that is not used so much you can configure more aggressive auto-pause.

    Serverless compute tier for Azure SQL Database

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 121.1K Reputation points MVP Moderator
    2025-04-17T08:36:43.4833333+00:00

    Hi @Leo Shi ,

    please take a look here: Azure SQL Database pricing

    There are some information with cost influencing pieces for Azure SQL Databases (serverless):

    • Number of vCores
    • Amount of data
    • Backup storage

    I can't see any transaction related costs for Azure SQL Databases. This means it doesn't matter how many calls/queries or transactions (insert, updates, deletes) you are doing. Basically you have to pay for the vCores only. Means the more performance you need for your SQL transactions the more vCPUs you might need.


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten

    0 comments No comments

  2. Saraswathi Devadula 2,665 Reputation points Microsoft External Staff Moderator
    2025-04-17T17:16:07.0466667+00:00

    Hello Leo Shi

    In addition to Stanislav Zhelyazkov, please review the below information.

    Please be informed that Serverless is a compute tier for single databases in Azure SQL Database that automatically scales compute based on workload demand and bills for the amount of compute used per second.

    A compute autoscaling range and an auto-pause delay are important parameters for the serverless compute tier. The configuration of these parameters shapes the database performance experience and compute cost.

    The auto-pause delay is a configurable parameter that defines the period of time the database must be inactive before it is automatically paused. The database is automatically resumed when the next sign in or other activity occurs.

    The serverless compute tier also automatically pauses databases during inactive periods when only storage is billed and automatically resumes databases when activity returns.

    Note: I recommend you to please try to enable the auto pause option, so that you can reduce the cost of your database.

    Factors Affecting Serverless Database Costs

    1. Compute Charges: Serverless databases generally charge based on the compute resources consumed. This depends on factors such as the frequency of SQL queries, their complexity, and the active duration of the database. Higher usage of queries or resource-intensive operations can result in increased costs.
    2. Storage Charges: Costs are also influenced by the volume of data stored in the database, including tables, indexes, and additional elements. While deleting and recreating tables might not alter storage costs significantly if the overall data size remains constant, compute costs may rise due to the resources required for such operations.
    3. Data Transfer Costs: Accessing the database over the internet often incurs data transfer fees. Frequent reads and writes can amplify these charges.
    4. Concurrency and Scaling Costs: Charges can increase based on the number of concurrent connections or the dynamic scaling of resources required to meet application demands.

    Cost Scenarios:

    • Table Deletion and Recreation: The financial impact of deleting and recreating tables depends on the size of the data. While storage costs might remain unaffected, compute costs can rise due to the operations involved.
    • Frequent Refreshes: Regularly refreshing the database (e.g., running queries, inserting or updating records) can lead to higher compute costs due to resource consumption over prolonged active periods.

    Reference: https://learn.microsoft.com/en-us/azure/azure-sql/database/serverless-tier-overview?view=azuresql&tabs=general-purpose

    I hope this has been helpful!

    Your feedback is important so please take a moment to accept answers. If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    If this answers your query, do click Accept Answer and Upvote for was this answer helpful.


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.