Aptible database management and backups

When Aptible hosted databases are backed up, I assume the entire container is backed up and that the ​actual​ db name (“db”) doesn’t really matter. Is that correct? Thus, if I access a mysql instance using a mysql shell client, is it ok to create a new db, adjust privileges, etc. or will that affect the “managed database” nature and somehow impair it’s normal backup operation?

Or, can I consider it just a “normal” container that aptible backs and up restores as-is?

(sorry for the long-winded question) :slight_smile:

Good question, @Philonous - yes, that’s correct, the entire state of the database lives on the EBS volume: the config and all data files. you can create a user, adjust privileges, etc.

The only reason we provision with a particular app-level user (aptible) with a restricted privilege set is that we want to eventually support an optional “read-only” mode on databases. If you provision users with excessive privileges (beyond what the aptible user currently uses) and use those from your app, we won’t be able to take advantage of read-only mode with your particular database.

The reason you’d want read-only mode:

Right now, since databases are on EBS volumes and EBS volumes can only be attached to one EC2 instance at a time, when we need to move a database to another instance, we have to take the database down for a period of a few seconds/minutes while the EBS volume detaches/attaches. With read-only mode, it’s possible to keep the database up the entire time - the only effect is that writes to the database will fail from the app, but reads will still succeed during the detach/reattach

@colby How do backups work on Aptible more generally? (How are they stored, for how long, what’s the cadence? etc…)

@hylas. We perform daily backups of all production databases, storing encrypted snapshots to S3 (encrypted with an eCryptfs passphrase unique to each database which is stored separately, encrypted, in our API).

The snapshots we keep for 90 days. We also do full backups monthly, which are stored for 6 years.

You can augment that frequency using the CLI to dump your database(s), but we also plan to add dashboard functionality that will let you

  • Initiate a backup
  • restore from a backup

No ETA on those, unfortunately.

@hylas Just a quick update to @colby’s last post… As of June 2016, backup and restore functionality are in fact fully accessible on the Aptible Dashboard and from the Aptible CLI.