Learn more about Aptible’s database backup solution with automatic backups, default encryption, with flexible customization
Database Backups are essential because they provide a way to recover important data in case of disasters or data loss. They also provide a historical record of changes to data, which can be required for auditing and compliance purposes.
Aptible provides Automatic Backups of your Databases every 24 hours, along with a range of other backup options. All Backups are compressed and encrypted for maximum security and efficiency. Additionally, all Backups are automatically stored across multiple Availability Zones for high-availability.
By default, Aptible provides automatic backups of all Databases. The retention period for Automated Backups is determined by the Backup Retention Policy for the Environment in which the Database resides. The configuration options are as follows:
DAILY BACKUPS RETAINED
- Number of daily backups retainedMONTHLY BACKUPS RETAINED
- Number of monthly backups retained (the last backup of each month)YEARLY BACKUPS RETAINED
- Number of yearly backups retained (the last backup of each year)COPY BACKUPS TO ANOTHER REGION: TRUE/FALSE
- When enabled, Aptible will copy all the backups within that Environment to another region. See: Cross-region Copy BackupsKEEP FINAL BACKUP: TRUE/FALSE
- When enabled, Aptible will retain the last backup of a Database after your deprovision it. See: Final BackupsRecommended Backup Retention Policies
Production environments: Daily: 14-30, Monthly: 12, Yearly: 5, Copy backups to another region: TRUE (depending on DR needs), Keep final backups: TRUE
Non-production environments: Daily: 1-14, Monthly: 0, Yearly: 0, Copy backups to another region: FALSE, Keep final backups: FALSE
Manual Backups can be created anytime and are retained indefinitely (even after the Database is deprovisioned).
When COPY BACKUPS TO ANOTHER REGION
is enabled on an Environment, Aptible will copy all the backups within that Environment to another region. For example, if your Stack is in the US East Coast, then Backups will be copied to the US West Coast.
Cross-region Copy Backups are useful for creating redundancy for disaster recovery purposes. To further improve your recovery time objective (RTO), it’s recommended to have a secondary Stack in the region of your Cross-region Copy Backups to enable quick restoration in the event of a regional outage.
The exact mapping of Cross-region Copy Backups is as follows:
Originating region | Destination region(s) |
---|---|
us-east-1 | us-west-1, us-west-2 |
us-east-2 | us-west-1, us-west-2 |
us-west-1 | us-east-1 |
us-west-2 | us-east-1 |
sa-east-1 | us-east-2 |
ca-central-1 | ca-west-1 (formerly us-east-2) |
eu-west-1 | eu-central-1 |
eu-west-2 | eu-central-1 |
eu-west-3 | eu-central-1 |
eu-central-1 | eu-west-1 |
ap-northeast-1 | ap-northeast-2 |
ap-northeast-2 | ap-northeast-1 |
ap-southeast-1 | ap-northeast-2, ap-southeast-2 |
ap-southeast-2 | ap-southeast-1 |
ap-south-1 | ap-southeast-2 |
Aptible guarantees that data processing and storage occur only within the US for US Stacks and EU for EU Stacks.
When KEEP FINAL BACKUP
is enabled on an Environment, Aptible will retain the last backup of a Database after your deprovision it. Final Backups are kept indefinitely as long as the Environment has this setting enabled.
We highly recommend enabling this setting for production Environments.
The retention period for Automated Backups is determined by the Backup Retention Policy for the Environment in which the Database resides.
The default Backup Retention Policy for an Environment is 30 Automatic Daily Backups, 12 Monthly Backups, 6 Yearly Backups, Keep Final Backup: Enabled, Cross-region Copy Backup: Disabled.
Backup Retention Policies can be modified using one of these methods:
aptible backup_retention_policy:set CLI command
.Reducing the number of retained backups, including disabling copies or final backups, will automatically delete existing, automated backups that do not match the new policy. This may result in the permanent loss of backup data and could violate your organization’s internal compliance controls.
Cost Optimization Tip: See this related blog for more recommendations for balancing continuity and costs
A Database can be excluded from the backup retention policy preventing new Automatic Backups from being taken. This can be done within the Aptible Dashboard from the Database Settings, or via the Terraform Provider.
Once this is selected, there will be no new automatic backups taken of this database, including preventing a final backup of the database during deprovision, even if the environment’s policy specifies it. Please note: making this change on an existing database does not automatically delete previously taken backups. Purging the previously taken backups can be achieved in the following ways:
aptible backup:list DB_HANDLE
to provide input into the aptible backup:purge BACKUP_ID
commandAutomatic Backups are automatically and permanently deleted when the associated database is deprovisioned. Final Backups and Cross-region Copy Backups that do not match the Backup Retention Policy are also automatically and permanently deleted. This purging process can take up to 1 hour.
All Backups can be manually and individually deleted.
Restoring a Backup creates a new Database from the backed-up data. It does not replace or modify the Database the Backup was initially created from. By default, all newly restored Databases are created as a 1GB General Purpose Container Profile, however you can specify both container size and profile using the backup:restore
command.
Deep dive: Databases Backups are stored as volume EBS Snapshots. As such, Databases restored from a Backup will initially have degraded disk performance, as described in the “Restoring from an Amazon EBS snapshot” documentation. If you are using a restored Database for performance testing, the performance test should be run twice: once to ensure all of the required data has been synced to disk and the second time to get an accurate result. Disk initialization time can be minimized by restoring the backup in the same region the Database is being restored to. Generally, this means the original Backup should be restored, not a copy.
If you have special retention needs (such as for a litigation hold), please contact Aptible Support.
Aptible provides built-in, automatic Database Encryption. The encryption key and algorithm used for Database Encryption are automatically applied to all Backups of a given Database.
How do I modify an Environments Backup Retention Policy?
Backup Retention Policies can be modified using one of these methods:
aptible backup_retention_policy:set CLI command
.How do I view/manage Automatic Backups?
Automatic Backups can be viewed in two ways:
aptible backup:list
commandHow do I view/manage Final Backups?
Final Backups can be viewed in two ways:
aptible backup:orphaned
commandHow do I create Manual Backups?
Users can create Manual Backups in two ways:
aptible db:backup
) commandHow do I delete a Backup?
All Backups can be manually and individually deleted in the following ways:
aptible backup:purge
commandHow can I exclude a Database from Automatic Backups?
How should I set my Backup Retention Policy for Production Environments?
For critical production data, maintaining a substantial backup repository is crucial. While compliance frameworks like HIPAA don’t mandate a specific duration for data retention, our practice has been to keep backups for up to six years. The introduction of Yearly backups now makes this practice more cost-effective. Aptible provides a robust default backup retention policy, but in most cases, a custom retention policy is best for tailoring to specific needs. Aptible backup retention policies are customizable at the Environment level, which applies to all databases within that environment.
A well-balanced backup retention policy for production environments might look something like this:
How should I set my Backup Retention Policy for Non-production Environments?
When it comes to non-production environments, the backup requirements tend to be less stringent compared to production environments. In these cases, Aptible recommends the establishment of custom retention policies tailored to the specific needs and cost considerations of non-production environments. An effective backup retention policy for a non-production environment might include a more conservative approach:
To optimize costs, it’s best to disable Cross-region Copy Backups and Keep Final Backups in non-production environments — as these settings are designed for critical production resources.
How do I restore a Backup?
You can restore from a Backup in the following ways:
aptible backup:restore
commandLearn more about Aptible’s database backup solution with automatic backups, default encryption, with flexible customization
Database Backups are essential because they provide a way to recover important data in case of disasters or data loss. They also provide a historical record of changes to data, which can be required for auditing and compliance purposes.
Aptible provides Automatic Backups of your Databases every 24 hours, along with a range of other backup options. All Backups are compressed and encrypted for maximum security and efficiency. Additionally, all Backups are automatically stored across multiple Availability Zones for high-availability.
By default, Aptible provides automatic backups of all Databases. The retention period for Automated Backups is determined by the Backup Retention Policy for the Environment in which the Database resides. The configuration options are as follows:
DAILY BACKUPS RETAINED
- Number of daily backups retainedMONTHLY BACKUPS RETAINED
- Number of monthly backups retained (the last backup of each month)YEARLY BACKUPS RETAINED
- Number of yearly backups retained (the last backup of each year)COPY BACKUPS TO ANOTHER REGION: TRUE/FALSE
- When enabled, Aptible will copy all the backups within that Environment to another region. See: Cross-region Copy BackupsKEEP FINAL BACKUP: TRUE/FALSE
- When enabled, Aptible will retain the last backup of a Database after your deprovision it. See: Final BackupsRecommended Backup Retention Policies
Production environments: Daily: 14-30, Monthly: 12, Yearly: 5, Copy backups to another region: TRUE (depending on DR needs), Keep final backups: TRUE
Non-production environments: Daily: 1-14, Monthly: 0, Yearly: 0, Copy backups to another region: FALSE, Keep final backups: FALSE
Manual Backups can be created anytime and are retained indefinitely (even after the Database is deprovisioned).
When COPY BACKUPS TO ANOTHER REGION
is enabled on an Environment, Aptible will copy all the backups within that Environment to another region. For example, if your Stack is in the US East Coast, then Backups will be copied to the US West Coast.
Cross-region Copy Backups are useful for creating redundancy for disaster recovery purposes. To further improve your recovery time objective (RTO), it’s recommended to have a secondary Stack in the region of your Cross-region Copy Backups to enable quick restoration in the event of a regional outage.
The exact mapping of Cross-region Copy Backups is as follows:
Originating region | Destination region(s) |
---|---|
us-east-1 | us-west-1, us-west-2 |
us-east-2 | us-west-1, us-west-2 |
us-west-1 | us-east-1 |
us-west-2 | us-east-1 |
sa-east-1 | us-east-2 |
ca-central-1 | ca-west-1 (formerly us-east-2) |
eu-west-1 | eu-central-1 |
eu-west-2 | eu-central-1 |
eu-west-3 | eu-central-1 |
eu-central-1 | eu-west-1 |
ap-northeast-1 | ap-northeast-2 |
ap-northeast-2 | ap-northeast-1 |
ap-southeast-1 | ap-northeast-2, ap-southeast-2 |
ap-southeast-2 | ap-southeast-1 |
ap-south-1 | ap-southeast-2 |
Aptible guarantees that data processing and storage occur only within the US for US Stacks and EU for EU Stacks.
When KEEP FINAL BACKUP
is enabled on an Environment, Aptible will retain the last backup of a Database after your deprovision it. Final Backups are kept indefinitely as long as the Environment has this setting enabled.
We highly recommend enabling this setting for production Environments.
The retention period for Automated Backups is determined by the Backup Retention Policy for the Environment in which the Database resides.
The default Backup Retention Policy for an Environment is 30 Automatic Daily Backups, 12 Monthly Backups, 6 Yearly Backups, Keep Final Backup: Enabled, Cross-region Copy Backup: Disabled.
Backup Retention Policies can be modified using one of these methods:
aptible backup_retention_policy:set CLI command
.Reducing the number of retained backups, including disabling copies or final backups, will automatically delete existing, automated backups that do not match the new policy. This may result in the permanent loss of backup data and could violate your organization’s internal compliance controls.
Cost Optimization Tip: See this related blog for more recommendations for balancing continuity and costs
A Database can be excluded from the backup retention policy preventing new Automatic Backups from being taken. This can be done within the Aptible Dashboard from the Database Settings, or via the Terraform Provider.
Once this is selected, there will be no new automatic backups taken of this database, including preventing a final backup of the database during deprovision, even if the environment’s policy specifies it. Please note: making this change on an existing database does not automatically delete previously taken backups. Purging the previously taken backups can be achieved in the following ways:
aptible backup:list DB_HANDLE
to provide input into the aptible backup:purge BACKUP_ID
commandAutomatic Backups are automatically and permanently deleted when the associated database is deprovisioned. Final Backups and Cross-region Copy Backups that do not match the Backup Retention Policy are also automatically and permanently deleted. This purging process can take up to 1 hour.
All Backups can be manually and individually deleted.
Restoring a Backup creates a new Database from the backed-up data. It does not replace or modify the Database the Backup was initially created from. By default, all newly restored Databases are created as a 1GB General Purpose Container Profile, however you can specify both container size and profile using the backup:restore
command.
Deep dive: Databases Backups are stored as volume EBS Snapshots. As such, Databases restored from a Backup will initially have degraded disk performance, as described in the “Restoring from an Amazon EBS snapshot” documentation. If you are using a restored Database for performance testing, the performance test should be run twice: once to ensure all of the required data has been synced to disk and the second time to get an accurate result. Disk initialization time can be minimized by restoring the backup in the same region the Database is being restored to. Generally, this means the original Backup should be restored, not a copy.
If you have special retention needs (such as for a litigation hold), please contact Aptible Support.
Aptible provides built-in, automatic Database Encryption. The encryption key and algorithm used for Database Encryption are automatically applied to all Backups of a given Database.
How do I modify an Environments Backup Retention Policy?
Backup Retention Policies can be modified using one of these methods:
aptible backup_retention_policy:set CLI command
.How do I view/manage Automatic Backups?
Automatic Backups can be viewed in two ways:
aptible backup:list
commandHow do I view/manage Final Backups?
Final Backups can be viewed in two ways:
aptible backup:orphaned
commandHow do I create Manual Backups?
Users can create Manual Backups in two ways:
aptible db:backup
) commandHow do I delete a Backup?
All Backups can be manually and individually deleted in the following ways:
aptible backup:purge
commandHow can I exclude a Database from Automatic Backups?
How should I set my Backup Retention Policy for Production Environments?
For critical production data, maintaining a substantial backup repository is crucial. While compliance frameworks like HIPAA don’t mandate a specific duration for data retention, our practice has been to keep backups for up to six years. The introduction of Yearly backups now makes this practice more cost-effective. Aptible provides a robust default backup retention policy, but in most cases, a custom retention policy is best for tailoring to specific needs. Aptible backup retention policies are customizable at the Environment level, which applies to all databases within that environment.
A well-balanced backup retention policy for production environments might look something like this:
How should I set my Backup Retention Policy for Non-production Environments?
When it comes to non-production environments, the backup requirements tend to be less stringent compared to production environments. In these cases, Aptible recommends the establishment of custom retention policies tailored to the specific needs and cost considerations of non-production environments. An effective backup retention policy for a non-production environment might include a more conservative approach:
To optimize costs, it’s best to disable Cross-region Copy Backups and Keep Final Backups in non-production environments — as these settings are designed for critical production resources.
How do I restore a Backup?
You can restore from a Backup in the following ways:
aptible backup:restore
command