Search code examples
amazon-web-servicesamazon-rds

AWS RDS Postgres Snapshot questions


  • When manual snapshot is taken, its consistency with what point in time? Start of the snapshot or end?
  • Does RDS Snapshots underlying use EBS snapshots? How does it guarantee consistency? what happens to dirty blocks not yet written to disk? Does the snapshot also copies transaction logs?
  • Is manual offline backup possible like when it takes before upgrade to make it a consistent backup?
  • If System backups are incremental and manual backups are always full backups - If multiple manual snapshots are taken say every 6 hours, will each manual snapshot be full backup or incremental backup with diff changes from last backup?
  • I have noticed inconsistent backup times, first manual snapshot after db restore takes few mins for a 1TB database - assuming its bcz first system snapshot has completed and only incremental changes are being stored in first manual snapshot. But when a pre-upgrade manual snapshot is triggered by upgrade process which started shortly after first snapshot and there has been hardly any changes made in the db - the second snapshot takes about 30 mins. Why would it take longer?

Solution

  • When Amazon RDS creates a snapshot, it is consistent with the moment in time when the snapshot is started. Any changes after that time will not be reflected in the snapshot.

    Amazon RDS uses Amazon EBS for disk storage. Thus, the snapshots are presumably EBS Snapshots. (I say 'presumably' because this level of detail is not published, aside from saying that the snapshots are stored in S3 the same as a normal EBS Snapshot.)

    All backups are both full and incremental. It's best to ignore those terms with EBS Snapshots because it's just an implementation detail. (If you wish, you can read-up on the topic. It has to do with incrementally backing-up modified disk blocks, but full backups are always available rather than needing to apply 'full data' and then 'increments'. It's the cloud -- it's magical!)

    Bottom line: You don't need the traditional fears associated with backups since AWS does all the "undifferentiated heavy-lifting". It just works. (But you're welcome to test it!)