AWS::RDS::DBInstance
- Managed underlying OS, updates, etc
- Continuous backups. Easily restore
- Monitoring dashboards
- Read replicas
- Multi-AZ for disaster recovery
- Maintenance windows for upgrades
- Scaling capability (vertical and horizontal)
- Storage backed by EBS (gp2 or io1)
Properties
BackupRetentionPeriod
- Daily
full backupof the database (during the maintenance window) 7 daysretention by default (can be increased to up to 35 days)Transaction logsare backed-up every 5 min- Ability to restore to
any point in time! (from the oldest backup to 5 minutes ago)
EnableIAMDatabaseAuthentication
- IAM policies control who can manage RDS
- For authentication
user+passoriam-authcan be used - IAM authentication can be used for mysql or postgres only (with a 15min token)

Engine
PostgresMySQLMariaDBOracleMicrosoft SQL Server-
Aurora(AWS proprietary db) -
Aurora
- Proprietary database technology (AWS-owned)
- Compatible with Postgres and MySQL drivers
- Cloud optimized (
5x performanceover MySQL) Shared Storage Volumethat grows automatically up to 128TB (at 10GB steps)- 20% more expensive
DBInstanceClass
- Standard
- Memory Optimized
- Burstable
DBSnapshotIdentifier
- Snapshots are manually triggered by the user
- The retention is for as long as you want
- Restoring a snapshot is much quicker than creating a db and inserting everything you need
MaxAllocatedStorage
Autoscalingautomatically increase the maximum size based on athreshold(e.g., free storage is less than 10% of total)Maximmum Storage Thresholdmust also be set to prevent scaling infinitely
MultiAZ
- For Disaster Recovery
Syncoperation- The data is synced to a standby replica
- This standby replica will be automatically used in case of failure of the main database (
failover). Increased availability - The standby db is not used for scaling
- A read replica can also be used as a failover!

SourceDBInstanceIdentifier
-
Read Replicas
-
Asyncoperation. Therefore is data is eventually consistent - Up to
5 read replicas - Within an AZ, Cross-AZ or Cross-Region

-
A replica can be promoted to be the main database
-
Only attach applications to the main instance if really necessary!
- The application must update the connection string to include the read replicas
- There is a network cost over the
data replicationacross AZs indifferent regions. Within the same region the replication is free

StorageEncrypted
- At rest encryption
- Master & read replicas (AWS KMS - AES-256)
-
If master is not encrypted, read replicas cannot be encrypted
-
In-flight encryption
- SSL certificates to encrypt data in transit
- A trust certificate must be set up in order to connect to the db
-
To enforce SSL
- Postgres:
rds.force_ssl=1in AWS RDS console - MySQL:
GRANT USAGE ON *.* TO 'mysqluser'@'%' REQUIRE SSL
- Postgres:
-
To encrypt an unencrypted RDS database:
- Create a unencrypted snapshot
- Copy the snapshot and enable encryption
- Restore the db from the encrypted snapshot
- Migrate applications to the new db