Bird
Raised Fist0
Azurecloud~5 mins

DTU vs vCore pricing models in Azure - CLI Comparison

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Introduction
Choosing the right pricing model for Azure SQL Database helps you control costs and performance. DTU and vCore are two ways to pay for database resources, each with different benefits.
When you want a simple, fixed-price option that bundles compute, storage, and IO together.
When you need flexibility to scale compute and storage independently based on workload.
When you want to compare costs between Azure SQL and on-premises SQL Server licenses.
When you want to optimize costs for predictable workloads with fixed resource needs.
When you want to pay only for the compute and storage you actually use.
Commands
This command creates an Azure SQL Database using the DTU pricing model with the S3 tier, which bundles compute, storage, and IO resources.
Terminal
az sql db create --resource-group example-rg --server example-server --name example-db-dtu --service-objective S3
Expected OutputExpected
{ "databaseName": "example-db-dtu", "edition": "Standard", "requestedServiceObjectiveName": "S3", "status": "Online" }
→
--service-objective - Sets the DTU performance level (e.g., S3)
→
--resource-group - Specifies the Azure resource group
→
--server - Specifies the Azure SQL server name
This command creates an Azure SQL Database using the vCore pricing model with 4 vCores in the General Purpose tier, allowing independent scaling of compute and storage.
Terminal
az sql db create --resource-group example-rg --server example-server --name example-db-vcore --edition GeneralPurpose --family Gen5 --capacity 4
Expected OutputExpected
{ "databaseName": "example-db-vcore", "edition": "GeneralPurpose", "requestedServiceObjectiveName": "GP_Gen5_4", "status": "Online" }
→
--edition - Sets the service tier for vCore model
→
--family - Specifies the hardware generation (e.g., Gen5)
→
--capacity - Number of vCores to allocate
This command checks the details and status of the DTU-based database to confirm it is running with the expected performance level.
Terminal
az sql db show --resource-group example-rg --server example-server --name example-db-dtu
Expected OutputExpected
{ "databaseName": "example-db-dtu", "edition": "Standard", "requestedServiceObjectiveName": "S3", "status": "Online" }
This command checks the details and status of the vCore-based database to confirm it is running with the expected compute capacity.
Terminal
az sql db show --resource-group example-rg --server example-server --name example-db-vcore
Expected OutputExpected
{ "databaseName": "example-db-vcore", "edition": "GeneralPurpose", "requestedServiceObjectiveName": "GP_Gen5_4", "status": "Online" }
Key Concept

If you remember nothing else, remember: DTU bundles resources for simplicity, while vCore lets you scale compute and storage separately for flexibility and cost control.

Common Mistakes
Trying to specify vCore options like --family or --capacity when creating a DTU-based database.
DTU pricing model does not support independent compute or storage scaling flags.
Use --service-objective with DTU tiers like Basic, S1, S3 without vCore-specific flags.
Using the DTU model when you need to scale storage independently.
DTU bundles storage and compute, so you cannot scale them separately, leading to inefficient resource use.
Choose the vCore model to scale compute and storage independently.
Not checking the database status after creation.
You might assume the database is ready when it is still provisioning or failed.
Run az sql db show to verify the database is online and has the correct configuration.
Summary
Use az sql db create with --service-objective to create DTU-based Azure SQL Databases.
Use az sql db create with --edition, --family, and --capacity to create vCore-based Azure SQL Databases.
Check database status with az sql db show to confirm successful creation and configuration.

Practice

(1/5)
1. What does the DTU pricing model in Azure SQL Database combine into a single unit?
easy
A. Only memory resources
B. Only CPU resources
C. Storage and network bandwidth
D. CPU, memory, and I/O resources bundled together

Solution

  1. Step 1: Understand DTU components

    DTU stands for Database Transaction Unit, which bundles CPU, memory, and I/O into one unit for simple pricing.
  2. Step 2: Compare options to DTU definition

    Only CPU, memory, and I/O resources bundled together correctly lists CPU, memory, and I/O bundled together.
  3. Final Answer:

    CPU, memory, and I/O resources bundled together -> Option D
  4. Quick Check:

    DTU = bundled CPU, memory, I/O [OK]
Hint: DTU bundles CPU, memory, and I/O as one unit [OK]
Common Mistakes:
  • Thinking DTU is only CPU or memory
  • Confusing DTU with storage pricing
  • Assuming DTU separates resources
2. Which of the following is the correct way to describe the vCore pricing model?
easy
A. It lets you select CPU and memory separately
B. It bundles CPU, memory, and I/O into one unit
C. It charges only for storage used
D. It is only available for on-premises databases

Solution

  1. Step 1: Recall vCore pricing features

    The vCore model allows choosing CPU and memory independently for more control over resources.
  2. Step 2: Match options to vCore traits

    It lets you select CPU and memory separately correctly states that CPU and memory are selected separately, unlike DTU.
  3. Final Answer:

    It lets you select CPU and memory separately -> Option A
  4. Quick Check:

    vCore = separate CPU and memory selection [OK]
Hint: vCore separates CPU and memory choices [OK]
Common Mistakes:
  • Confusing vCore with DTU bundling
  • Thinking vCore charges only storage
  • Assuming vCore is for on-premises only
3. If a workload requires high CPU but moderate memory, which pricing model is better to optimize cost?
medium
A. vCore model because you can choose more CPU and less memory
B. DTU model because it bundles all resources
C. DTU model because it charges separately for CPU
D. vCore model because it bundles CPU and memory

Solution

  1. Step 1: Analyze workload needs

    The workload needs high CPU but only moderate memory, so flexibility in resource selection is important.
  2. Step 2: Compare pricing models for flexibility

    DTU bundles CPU and memory, so you cannot adjust them separately. vCore lets you pick CPU and memory independently, optimizing cost.
  3. Final Answer:

    vCore model because you can choose more CPU and less memory -> Option A
  4. Quick Check:

    High CPU + moderate memory = vCore better [OK]
Hint: Choose vCore for flexible CPU and memory [OK]
Common Mistakes:
  • Choosing DTU for flexible resource needs
  • Thinking DTU charges CPU separately
  • Confusing bundling in vCore
4. A user selects the DTU pricing model but wants to increase only memory without changing CPU. What is the issue?
medium
A. DTU allows only CPU scaling, not memory
B. DTU does not allow separate scaling of CPU and memory
C. DTU charges extra for memory upgrades only
D. DTU automatically scales memory without user input

Solution

  1. Step 1: Understand DTU scaling limits

    DTU bundles CPU, memory, and I/O, so you cannot scale memory independently without affecting CPU.
  2. Step 2: Identify the problem with user's request

    The user wants to increase only memory, which DTU does not support because of bundled resources.
  3. Final Answer:

    DTU does not allow separate scaling of CPU and memory -> Option B
  4. Quick Check:

    DTU = no separate CPU/memory scaling [OK]
Hint: DTU bundles resources; no separate scaling [OK]
Common Mistakes:
  • Thinking DTU allows memory-only scaling
  • Assuming DTU charges extra for memory only
  • Believing DTU auto-scales memory
5. A company has a workload with unpredictable spikes in CPU and memory usage. They want to minimize cost but maintain performance. Which pricing model and strategy should they choose?
hard
A. Use DTU model with a high DTU level to cover spikes
B. Use vCore model but fix CPU and memory to lowest levels
C. Use vCore model with autoscaling to adjust CPU and memory dynamically
D. Use DTU model and manually upgrade when spikes occur

Solution

  1. Step 1: Analyze workload characteristics

    The workload has unpredictable spikes in CPU and memory, requiring flexible resource adjustment to maintain performance.
  2. Step 2: Evaluate pricing models and strategies

    DTU bundles resources and requires fixed levels, so it is less flexible and may lead to overpaying. vCore supports autoscaling, allowing dynamic adjustment of CPU and memory to match demand and minimize cost.
  3. Step 3: Choose best option

    Use vCore model with autoscaling to adjust CPU and memory dynamically uses vCore with autoscaling, which fits the need for flexibility and cost control.
  4. Final Answer:

    Use vCore model with autoscaling to adjust CPU and memory dynamically -> Option C
  5. Quick Check:

    Unpredictable spikes = vCore + autoscaling [OK]
Hint: Autoscale CPU and memory with vCore for spikes [OK]
Common Mistakes:
  • Choosing fixed DTU for variable workloads
  • Manually upgrading DTU causing delays
  • Fixing vCore resources too low