2
votes

I am unable to locate the cost per transaction for a Azure SQL Database. https://docs.microsoft.com/en-us/azure/sql-database/sql-database-single-databases-manage

I know the SQL Server database is about 5$ per month but how much for the transactions?

If I go to the Azure Pricing Calculator (https://azure.microsoft.com/en-us/pricing/calculator/) they do not seem to have the info. They list the price for a single database as $187.77 so that is not the same service as they one you create if you use the link above.

2
its based on your usageAjay2707
@Ajay2707 But how is "usage" defined and calculated? Is it primarily IO-based or CPU-based? What about DB size vs DB read/write intensity?Dai
I am trying find out: Lets say i perform 1 million inserts (transactions). What would that cost me (approximately)?Tony

2 Answers

4
votes

TL;DR:

Azure SQL pricing is "flat": first you choose a performance level for your database which has a fixed cost (e.g. S6 for $580/mo or S1 for $30/mo), and this is billed by the second. Azure does not bill your account for actual IO/CPU usage.

The rest:

There is no single "cost per transaction" because a "transaction" is not a single uniform amount of work for a database server (e.g. a single SELECT over a small table with indexes is significantly less IO and CPU intensive compared to a MERGE over millions of rows).

There three different types of Azure-SQL deployment in Azure, with their own different formulas for determining monthly cost:

  • Single database (DTU)
  • Single database (vCore)
  • Elastic pool
  • Managed Instance

I assume you're interested in the "single database" deployment types, as "Managed instance" is a rather niche application and "Elastic pool" is to save money if you have lots (think: hundreds or thousands) of smaller databases. If you have a small number (e.g. under 100) of larger databases (in terms of disk space) then "Single database" is probably right for you. I won't go into detail on the other deployment types.

If you go with DTU-based Single Database deployment (which most users do), then the pricing follows this general formula:

Monthly-price = ( Instances * Performance-level )

Where Performance-level is the selected SKU for the minimum level of performance you need. You can change this level up or down at will at any point in time as you're billed by the second and not per month (but per-second pricing is difficult to work into a monthly price estimate)

A "DTU" (Database Throughput Unit) is a unit of measure that represents the actual cost to Microsoft of running your database, which is then passed on to you somewhat transparently (disregarding whatever profit-margin Microsoft has per-DTU, of course).

When determining what Performance-level to get for your database you should select the performance level that offers the minimum number of DTUs that your application actually needs (you determine this through profiling and estimating, usually by starting off with a high-performance database for a few hours (which won't cost more than a few dollars) and running your application code - if the actual DTU usage numbers are low (e.g. you get an "S6" 400 DTU (~$580/mo) database and see that you only use 20 DTUs under normal loads then you can safely leave it on the "S1" 20DTU (~$30/mo) performance level

The question about what a DTU actually is has been asked before, so to avoid creating a duplicate answer please read that QA here: Azure SQL Database "DTU percentage" metric

0
votes

It is based on your requirement, I am using a single instance Azure SQL Database, so basically based on your cpu cost and your transaction limit and space called 'DTU'. For this totally based on your requirement.

If it is in VM (Virtual machine), that applied your vm cost and your sqlserver cost (if you do not have licence of sqlserver).

Cost https://azure.microsoft.com/en-us/pricing/calculator/