RDS

Relational Database Service (RDS) is the AWS Solution for relational database. There are 6 relational databases currently available on AWS

  1. Amazon Aurora
  2. MySQL
  3. MariaDB
  4. PostgreSQL
  5. Oracle
  6. Microsoft SQL Server

RDS Encryption

You can turn on encryption at-rest for all RDS engines. You may not be able to turn on encryption for older versions of some engines. It will also encrypt the automated backups, snapshots and read replicas

Encryption is handles using the AWS Key Management Service (KMS)

RDS Backups

Automated Backups Choose a Retention Period between 1 and 35 days Stores transaction logs throughout the day Automated backups are enabled by default All data is stored inside S3 THere is not additional charge for backup storage You defined your backup window Storage I/O may be suspended during backup

Manual Snapshots Taken manually by the user Backups persist even if you delete the original RDS instance

RDS Restoring Backup

When recovering AWS will take the most recent daily backup, and apply transaction log relevant to that day. This allows point-in-time recovery down to a second inside the retention period

Backup data is never restored overtop of an existing instance.

When you restore an RDS instance from an Automated Backup or Manual Snapshot a new instance is created for the restored database.

Restored RDS instances will have a new DNS endpoint.

RDS Multi AZ

Ensures database remains available if another AZ becomes unavailable

Makes an exact copy of your database in another AZ. AWS automatically synchronizes changes in the database over to the standby cop

Automatic Failover protection if one AZ goes down failover will occur and the standby slave will be promoted to master

RDS - Read Replicas

Read-Replicas allow you to run multiple copies of your database, these copies only allow reads (no writes) and are intended to alleviate workload of your primary database to improve performance

You must have automatic backups enabled to use Read Replicas

Asynchronous replication happens between the primary RDS instance and the replicas

You can have up to 🖐🏾 5 replicas of a database Each Read Replica will have its own DNS Endpoint

You can have Multi-AZ replicas, replicas in another region, or even replicas of other read replicas

Replicas can be promoted to their own database, but this breaks replication No automatic failover, if primary copy fails you must manually update urls to point to a copy

Multi-AZ vs Read Replicas

Multi-AZ DeploymentsRead Replicas
Synchronous replication - highly durableAsynchronous replication - highly scalable
Only database engine on primary instance is activeAll read replicas are accessible and cab be used for read scaling
Automated backups are taken from standbyNo backups configured by default
Always spans two AZs within a single RegionCan be within an AZ, Cross-AZ, or Cross-Region
Database engine version upgrades happen on primaryDatabase engine upgrade is independent from source instance
Automatic failover to standby when a problem is detectedCan be manually promoted to a standalone database instance