AWS DynamoDB – Working with Backups
Last Updated :
28 Mar, 2023
Amazon DynamoDB supports on-demand backup and restores features. Those features are available to the user independent of whether the user uses AWS Backup or not. Users can use the DynamoDB on-demand backup capability to create full backups of its tables for a long-term period and archival for regulatory observation needs.
DynamoDB also removes the complexity of the operation involved in protecting sensitive data. While using DynamoDB, users don’t have to worry about cluster scaling, managing nodes, reputation, hardware supervising, etc.
Point-in-time recovery (PITR) provides continuous backups of the user’s DynamoDB table data. When enabled, DynamoDB maintains incremental backups of the user table for the last 35 days until the user intentionally turns it off.
Features of DynamoDB:
Following are the features of DynamoDB:
- The backup process executes in seconds regardless of the size of user tables or data, so users do not have to worry about backup schedules or long-running processes.
- Moreover, all backups are automatically encrypted, systematic, easily discoverable, and retained until deleted.
- Users can back up data i.e tables from a few MB to hundreds of TB of data, with no impact on performance.
Advantages of DynamoDB:
Following are the advantages of using DynamoDB:
- Fully Managed: It manages all kinds of responsibilities like encryption, performance, and workloads.
- Easy to Use: Users can enable PITR(Point-in-time recovery) or create, restore, and delete backups easily with a single click.
- Fast and Scalable: Users can easily enable PITR or create as many backups for tables of any size very fastly like in seconds.
- No Performance Impact: Have no impact on the performance and availability of your production applications.
Point-in-Time Recovery for DynamoDB:
Point-in-Time Recovery for DynamoDB makes sure to protect your vital data in form of tables from any kind of read and delete functioning. Users don’t need to worry about all the other operations. Restore can be done at a point in time.
Backing Up a DynamoDB Table:
Follow the below steps to backup a DynamoDB table:
- Choose “Create backup” over the “backups” tab of the source table.
- On the left side of the console, choose”backup” and then “Create backup”.
- The backup status will show “creating”, and after completion, it will change to “Available”.
Output:
{
"BackupDetails": {
"BackupName":
"WebSeriesBackup",
"BackupArn": "arn:aws:dynamodb:us-east-1:123456789012: table/WebSeries/backup/1456781290135-73d8d5bc,
"BackupStatus": "CREATING",
"BackupCreationDateTime": 1456781290.135
}
}
Restoring a DynamoDB Table from a Backup:
Follow the below steps to restore a dynamo DB table from backup:
- Firstly log in to AWS Management Console and open DynamoDB.
- On the left side of the console, choose “Backups”.
- Now choose your source table name.
- Choose “Restore” and fill in your basic new table details.
- Click on “Restore table” to start the restore process.
Output:
aws dynamodb restore-table-from-backup \
--target-table-name WebSeries\
--backup-arn arn:aws: dynamodb:us-east-1:123456789012: table/Music/backup/01581881483719-db9c1f91
--global-secondary-index-override '[]' \
--sse-specification-override Enabled=true, SSEType=KMS
Deleting a DynamoDB Table Backup:
Follow the below steps to delete a DynamoDB table backup:
- Firstly log in to AWS Management Console and open DynamoDB.
- On the left side of the console, choose “Backups”.
- Now choose your source table name.
- Select “Delete” and confirm it by typing “delete”.
Output:
aws dynamodb delete-backup \
--backup-arn arn:aws: dynamodb:us-east-1:123456789012: table/Music/backup/01489602797149-73d8d5bc
Using IAM with DynamoDB Backup and Restore:
Users can easily use AWS Identity and Access Management (IAM) only when the data which need to be backup are in the same AWS account.
Example 1: Permit the “CreateBackup” and “RestoreTableFromBackup”:- Grant the access in both actions.
{
"Version": "2022-02-23",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb: CreateBackup",
"dynamodb: Restore Table FromBackup",
"dynamodb: PutItem",
"dynamodb:UpdateItem",
"dynamodb: DeleteItem",
"dynamodb: GetItem",
"dynamodb:Query",
"dynamodb: Scan",
"dynamodb: BatchWriteItem"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012: table/WebSeries"
}
]
}
Similar Reads
AWS DynamoDB - Working with Scans
Amazon DynamoDB is NoSQL managed database that stores semi-structured data like key-value pairs and document data. When creating tables in DynamoDB, no schema structure is required but only a partition key (primary key) is required. DynamoDB tables stores data in form of items and each item consists
3 min read
AWS DynamoDB - Working with Tables
In this article, we will work on DynamoDB tables. DynamoDB is a NoSQL database that stores document data or key-value pairs. A Dynamodb table consists of items and each item is made up of attributes. Different items can have different attributes. See the below example: Example 1: { "MovieID": 123, "
3 min read
AWS DynamoDB - Working with Streams
DynamoDB Streams is a DynamoDB feature that allows users to keep track of any changes made to the data in DynamoDB. It is an "ordered flow of data" that contains information about changes made to the data in the DynamoDB table. Let us talk of a use case. Consider a "users" table in DynamoDB and your
3 min read
AWS DynamoDB - Working with Indexes
An index is a data structure that enables us to perform fast queries on different columns in a table. After creating an index, the database handles it for us. Whenever data is modified in the table, the index is automatically modified to reflect changes in the table. We can create and use a secondar
2 min read
AWS DynamoDB - Working with Queries
Amazon DynamoDB is a NoSQL managed database service provided by Amazon that stores semi-structured data like key-value pairs. A DynamoDB table consists of items. Each item consists of one partition key and one or more attributes. An example of an item is given below: Example: { "MovieID": 101, "Name
5 min read
Amazon RDS - Working with Backups
This article aims to make you aware of "Working with Backups" on Amazon RDS. The prime objective of backups is to create a copy of our data that can be recovered in situations like data failure, data theft, and so on. As we all know, RDS deals with a lot of crucial data and there can be chances of d
4 min read
How AWS EFS Works with Backup?
Amazon Elastic File System (EFS) is a scalable, managed Network File System (NFS) that provides shared storage for Amazon Web Services (AWS) resources such as Amazon EC2 instances and containers. In this article, we'll explore how EFS works with backup, ensuring the safety and recoverability of your
9 min read
AWS DynamoDB - Working with Items & Attributes
AWS DynamoDB is a NoSQL managed database that stores semi-structured data i.e. key-value and document data. It stores data in form of an item. An item consists of attributes. Upon table creation in DynamoDB, it only requires a primary key to differentiate between items and no schema is to be defined
3 min read
AWS DynamoDB - Web Based Setup
To use the Web-based services of AWS- DynamoDB the following steps need to be followed: Create an AWS account by navigating to the following link:- https://portal.aws.amazon.com/billing/signup#/startGet the AWS access Key (used to access DynamoDB programmatically).Configure your credentials (used to
2 min read
DynamoDB - Using the Console
The AWS management console for Amazon DynamoDB can be accessed from here. The AWS management console can be used for the following: Perform Table operations like create, update and delete a table from the database.To get additional storage and processing capability.To keep track of all the relevant
4 min read