The same database can be billed two ways: provisioned, a fixed size charged every hour, or serverless, charged every second for what it uses. Serverless sounds cheaper and often is, but its price per vCore is higher, and it can bill for memory you are not really using. This part works through the arithmetic, the break-even point, how to size from percentiles, and what you take on when you switch.
This is the seventh part of the Azure series and the second about money. Part 6 introduced the most important cost question, allocated or consumed?, as a rule of thumb. This part turns that rule into arithmetic, using the service where the choice matters most and costs most: a managed SQL database.
The example is Azure SQL Database, because it offers both models side by side and because databases are usually the largest compute line on a real application's bill. Everything here applies equally to other services that come in provisioned and serverless flavours. The Azure data services topic later goes deep into Azure SQL itself; this part only uses as much of it as the pricing needs.
All prices in this part are illustrative round numbers, chosen to keep the arithmetic readable. Real prices differ by region, tier, hardware and currency. The ratios between them are realistic, and the method is exactly what a real cost analysis does.
Azure SQL Database is SQL Server run by Microsoft as a PaaS service (Part 1): you get a database, not a server. A few terms are needed to read its pricing:
| Term | Meaning |
|---|---|
| Logical server | a named container for databases, with its own address and login settings. Not a machine: it holds no compute itself. |
| vCore purchasing model | you choose the number of vCores, and memory comes with them at a fixed ratio |
| Service tier | the architecture underneath: General Purpose (balanced, budget-friendly), Business Critical (lowest latency, several hot standby copies), Hyperscale (very large storage, fast scaling, separate compute and storage) |
| Compute model | provisioned (a fixed size) or serverless (sized automatically between a minimum and maximum) |
| HA replica | a standby copy of the database's compute, ready to take over if the primary fails |
| Read scale-out | sending read-only queries to a replica instead of the primary, so the replica does useful work |
| Named replica | an extra replica you create yourself, with its own size, for a separate workload such as reporting |
Hyperscale is worth one more sentence, because it explains why it scales so smoothly. Its storage is separate from its compute: the data lives in a distributed storage layer, and the compute nodes only cache what they use. So changing the compute size does not mean copying the data, which is why a Hyperscale database can be resized in minutes regardless of how big it is.
With provisioned compute, you choose a size, say 8 vCores, and that capacity is reserved for you around the clock. The bill is simple:
provisioned cost per hour = vCores provisioned × price per vCore-hour × number of copiesIt does not matter whether the database is busy or idle: 8 vCores are billed every hour. With one HA replica (Part 6: every copy is billed), that is 16 vCores every hour.
What you get for that predictability:
What you give up: the database does not grow on its own. If load rises above what 8 vCores can handle, queries slow down until someone (or some automation) makes it bigger.
With serverless compute, you set a minimum and a maximum number of vCores, and the database scales itself between them second by second, following the load. The bill follows what is used, measured per second.
The exact rule for Azure SQL serverless is worth reading carefully, because the details are where the surprises live. For each second, Azure works out three numbers and bills the largest:
billed vCores (each second) = the largest of:
vCores of CPU actually used
memory actually used ÷ 3 GB (memory converted into "vCore equivalents")
the configured minimum vCoresThe memory term is the one people miss. Serverless counts memory as well as CPU, at 3 GB of memory per vCore. A database using only 2 vCores of CPU but holding 30 GB of memory is billed for 10 vCores that second, because 30 ÷ 3 = 10 is the largest of the three numbers.
And each copy is billed this way separately: a serverless database with an HA replica pays for the primary's billed vCores and the replica's.
The advantages are real:
But the price per vCore-hour is higher than provisioned, typically around double. That single fact decides most of what follows.
Databases love memory. SQL Server keeps recently used data pages in memory (the buffer pool) so that the next query reading them does not have to go to storage. A busy database gradually fills that cache, because cached data makes queries fast, and it does not give memory back eagerly.
That is excellent for performance and bad for a serverless bill. Picture PhotoDrop's database a few months after launch:
| Measurement | Value |
|---|---|
| CPU actually used, on average | 1.5 vCores |
| Memory in use (mostly cache) | 18 GB |
| Configured minimum | 1 vCore |
| Billed vCores per copy | the largest of 1.5, 18 ÷ 3 = 6, and 1 → 6 |
| Copies (primary + HA replica) | 2 |
| Billed vCores around the clock | 12 |
The database is doing about 1.5 vCores of real work per copy, and being billed for 6. The "pay for what you use" model is faithfully billing for what it uses; it is just that what it uses is mostly memory holding cached data, not processor time.
At an illustrative serverless price of USD 0.50 per vCore-hour:
12 billed vCores × 0.50 × 730 hours ≈ USD 4,380 per month (≈ USD 52,600 per year)This is the most important lesson of the part: serverless bills whatever its formula measures, and for a busy, cache-heavy database running all day, that can be far more than the CPU work suggests.
When is each model cheaper? Compare the same database over an hour, with illustrative prices where serverless costs twice as much per vCore:
| Price per vCore-hour | Billed vCores | |
|---|---|---|
| Provisioned | USD 0.25 | the size you chose, every hour |
| Serverless | USD 0.50 | whatever the formula measures, each second |
Serverless is cheaper only when its average billed vCores are below half the provisioned size you would otherwise need. With these prices:
serverless is cheaper when: average billed vCores × 0.50 < provisioned size × 0.25
i.e. average billed vCores < provisioned size ÷ 2That gives a clean rule of thumb:
| Workload | Better fit | Why |
|---|---|---|
| Idle most of the day, with occasional use (dev, test, a small internal tool) | serverless | averages well under half a provisioned size; can even auto-pause |
| Unpredictable bursts with long quiet periods | serverless | pays for bursts only when they happen |
| Busy around the clock, fairly steady | provisioned | the average is high, so the lower per-vCore price wins |
| Large memory footprint relative to CPU | provisioned | serverless bills the memory; provisioned memory is included in the size |
PhotoDrop's development database is clearly serverless territory: it averages well under 1 vCore and sleeps at night. Its production database, billed for 12 vCores all day, is the opposite.
Moving to provisioned means choosing a size, and the obvious choice, the average CPU, is the wrong one. A database averaging 1.5 vCores of CPU may need more than twice that in its busiest hours; sized at the average, it would be slow exactly when it matters.
The right tool is percentiles. Take the CPU usage for every hour over a representative period, sort the hours from quietest to busiest, and read off:
| Percentile | Meaning | PhotoDrop example |
|---|---|---|
| p50 (median) | half the hours were at or below this | 1.5 vCores |
| p90 | 90% of hours were at or below this | 2.5 vCores |
| p99 | 99% of hours were at or below this; only the busiest 1% were higher | 3.5 vCores |
| max | the single busiest moment | 5 vCores, for a few minutes |
Then size for something like the p99, plus some headroom, and decide separately how to handle the rare moments above it. Sizing for the absolute maximum pays all year for a few minutes; sizing for the average guarantees regular slowdowns.
Memory needs a check too. On provisioned compute, memory comes with the vCores, so confirm the size you pick includes enough memory for the database's working set. Remember that much of a database's memory use is opportunistic cache, which simply fills whatever memory it is given; what matters is whether the data queried regularly fits. If 4 vCores come with about 20 GB and the regularly used data fits comfortably, 4 vCores is a reasonable size for PhotoDrop: p99 CPU of 3.5 plus a little headroom.
The provisioned cost, with an HA replica, at the illustrative USD 0.25:
4 vCores × 2 copies × 0.25 × 730 hours ≈ USD 1,460 per month (≈ USD 17,500 per year)Compared with about USD 52,600 a year on serverless, that is a saving of about two thirds, for the same database, the same data, the same HA replica, and comfortably enough capacity for the busy hours. The saving comes entirely from changing how it is billed. Part 8 then shows how a commitment takes a further large slice off the provisioned price; serverless cannot take that discount at all.
None of this works without real measurements, and Azure collects them for you. Azure Monitor records metrics for every database every minute: CPU percentage, memory percentage, how busy its worker threads are, failed connections, and for serverless databases the vCores actually billed. The full list is in the documentation for each service, and the same metrics drive alerts and dashboards.
A CPU percentage converts to vCores by multiplying by the size: 25% of a 16-vCore maximum is 4 vCores. Pair these metrics with the cost data from Cost Management (Part 6) over the same period, and the question "why does this cost so much?" usually answers itself: here is what was billed, here is what was used, here is the gap.
Moving to provisioned is not free of cost in other ways. You are handing back a job that serverless was doing for you, and the job has to land somewhere.
On serverless, a burst gets more vCores automatically. On provisioned, a burst above the size simply slows down until the size changes. So someone, or something, has to watch and react. The usual toolkit:
Scaling a provisioned database is a control-plane operation (Part 4), so it can be done from anything that talks to Resource Manager:
# Change the size of a provisioned database to 6 vCores
az sql db update --resource-group rg-photodrop-prod --server sql-photodrop-prod \
--name photodrop --capacity 6Changing the size is not invisible to the application. Even on Hyperscale, where no data has to move, the switch to the new size ends with a brief failover, and open database connections are dropped at that moment. Microsoft's general guidance for Azure SQL is the same for every such reconfiguration: they cause short-lived transient errors, and applications must be written to retry.
That turns a pricing decision into a code review. Before relying on regular scaling, a team needs to know:
These are not exotic concerns; they are the normal rules for any code that talks to anything over a network. Moving to provisioned compute just makes them non-optional.
Changing the compute model is just another update to the same database, so it can be changed back the same way. That reversibility is worth protecting: measure before and after, make sure the application copes with the switch, and keep the command to go back at hand. The one step that is not easily reversible is the commitment discount in Part 8, which is why it belongs at the end, once the new size has proven itself.
Provisioned compute bills a fixed size every hour at a low price per vCore; serverless bills each second for the largest of CPU used, memory used ÷ 3 GB, or the minimum, at roughly double the price per vCore, for every copy. Serverless wins for idle or bursty workloads (averaging under about half a provisioned size), and provisioned wins for busy, steady ones, especially cache-heavy databases whose serverless bill is driven by memory. Size provisioned capacity from percentiles, not averages, and remember what you take on: alerts, scaling, and code that survives dropped connections and safe retries.
Moving PhotoDrop's database from serverless to provisioned cut its compute cost by about two thirds. Part 8 covers the next lever, which only provisioned capacity can use: committing to it. Reservations, savings plans and Azure Hybrid Benefit, how each discount is actually applied hour by hour, and the rules for changing your mind.