Skip to content

Do You Lose PITR for a Deleted DynamoDB Table?

1

We have a table that is enabled with PITR. Looking through documentation here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PointInTimeRecovery_Howitworks.html#howitworks-pitr-deleting-table it makes me believe that if a table is deleted even if you have PITR you only get an instant snapshot before it is deleted to recover from. I tested this myself and when I recovered the table from the delete backup the table did not have PITR enabled and I did not have any of my 35 day backups available to choose from.

Is this expected? If a table is delete with PITR enabled is there a way to recover from the PITR backup? Is there a way to recover the other PITR backups that we had before deletion? We are thinking of a scenario where data is corrupted/manipulated and then the table is delete. The only recovery at that point would be to the corrupted/manipulated entry.

I found this post that says we could open a ticket with AWS to be able to recover during out PITR window? Is that accurate? Would we also get the 35 day PITR recovery back with that restore? https://repost.aws/questions/QUa-8R7Z5SSwOc86GLGwwkhg/point-in-time-recovery-on-deleted-tables

asked 2 years ago2.1K views

2 Answers
2

For compliance reasons, when a table is deleted you can only restore from the snapshot that is created. You lose the 35 day window of data that you can restore from. Likewise, if you disable PITR, you lose the preceding 35 days of data retention.

AWS
EXPERT

answered 2 years ago

0
Accepted Answer

When a DynamoDB table with point-in-time recovery (PITR) enabled is deleted, you do not lose all PITR capabilities, but the recovery process is different from what you might expect.

When you delete a table that has PITR enabled, DynamoDB automatically creates a backup snapshot called a "system backup." This system backup is retained for 35 days at no additional cost. The system backup allows you to restore the deleted table to the state it was in just before deletion.

However, you are correct in your observation that when you restore from this system backup, the restored table does not have PITR enabled by default, and you don't have immediate access to the full 35-day history of backups. This is the expected behavior.

The system backup is named following the convention "table-name$DeletedTableBackup". You can use this backup to restore the table to its state just before deletion, but it doesn't provide the ability to restore to any other point in time within the past 35 days directly through the console or standard API calls.

Regarding your scenario where data is corrupted or manipulated before deletion, you're right to be concerned. The system backup would only allow you to restore to the state just before deletion, which would include the corrupted or manipulated data.

However, unfortunately there is no other way to recover PITR data from before the table deletion. Once a table is deleted, the continuous PITR backups are also removed, and only the final on-demand backup remains.

While PITR is a powerful feature for short-term recovery, it does have its limitations. To ensure that you can recover data in case of accidental deletions, you can consider implementing additional backup and recover strategies:

  1. Using AWS Backup - It is a fully managed service that allows you to automate and centralise data protection across AWS services. You can setup regular, scheduled backups of your DynamoDB tables using AWS backup [1]. These backups can be retained for a longer period as per your retention policy. You can schedule full backups using AWS Backup, where you can also specify tags or environments to backup multiple tables, with the tag ‘production’ for example [2]. It provides cross-region backup capabilities and supports backup encryption.

  2. Using On-Demand Backups - They are manual, point-in-time snapshots of your DynamoDB table that you can create and store for long-term retention and archival for regulatory compliance needs [3]. For a maximum data protection you can have a hybrid approach where you do periodic on-demand backups from time to time in addition to PITR.

Sources

  1. Enable point-in-time recovery in DynamoDB - Amazon DynamoDB
  2. [AWS Backup Blog ] (https://aws.amazon.com/blogs/storage/protecting-your-data-with-aws-backup/ )
  3. [Using On-Demand backup and restore for DynamoDB] (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/BackupRestore.html)

answered 2 years ago

  • AWS does retain the PITR data for deleted tables for a limited time.

    What is that "limited time"? Is it hours? Days? weeks?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.