RDS Flashcards
What are the 2 types of of general DBs in the industry?
Relational or “SQL” (there are many others like Aurora MariaDB)
Non-Relational or “NoSQL” (DynamoDB)
What’s the difference with SQL v NoSQL style DBs?
The schema.
SQL = rigid; parameters are defined in advance & every row in a table is uniquely identifiable.
NoSQL = not rigid, more flat; more relaxed relationship;
Can you run a DB on an EC2 instance?
Yes, but it’s not recommended over services like RDS or RedShift unless there is a specific reason:
○ Access to the OS of the DB Instance; you can only do this if running on EC2 i.e you can’t in RDS (this is a very rare request/requirement)
○ Advanced DB tuning for which you need Root Access
○ Vendor demands
○ DB or DB Version that AWS doesn’t provide
Specific
○ OS/DB combination, or an ARCH that AWS doesn’t provide
What are some negatives about running a your own DB on EC2?
○ Admin overhead - both from managing an EC2 and a DB Host
○ Backup/DR/replication management falls on customer
○ EC2 is running in a single AZ - if the zone fails, then access to the DB fails
○ Features - AWS DB products are more feature rich than running your own DB on EC2
○ EC2 is either ON or OFF; doesn’t scale as well rapidly based on load compare to an AWS DB product
How do you connect to an RDS instance?
The RDS CNAME (i.e you do not connect via an IP address).
The CNAME is a unique identifier.
What type of storage is created with RDS?
When you provision an RDS instance, it will auto-provision storage for that instance –> this is in the form of EBS within the same AZ.
What is RDS Multi-AZ?
Is there an added cost?
Feature that provides HA to a DB instance.
This is an option that’s enabled when spinning up an RDS instance that will also spin up HW/resources inside another AZ as a secondary/backup instance.
This is an added cost.
What kind of replication is used automatically in an RDS Multi-AZ scenario?
Synchronous Replication.
REMINDER - the replica is not for added capacity, it is completely for used as a backup target.
Is there disruption when a failure occurs in a RDS Multi-AZ scenario?
Yes. When RDS detects a failure and switches over to point to the CNAME of the standby Replica, there is a minor disruption/time it takes.
Can RDS Multi-AZ span across Regions?
No. It can span across different AZ’s but must be in the same Region.
What is the Recovery Point Objective (RPO)?
The time between the point when the last successful backup took place to the point in time of a failure.
Ex > last backup was at 3am and there was an outage at 11am»_space; this would mean there is an 8-hour RPO
What is the Recovery Time Objective (RTO)
The time between a failure and the point at which the system comes back into service.
Represents how long it takes to restore a backup
What are the 2 types of backups from an RDS perspective?
Manual Snapshots
Automated Backups
Both of these live in/point to S3
What are Manual Snapshots? What is the retention period?
Manual snaps of a DB at a specific point in time.
You can take as many as you want in whatever increments - you control the RPO.
They like in RDS forever unless you manually delete/clear them.
What are Automated Backups? What is the retention period?
Does this have any disruption associated to it?
Same architecture as the manual snapshots but they occur automatically .
Backups will cause a slight disruption in services, so you want to perform backups in off-business hours during a service window.
Auto-backups are not retained indefinitely; they are automatically cleaned up»_space; you can set the retention settings (between 0 to 35 days).
RDS BACKUP & RESTORE SUMMARY
· When you perform a Restore (from a backup) RDS will create a brand new RDS instance that comes with a new DB endpoint address
○ You have to update any apps to point at the new address which will be it’s CNAME
· Snapshots = single point in time; this means it’s fixed»_space; it’s the point in time that the snapshot was created; this has a direct correlation to the RPO value depending on when the snapshot was taken
· Automated = backups work different.. Because of Transaction Logs that are sent to S3 every 5 min, you can choose a specific point restore the DB to when there is a failure
»> Backups are restored from the closest snapshot, and then transaction logs are replayed from that point onward all the way up to your chosen point in time for the recovery point
· Restores from snapshots are NOT fast; this affects RTO
What is an RDS Read Replica? What type of replication is used?
These are “read-only” copies of an RDS instance.
RR are kept in sync using Asynchronous replication»_space; data is written to the primary DB first, and then once it’s successfully done that, it’s replicated to the Read Replicas.
Can Read Replicas be created in different Regions?
Yes - can be same region as RDS instance or a different region i.e Cross-Region Replication.
What are the 2 main reasons Read Replicas are important?
Scale out a DB READ capacity - You can have 5 x direct RR’s per DB instance.
Offer lower RTO recovery for any instance during a failure - If there is a primary DB failure, you can promote a Read Replica DB to be read + write very quickly, making that the new primary DB.
What’s the main differences between Aurora and RDS?
** Aurora aka Aurora Provisioned Architecture **
Aurora:
- uses Cluster topology versus dedicated EBS storage
- Single primary instance + 0 or more Replicas (up to 15)
- Combines the “read” benefits of Read Replicas and the HA benefits of multi-zone AZ (scale and availability)
- Uses shared cluster volumes for storage/compute instances
Aurora replicates data to six storage nodes in Multi-AZs to withstand the loss of an entire AZ (Availability Zone) or two storage nodes without any availability impact to the client’s applications. On the other hand, RDS MySQL allows only up to five replicas and the replication process is slower than Aurora