Domain 2 β€” Module 2 of 6 33%
9 of 30 overall
Domain 2: Design Data Storage Solutions Free ⏱ ~18 min read

Database Performance & Scalability

Service tiers, compute tiers, elastic pools, read replicas, and sharding β€” design a database architecture that scales with your workload without breaking the budget.

Why database performance design matters

Simple explanation

Choosing a database tier is like choosing a car. A city car (Basic/Standard) is cheap and fine for daily errands. A sports car (Premium) handles high performance. A truck (Hyperscale) carries massive loads. The wrong choice means you’re either overpaying or stuck in traffic.

The architect’s job: match the service tier to the workload pattern, design scalability for growth, and use cost optimisation techniques like reserved capacity and elastic pools.

Azure SQL Database service tiers

Azure SQL Database Service Tiers (vCore Model)
FactorGeneral PurposeBusiness CriticalHyperscale
Storage typeRemote storage (Azure Premium Storage)Local SSD (attached to compute)Multi-tier: local SSD cache + page servers
I/O latency5-10 ms (remote storage)1-2 ms (local SSD)Low (cached reads) to variable (uncached)
HA modelRemote storage replication (1 replica)Always On AG (3 replicas + local)Distributed architecture (named replicas)
SLA99.99%99.99% (99.995% zone-redundant)99.99% (99.995% zone-redundant)
Max database size4 TB4 TB100 TB
Read replicasNo built-in (use geo-replication)1 free read-only replicaUp to 4 HA replicas + up to 30 named replicas (independently scalable)
Serverless optionYesNoYes (but auto-pause only in GP, not Hyperscale)
OLTP optimisedStandard workloadsHigh-performance OLTPVariable β€” scales with demand
Best forMost workloads, budget-consciousLow-latency, mission-critical OLTPVery large databases, unpredictable workloads, fast scaling

🏦 Elena’s tier selection: FinSecure Bank’s trading platform needs sub-2ms query latency for real-time risk calculations. Elena chose Business Critical because:

  • Local SSD storage delivers 1-2ms I/O (General Purpose’s 5-10ms would cause trading delays)
  • Built-in read replica offloads reporting queries without affecting the trading engine
  • Always On AG provides automatic failover β€” no manual intervention during outages

πŸš€ Marcus’s approach: NovaSaaS’s tenant databases vary wildly in size (some customers have 50 GB, others have 5 TB). Marcus uses Hyperscale because:

  • Scales to 100 TB without pre-provisioning storage
  • Named replicas let different tenants get different compute levels
  • Near-instant database snapshots for backup (no I/O impact)

Provisioned vs serverless compute

Provisioned vs Serverless Compute
FactorProvisionedServerless
ComputeFixed vCores β€” always allocatedAuto-scales between min and max vCores
BillingPer-hour for allocated computePer-second for actual compute used
Auto-pauseNo β€” always runningYes β€” pauses after configurable idle period (min 1 hour)
Cold startNone~10-30 seconds after auto-pause resume
Best forPredictable, consistent workloadsDev/test, intermittent usage, variable workloads
Exam tip: Serverless is not always cheaper

Serverless billing is per-second based on actual vCore usage. For databases with consistent load (e.g., always using 4 vCores during business hours), provisioned compute with reserved capacity (1 or 3 years) is significantly cheaper. Serverless shines when the database is idle 50%+ of the time.

Scalability patterns

Elastic pools: shared resources for many databases

Elastic pools share compute and storage across multiple databases β€” ideal when databases have variable usage patterns that don’t peak simultaneously.

FactorIndividual DatabasesElastic Pool
ComputeEach database has its own allocationShared pool β€” databases borrow from each other
CostPay for peak capacity per databasePay for pool capacity β€” smoother cost curve
Best forPredictable, isolated workloadsMulti-tenant SaaS, variable usage patterns
LimitsPer-database DTU/vCore limitsPer-pool eDTU/vCore limits, per-database min/max

πŸš€ Marcus’s multi-tenant design: 500 tenant databases, each averaging 10 DTUs but occasionally spiking to 50 DTUs. Instead of provisioning 50 DTUs per database (25,000 total), Marcus uses an elastic pool with 5,000 eDTUs β€” because tenants spike at different times, the pool handles peaks efficiently.

Read scale-out

PatternHow It WorksBest For
Business Critical read replicaBuilt-in free read-only replicaReporting queries, dashboards (same region)
Active geo-replicationReadable secondary in another regionDR + read offloading in a different region
Hyperscale named replicasUp to 4 independently scalable replicasDifferent workload isolation (OLTP vs analytics)

Horizontal sharding

For workloads that exceed single-database limits:

ApproachDescriptionComplexity
Application-level shardingApp routes queries to the right shardHighest flexibility, highest dev effort
Elastic database toolsAzure SDK for shard map managementMedium β€” Microsoft provides the framework
Cosmos DBBuilt-in horizontal partitioningLowest effort (but it’s NoSQL, different paradigm)
Well-Architected Framework connection

Performance Efficiency: Right-size your tier to the workload. Over-provisioning wastes money; under-provisioning causes latency.

Cost Optimisation: Reserved capacity (1 or 3 years) saves 30-65% vs pay-as-you-go. Elastic pools reduce per-tenant cost for variable workloads. Serverless saves on idle databases.

Reliability: Read replicas improve availability and offload read traffic. Geo-replication enables cross-region DR.

Knowledge check

Question

When should you recommend Business Critical tier over General Purpose?

Click or press Enter to reveal answer

Answer

When the workload needs sub-2ms I/O latency (local SSD vs remote storage), a built-in free read replica, or the highest HA guarantee (local Always On AG with 3 replicas). Common scenario: mission-critical OLTP like trading systems or real-time transaction processing.

Click to flip back

Question

What is the primary benefit of elastic pools?

Click or press Enter to reveal answer

Answer

Cost efficiency for multiple databases with variable, unpredictable usage patterns. Databases share a pool of compute resources, so you pay for the pool capacity rather than peak capacity per database. Ideal for multi-tenant SaaS where tenants spike at different times.

Click to flip back

Question

When is Hyperscale the right choice?

Click or press Enter to reveal answer

Answer

Three scenarios: (1) databases larger than 4 TB (Hyperscale supports up to 100 TB), (2) unpredictable workloads needing fast scale-up/down, (3) need for named replicas with independent compute scaling. Also offers near-instant backups regardless of database size.

Click to flip back

Knowledge Check

🏦 FinSecure Bank's trading application requires sub-2ms database query latency, automatic failover, and the ability to offload reporting queries to a read-only copy. The database is 500 GB. Which tier and feature should Elena recommend?

Knowledge Check

πŸš€ NovaSaaS has 300 tenant databases. Usage varies: most databases use 5-10 DTUs but occasionally spike to 40 DTUs. Peak usage across tenants doesn't overlap. Marcus wants to minimise cost. Which approach should he recommend?


Next up: Performance is optimised β€” now let’s protect that data β€” Database Security & Compliance.