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
DevOps Tutorial DevOps is a combination of two words: "Development" and "Operations." Itâs a modern approach where software developers and software operations teams work together throughout the entire software life cycle.The goals of DevOps are:Faster and continuous software releases.Reduces manual errors through a
7 min read
Introduction
What is DevOps ?DevOps is a modern way of working in software development in which the development team (who writes the code and builds the software) and the operations team (which sets up, runs, and manages the software) work together as a single team.Before DevOps, the development and operations teams worked sepa
10 min read
DevOps LifecycleThe DevOps lifecycle is a structured approach that integrates development (Dev) and operations (Ops) teams to streamline software delivery. It focuses on collaboration, automation, and continuous feedback across key phases planning, coding, building, testing, releasing, deploying, operating, and mon
10 min read
The Evolution of DevOps - 3 Major Trends for FutureDevOps is a software engineering culture and practice that aims to unify software development and operations. It is an approach to software development that emphasizes collaboration, communication, and integration between software developers and IT operations. DevOps has come a long way since its in
7 min read
Version Control
Continuous Integration (CI) & Continuous Deployment (CD)
Containerization
Orchestration
Infrastructure as Code (IaC)
Monitoring and Logging
Microsoft Teams vs Slack Both Microsoft Teams and Slack are the communication channels used by organizations to communicate with their employees. Microsoft Teams was developed in 2017 whereas Slack was created in 2013. Microsoft Teams is mainly used in large organizations and is integrated with Office 365 enhancing the feat
4 min read
Security in DevOps