Lesson 4 of 4 Amazon DynamoDB and DAX

Protecting DynamoDB Data with PITR, Backups and Global Tables

This lesson explains DynamoDB's data protection features and their recovery characteristics: point-in-time recovery, on-demand backups through DynamoDB or AWS Backup, and global tables for multi-Region resilience.

Learning outcomes

After completing this lesson, you will be able to:

  • Restore a table with point-in-time recovery.
  • Use on-demand backups and AWS Backup.
  • Operate global tables.

Point-in-time recovery

Point-in-time recovery (PITR) continuously backs up a table and allows restore to any second within a configurable recovery period of 1 to 35 days. It must be enabled per table. A restore always creates a new table, which includes data, GSIs and LSIs (optionally excluded), but settings such as auto scaling policies, IAM policies, CloudWatch alarms, tags, stream settings and TTL must be reconfigured on the new table. Restores do not consume table capacity.

The following diagram shows a restore and the settings that do not come with it.

Restoring a DynamoDB table with point-in-time recovery. PITR, enabled per table, restores to any second within a recovery period of 1 to 35 days. The restore always creates a new table with the data and indexes, but auto scaling, IAM policies, alarms, tags, stream settings and TTL must be reconfigured on it. Restores consume no table capacity.
The table names are illustrative. A runbook that reapplies the settings makes restores repeatable.
True or false

Protecting DynamoDB data

Exam skills 2.3.1 · 2.3.2

Check facts about DynamoDB recovery options.

Log in to try this activity Interactive activities are free with an account.

On-demand backups and AWS Backup

On-demand backups create full backups that are retained until deleted, with no performance impact. Through AWS Backup, DynamoDB backups gain scheduling, lifecycle to cold storage, cross-Region and cross-account copies, and Vault Lock protection. Tables can also be exported to S3 from PITR data, without consuming capacity, for analytics or archival.

Global tables

Global tables replicate a table across Regions with multi-active replicas: applications can read and write in every Region, and changes propagate typically within a second. Conflicts are resolved with last writer wins in the default eventual consistency mode; a multi-Region strong consistency mode provides an RPO of zero across three Regions at the cost of higher write latency. Global tables give low-latency local access and Regional disaster recovery; they do not protect against accidental deletes or bad writes, which replicate too, so PITR is still needed. The following table compares the options.

FeatureProtects againstRestore result
PITRAccidental writes and deletes in the last 1-35 daysNew table at any second
On-demand backup / AWS BackupData loss needing long retention or copiesNew table from the backup
Global tablesRegional outage; gives local latencyNo restore; other Regions keep serving
Export to S3Need for analytics or archivesData files in S3, not a table
Worked example

Recovering from a faulty batch job

A batch job deletes 2 million items from a customers table at 03:00. PITR is enabled with 35 days of recovery. The operator restores the table to 02:59 as customers-restored, then re-applies the table's auto scaling settings, alarms and tags. Because writes continued after 03:00, the team copies the deleted items from the restored table back into the live table with a script rather than switching tables. The global table replica in another Region had also received the deletes, which is why PITR, not replication, was the recovery mechanism.

Check yourself

Which service provides scheduled, cross-Region and cross-account DynamoDB backups?

Show answer

AWS Backup.

Exam Tips

Remember for the exam

  • PITR restores to any second in the last 1-35 days into a new table.
  • Restored tables need auto scaling, alarms, IAM policies, TTL and tags reconfigured.
  • Use AWS Backup for scheduled, cross-Region and cross-account DynamoDB backups.
  • Global tables are multi-active across Regions but replicate mistakes; keep PITR enabled.