Domain 5 β€” Module 2 of 7 29%
23 of 28 overall
Domain 5: Maintain an Azure Cosmos DB Solution Free ⏱ ~14 min read

Backup and Restore: Periodic vs Continuous

Choose between periodic and continuous backup for Cosmos DB, configure backup policies, understand point-in-time restore, and know the cost and operational implications of each.

Backup: your safety net

Simple explanation

Think of backups like snapshots of your entire filing cabinet. Periodic backup takes a photo every few hours β€” if something goes wrong, you can restore from the last photo, but you lose changes since then. Continuous backup records every change as it happens β€” you can rewind to any second.

Marcus’s backup strategy

βš™οΈ Marcus at FinSecure handles financial data with strict RPO (Recovery Point Objective) requirements:

  • Transaction database: RPO = 0 seconds (continuous backup, 30-day retention)
  • Analytics database: RPO = 4 hours (periodic backup, cost-effective)
  • Compliance requirement: All restores must be to a new account for audit isolation

Periodic backup

The default backup mode. Cosmos DB takes full snapshots automatically:

SettingOptionsDefault
Interval1-24 hours4 hours
Retention2Γ— interval to 720 hours (30 days max)8 hours (2 copies)
RedundancyLocally redundant, Zone-redundant, Geo-redundantGeo-redundant
# Configure periodic backup
az cosmosdb update --name finsecure-cosmos \
  --resource-group rg-finsecure \
  --backup-interval 60 \
  --backup-retention 168 \
  --backup-redundancy "Geo"

Key limitations:

  • Cannot self-restore β€” you must contact Azure Support for periodic backup restore
  • RPO = backup interval (if interval is 4 hours, you can lose up to 4 hours of data)
  • Backups are stored separately and don’t consume your account storage

Continuous backup

Continuous backup enables point-in-time restore (PITR) β€” restore to any second:

FeatureContinuous 7-dayContinuous 30-day
Retention7 days30 days
Restore granularityAny second within windowAny second within window
Self-service restoreβœ… Yes (portal, CLI, SDK)βœ… Yes
CostIncluded (no extra charge)Additional charge per GB/month
Restore targetNew account or existing accountNew account or existing account
Multi-region writesSupportedSupported
Migration from periodicβœ… Supportedβœ… Supported
# Enable continuous backup (30-day) on a new account
az cosmosdb create --name finsecure-transactions \
  --resource-group rg-finsecure \
  --backup-policy-type Continuous \
  --continuous-tier Continuous30Days

# Point-in-time restore
az cosmosdb restore --name finsecure-restored \
  --resource-group rg-finsecure \
  --target-database-account-name finsecure-transactions \
  --restore-timestamp "2025-07-15T10:30:00Z" \
  --location "eastus"
Exam tip: restore options for continuous backup

Continuous backup supports restoring to a new account or to an existing account (for restoring deleted containers/databases). Periodic backup restore always creates a new account and requires contacting Azure Support. Key details:

  • Restoring to an existing account is preferred for deleted containers/databases (avoids data transfer cost)
  • Restoring to a new account is preferred for accidental data modification scenarios
  • The original account remains untouched when restoring to a new account
  • Throughput settings, indexing policies, and stored procedures are restored
  • The restored account gets a new name that you specify (for new account restores)

The exam may test this distinction β€” know that continuous backup now has both options, while periodic always needs a support ticket and new account.

Periodic vs continuous comparison

AspectPeriodic BackupContinuous Backup
RPOBackup interval (1-24 hours)~0 seconds (any timestamp)
Self-service restore❌ Contact Azure Supportβœ… Self-service via portal/CLI
GranularityFull snapshot at intervalAny second within retention
RetentionUp to 30 days7 or 30 days
Extra costNone (included)None for 7-day; extra for 30-day
Restore targetNew accountNew account or existing account
When to useCost-conscious, relaxed RPOMission-critical, near-zero RPO

🎬 Video walkthrough

Flashcards

Question

What is the key difference between periodic and continuous backup?

Click or press Enter to reveal answer

Answer

Periodic takes snapshots at intervals (1-24 hours) with data loss up to the interval. Continuous enables point-in-time restore to any second within the retention window (7 or 30 days). Continuous has near-zero RPO.

Click to flip back

Question

Where does a Cosmos DB restore go?

Click or press Enter to reveal answer

Answer

Continuous backup supports restoring to a NEW account OR to an EXISTING account (for restoring deleted containers/databases). Periodic backup always restores to a new account via Azure Support. The original account is untouched when using the new-account option.

Click to flip back

Question

Can you self-service restore from a periodic backup?

Click or press Enter to reveal answer

Answer

No β€” periodic backup restore requires contacting Azure Support. Continuous backup supports self-service restore via the Azure portal, CLI, or SDK. This is a key difference the exam tests.

Click to flip back

Question

What is the cost difference between 7-day and 30-day continuous backup?

Click or press Enter to reveal answer

Answer

7-day continuous backup is included at no extra charge. 30-day continuous backup has an additional charge per GB/month of stored data. Both provide point-in-time restore granularity.

Click to flip back

Knowledge Check

Knowledge Check

Marcus's transaction database requires near-zero RPO and the ability to restore without contacting Azure Support. Which backup mode should he choose?

Knowledge Check

A developer accidentally deletes a container at 2:15 PM. The account uses continuous backup with 30-day retention. What's the restore process?


Next up: Network Security β€” firewalls, VNets, private endpoints, and CORS for securing access to your Cosmos DB account.