Azure SQL Database – Scaling

← Back to Docs

Overview

Azure SQL Database provides flexible scaling options to match workload demands while controlling costs. Choose between the DTU‑based or vCore‑based purchasing models, leverage elastic pools for multi‑database scenarios, and enable auto‑scale to react to usage spikes automatically.

Key Concepts

DTU‑Based Model

The DTU model provides predefined performance tiers. Use the az sql db update command to scale.

az sql db update \\
  --resource-group MyResourceGroup \\
  --server myserver \\
  --name mydatabase \\
  --service-objective S3

Available Tiers

TierDTUsMax SizeRecommended For
Basic52 GBDevelopment & small apps
Standard S110250 GBLight production workloads
Standard S31001 TBMedium workloads
Premium P1125500 GBHigh‑performance OLTP

vCore‑Based Model

The vCore model decouples compute and storage, offering more predictable performance.

Scaling Compute

az sql db update \\
  --resource-group MyResourceGroup \\
  --server myserver \\
  --name mydatabase \\
  --capacity 4 \\
  --family Gen5 \\
  --tier GeneralPurpose

Pricing Tiers

Elastic Pools

Group databases that have variable usage patterns to share a pool of DTUs or vCores.

Create a Pool (vCore)

az sql elastic-pool create \\
  --resource-group MyResourceGroup \\
  --server myserver \\
  --name mypool \\
  --capacity 8 \\
  --family Gen5 \\
  --tier GeneralPurpose

Assign a Database to the Pool

az sql db update \\
  --resource-group MyResourceGroup \\
  --server myserver \\
  --name mydatabase \\
  --elastic-pool-name mypool

Auto‑scale

Azure Monitor autoscale can adjust the vCore count based on CPU usage.

Enable Autoscale

az monitor autoscale create \\
  --resource /subscriptions/xxxx/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/servers/myserver/databases/mydatabase \\
  --name sql-db-autoscale \\
  --min-count 2 --max-count 16 --count 4

Scale Rules Example

{
  "rules": [
    {
      "metricTrigger": {
        "metricName": "cpu_percent",
        "metricNamespace": "Microsoft.Sql/servers/databases",
        "timeGrain": "PT1M",
        "statistic": "Average",
        "timeWindow": "PT5M",
        "timeAggregation": "Average",
        "operator": "GreaterThan",
        "threshold": 70
      },
      "scaleAction": {
        "direction": "Increase",
        "type": "ChangeCount",
        "value": "2",
        "cooldown": "PT5M"
      }
    },
    {
      "metricTrigger": {
        "metricName": "cpu_percent",
        "operator": "LessThan",
        "threshold": 30
      },
      "scaleAction": {
        "direction": "Decrease",
        "type": "ChangeCount",
        "value": "2",
        "cooldown": "PT5M"
      }
    }
  ]
}

Performance Monitoring

Use Query Performance Insight and Azure Monitor metrics to understand when to scale.

Frequently Asked Questions

Can I switch between DTU and vCore models?
Yes. Use az sql db update --service-objective for DTU or change the tier to vCore. A brief downtime may occur.
How long does a scaling operation take?
Most scaling actions complete within 5‑10 minutes, depending on the target tier.
What happens to my data during scaling?
Data remains online; Azure performs a live migration to the new compute resources.