Skip to main content

Backup & Recovery

This document outlines the backup and recovery strategy for our DigitalOcean Managed Database instances. Backups are performed through SnapShooter, which provides automated daily backups with configurable retention.


Backup Strategy

Backend Database Instance (DigitalOcean Managed DB):

Backup Tool: SnapShooter (DigitalOcean-approved backup provider)

Backup Frequency: Automated backups are taken every day at 5 AM.

Backup Retention: SnapShooter is configured to retain backups for the last 15 days.

Backup Type: SnapShooter creates snapshot-based backups of the Managed Database. These are full logical or physical snapshots depending on the engine type, ensuring reliable restore capability.

Storage Location: SnapShooter stores the backup data in DigitalOcean Spaces, located in the same region as the database to ensure fast restoration.


Recovery Plan

In the event of database failure, corruption, or accidental deletion, the following steps will be performed:

  1. Log into SnapShooter Dashboard: Navigate to the SnapShooter project associated with the database backups.

  2. Identify the Most Recent Valid Backup: View the list of backups taken at 5 AM daily, retained for 15 days.

  3. Initiate Restore Operation: SnapShooter provides two restore options:

  4. Restore to DigitalOcean Managed Database: Directly restore the snapshot into the existing or a new Managed DB instance.

  5. Download Backup: Optionally download the backup files for manual restoration (e.g., using pg_restore, mysql, or import tools).

  6. Create a New Database Instance (If Required): If the existing instance is compromised or unusable, create a new DigitalOcean Managed DB instance and restore the backup into it.

  7. Update Application Configuration: Update environment variables or application settings to use the new database connection string.

  8. Verify Database Integrity and Application Connectivity: Ensure tables, data, and indexes are intact. Confirm that the application successfully connects and operates normally.


Best Practices

  1. Encryption: SnapShooter backups are encrypted in transit and at rest using DigitalOcean Spaces or SnapShooter-managed storage.

  2. Manual Snapshots Before High-Risk Operations: It is recommended to trigger manual backups before running migrations, major updates, or schema changes.

  3. Backup Audit: Review SnapShooter backup logs weekly to ensure backup jobs are running without failures.

  4. Retention Optimization: SnapShooter provides flexible retention policies—retaining 15 days helps balance cost and recovery needs.


Note: This DigitalOcean backup and recovery plan ensures that we can always restore the database using daily backups from SnapShooter with a 15-day retention window. This approach minimizes downtime and reduces the risk of data loss in case of any database corruption or infrastructure failure.