DTU vs vCore in Azure SQL: Key Differences and When to Use Each
DTU (Database Transaction Unit) is a bundled measure of CPU, memory, and I/O resources, while vCore (virtual core) lets you choose CPU and memory separately for more flexibility. DTU is simpler for fixed workloads, and vCore offers better control and scalability for complex or variable workloads.Quick Comparison
This table summarizes the main differences between DTU and vCore purchasing models in Azure SQL.
| Factor | DTU Model | vCore Model |
|---|---|---|
| Resource Measurement | Bundled CPU, memory, and I/O as a single unit | Separate CPU cores and memory allocation |
| Flexibility | Fixed resource bundles, less flexible | Customizable resources for workload needs |
| Pricing | Simple, fixed price per DTU tier | Pay for actual vCores and memory used |
| Performance Transparency | Less clear resource allocation | Clear CPU and memory specs |
| Best For | Predictable, smaller workloads | Variable or large workloads needing scaling |
| Licensing | Included in price | Can use existing SQL Server licenses with Azure Hybrid Benefit |
Key Differences
The DTU model bundles CPU, memory, and I/O into a single unit, making it easy to pick a performance level without worrying about individual resources. This simplicity is good for beginners or predictable workloads but can limit fine-tuning.
In contrast, the vCore model separates CPU and memory, allowing you to choose exactly how many virtual cores and how much memory your database uses. This gives more control and transparency, especially for larger or variable workloads.
Pricing also differs: DTU pricing is fixed per tier, while vCore pricing is based on the number of cores and memory, plus optional license benefits. This makes vCore better for cost optimization and scaling.
Code Comparison
Here is an example of how you might create an Azure SQL database using the DTU model with Azure CLI.
az sql db create --resource-group myResourceGroup --server myServer --name myDatabase --service-objective S3
vCore Equivalent
Here is how to create the same Azure SQL database using the vCore model with Azure CLI.
az sql db create --resource-group myResourceGroup --server myServer --name myDatabase --edition GeneralPurpose --family Gen5 --capacity 4When to Use Which
Choose DTU when you want a simple, predictable pricing model and your workload is steady and not very large. It is great for beginners or small apps.
Choose vCore when you need more control over CPU and memory, want to optimize costs, or expect your workload to grow or vary. It is better for enterprise apps and scaling.