Databases - Backups + Multi-AZ + Read Replicas Flashcards
Types of Backups
Automated Backups, Database Snapshots
Automated Backups
allow you to recover your DB to any point in time within a retention period. they will take a full daily snapshot and will store transaction logs throughout the day
Retention period range
1-35 days, 7 days by default
Recover an automated backup
AWS will choose the most recent daily backup, and then apply transaction logs relevant to that day
Which type of backup is enabled by default?
Automated
Where is the backup data stored?
S3
How much storage will you get?
Free storage space = size of your database
When are backups taken?
within a defined window
What will happen to storage I/O during the backup window?
may be suspended
Are DB snapshots manual or automated?
Manual
When the RDS instance is deleted, what happens to automated backups?
They are deleted.
When the RDS instance is deleted, what happens to DB snapshots?
They are stored
When the RDS instance is deleted, do you have a chance to make one final snapshot?
Yes.
What happens when you restore either an automated backup or a DB snapshot?
the restored version of the DB will be a new RDS instance with a new end point.
Encryption at rest is supported for which DBs?
MySQL, Oracle, SQL Server, PostgreSQL, MariaDB
How do you perform encryption on DBs?
AWS KMS
Will underlying storage, backups, read replicas, and snapshots be encrypted after the RDS instance is encrypted?
Yes
Can you encrypt an existing DB instance?
No, you will need to create a new DB instance and migrate your data into it.
to scale up RDS
take a snapshot, restore snapshot to larger instance size
Multi-AZ is good for
failover/disaster recovery only.
If you use Multi-AZ, will AWS handle the replication?
Yes
Is Multi-AZ good for improving performance?
No. You need Read Replicas.
Use case for Read Replicas
If DB has a lot of reads performed to it, you can change the connection of the EC2 instances to read from read replicas instead of the main DB
Multi-AZ db options
All except Aurora, which has it by default.
Read replica db options
MySQL Server, PostgreSQL, MariaDB
Read replicas are used for
scaling, not DR
In order to deploy a read replica
you must have automatic backups turned on
How many read replicas can you have for one database?
5
Can you have read replicas of read replicas?
Yes, but watch out for latency
Is read replica asynchronous or synchronous?
asynchronous
Is Multi AZ asynchronous or synchronous?
synchronous
Will each read replica have a DNS endpoint?
Yes
Can you have read replicas that have multi-AZ turned on?
No. You can create read replicas of Multi-AZ source dbs though.
Can read replicas be promoted to their own databases?
Yes, but this breaks replication
Can you change the instance size of a read replica?
Yes
DynamoDB vs RDS
DynamoDB offers push button scaling, so you can scale your DB on the fly, w/o any down time.
RDS is not so easy and you usually have to use a bigger instance size or add a read replica