“There should always be a backup option.”
“If we fail to plan, then we are planning to fail.”
The following quotes are some of the most commonly heard tips for software development. Let’s see how we can put that into practice on AWS databases.
The AWS Relation Database Service (RDS) is one of the most popular cloud database services, and snapshots are its backup method. Snapshot is an image of a database at a point in time, as suggested by the name.
Automated snapshots
AWS RDS has an automated backup option. At a certain point in time, a snapshot is taken every day. Automatic snapshots are retained for 1 to 35 days. Choosing a backup retention period of 7 days will automatically delete backups older than 7 days and we will only be charged for 7 snapshots.
One of the most significant use cases for automatic backup/snapshot is to help with recovery after a critical error or crash.
Manual snapshots
AWS RDS also offers manual backup options. In database actions, we can choose “take snapshot” for backup. Manual snapshots are advised before major database migration, cleanup or resize.
Exporting snapshots to AWS S3
RDS snapshots are costly. The more we have, the more it will cost. Therefore, database backup retention should be limited to a minimum number of days. The decision can be made based on the nature of the software.
Another way to reduce the cost is to export snapshots to Amazon S3. Cost wise S3 is cheaper than RDS snapshots. The manual snapshots that we might need in the future are appropriate candidates for S3 export. RDS has the option to restore databases from S3. Overall, it’s a fairly straightforward process.
Happy building with AWS.