Backing Up and Exporting DynamoDB Data
This lesson explains how DynamoDB protects data with on-demand backups and continuous point-in-time recovery, and exports table data to S3 for analytics without affecting performance.
Learning outcomes
After completing this lesson, you will be able to:
- Choose between on-demand backups, point-in-time recovery and AWS Backup.
- Describe exports to S3 and other integrations that consume no table capacity.
Backup options
DynamoDB offers three backup options. On-demand backups are full backups taken whenever needed, such as before a migration, with no effect on performance, and kept until deleted. Point-in-time recovery (PITR) backs up the table continuously, so it can be restored to any second in a recovery period of 1 to 35 days, which undoes accidental writes or deletes; restores always create a new table. AWS Backup manages DynamoDB backups with central plans, copies them across accounts and Regions, and locks them against deletion. The following table summarises the options.
| Feature | Notes |
|---|---|
| On-demand backups | Full backups at any time, with no performance impact, kept until deleted |
| Point-in-time recovery (PITR) | Restore to any second in the last 1 to 35 days; restores create a new table |
| AWS Backup | Central plans, cross-account and cross-Region copies, locked vaults |
Exports and integrations
Several features move DynamoDB data to and from other services without custom code. Export to S3 writes a table's data, as of any point within the PITR window, to S3 without consuming any read capacity, so analytics with Athena or other tools never affects the application. Import from S3 creates a new table from CSV, JSON or Ion files. Zero-ETL integrations replicate changes continuously to OpenSearch Service, for full-text search, and to Redshift, for analytics. The following table summarises the features.
| Feature | Notes |
|---|---|
| Export to S3 | From PITR data, consuming no read capacity; in DynamoDB JSON or Ion format |
| Import from S3 | Creates a new table from CSV, JSON or Ion data |
| Zero-ETL integrations | Feed OpenSearch Service and Redshift continuously |
Analytics without affecting the table
Recovery and analytics without affecting the table
Several DynamoDB features support recovery and analytics without consuming the table's capacity. The following table identifies the feature that meets each requirement.
| Requirement | Feature |
|---|---|
| Recover from a bug that corrupted items an hour ago | Point-in-time recovery to a new table |
| Keep monthly backups for seven years in another account | AWS Backup plan with a cross-account copy |
| Analyse a year of orders in Athena | Export to S3 from PITR, using no read capacity |
Because exports read from the PITR backup rather than the table, analytics never competes with production traffic.
What does point-in-time recovery allow?
Show answer
Restoring the table to any second within its recovery period, up to 35 days, into a new table.
Exam Tips
Remember for the exam
- To recover from accidental writes or deletes, use point-in-time recovery.
- To export a table to S3 for analytics without affecting performance, export from point-in-time recovery.
- To copy DynamoDB backups to another account or Region, use AWS Backup.
- A restore always creates a new table.