1. Data Storage Decision Framework

Start with access patterns, not product names. Walk this flowchart for every data requirement:

What is the data shape & access pattern?
Unstructured blobs / files / media?
Yes → Blob Storage / Data Lake Gen2
No ↓
Relational with complex joins / ACID transactions?
Yes → Azure SQL / PostgreSQL Flexible Server
No ↓
Global distribution or single-digit-ms latency needed?
Yes → Cosmos DB
No ↓
Simple key-value lookups, low cost?
Yes → Table Storage / Cosmos DB Table API
No ↓
Caching / session state / sub-ms reads?
Yes → Azure Cache for Redis
No → Re-evaluate requirements

2. Decision Axes

AxisKey QuestionImpact
Data ModelRelational / document / key-value / graph?Dictates service family
ConsistencyStrong ACID or eventual OK?Strong → SQL; Eventual → Cosmos DB
ScaleGBs, TBs, or PBs?PB-scale → Data Lake Gen2
Query ComplexityMulti-table joins / aggregations?Complex → Azure SQL / PostgreSQL
Global DistributionMulti-region writes needed?Yes → Cosmos DB (only turnkey option)
Cost SensitivityBudget-constrained?Table Storage cheapest; Cosmos DB premium

3. Service Comparison Matrix

ServiceData ModelMax ScaleConsistencyLatencyCost TierBest For
Azure SQLRelational100 TBStrong (ACID)~2-5 ms$$–$$$OLTP, complex queries
Cosmos DBMulti-modelUnlimited5 levels (tunable)<10 ms (P99)$$$Global, low-latency
PostgreSQL FlexRelational16 TBStrong (ACID)~2-5 ms$$OSS compatibility
MySQL FlexRelational16 TBStrong (ACID)~2-5 ms$$LAMP / WordPress
Table StorageKey-value500 TBStrong (per-entity)~5-10 ms$Simple lookups, IoT
Blob StorageUnstructured5 PB per accountStrong~10-50 ms$Files, backups, media
Data Lake Gen2Hierarchical files5 PB per accountStrong~10-50 ms$Big data analytics
Redis CacheIn-memory KV120 GB (clustered TBs)Eventual<1 ms$$–$$$Caching, sessions

4. Workload Archetypes

  • OLTP with complex queriesAzure SQL Database — joins, stored procs, strong consistency
  • Global low-latency document/key-valueCosmos DB — multi-region writes, guaranteed <10 ms
  • Open-source compatibilityPostgreSQL Flexible Server — extensions, pgvector, no vendor lock-in
  • Unstructured files / mediaBlob Storage — tiered (Hot/Cool/Archive), CDN-friendly
  • Big data / analytics pipelineData Lake Gen2 — hierarchical namespace, Spark/Synapse integration
  • Session state / cachingAzure Cache for Redis — sub-ms reads, pub/sub, distributed locks
  • Simple key-value (budget)Table Storage or Cosmos DB Table API — cheapest structured option

5. Polyglot Persistence

Modern architectures use multiple data stores — each optimized for its access pattern. This is polyglot persistence:

Principle: No single database excels at everything. Choose the right store for each bounded context rather than forcing all data into one engine.
  • Benefit: Each service operates at its optimal cost/performance point
  • Trade-off: Increased operational complexity, eventual consistency between stores
  • Mitigation: Use managed services (reduce ops), event-driven sync (Change Feed, Event Grid)

6. Real-World: E-Commerce with 4 Data Stores

Scenario: Contoso Commerce serves 2M users across 3 continents. Their architecture uses four data stores:

Data DomainAccess PatternChosen ServiceRationale
Orders & InventoryComplex joins, ACID transactionsAzure SQL (Business Critical)Referential integrity, stored procs
Product CatalogGlobal reads, flexible schemaCosmos DB (Session consistency)Multi-region, <5 ms reads worldwide
User SessionsSub-ms reads, 30-min TTLAzure Cache for Redis (P1)In-memory speed, auto-expiry
Product ImagesLarge blobs, CDN-servedBlob Storage (Hot) + CDNCheapest per-GB, lifecycle policies

Sync Pattern: Order events publish to Event Grid → Cosmos DB Change Feed updates catalog availability → Redis cache invalidated via pub/sub.

Result: P99 latency <50 ms globally, 60% storage cost reduction vs. all-SQL approach.

7. Exam Tip

⚠️ AZ-305 Exam: Data storage questions test whether you pick the least expensive service that meets all stated requirements. Watch for these traps:
  • "Global distribution" or "multi-region writes" → only Cosmos DB provides turnkey multi-master
  • "Complex joins across tables" → Cosmos DB is wrong; choose Azure SQL or PostgreSQL
  • "Lowest cost for simple key-value" → Table Storage, not Cosmos DB (unless global needed)
  • "Sub-millisecond reads" → Redis Cache, not any disk-based store

8. Knowledge Check

Q1: An application requires multi-region writes with guaranteed <10 ms latency for document reads. Which service?

Q2: A financial application needs complex multi-table joins with strict ACID transactions. Which service?

Q3: An IoT solution stores billions of simple key-value telemetry records. Cost is the primary concern. Which service?

Q4: Which pattern describes using multiple specialized data stores within a single application architecture?