AWS Fundamentals: RDS & AURORA & ElastiCache Flashcards
What does RDS stand for
Relatable Database Service
What is SQL?
Structured Query Language
What is RDS?
Managed DB service that uses SQL
What does RDS allow you to do?
Create databases in the cloud, managed by AWS
What kind of Databases are created using RDS?
Postgres
MySQL
MariaDB
Oracle
Microsoft SQL Server
Aurora (AWS Proprietary Database)
Advantage of using RDS instead of deploying DB on EC2?
It is a Managed Service
What does being managed service mean with RDS?
- Automated provisioning, OS patching
- Continuous backups and point in time restore
- monitoring dashboards
- read replicas for improved read performance
- multi AZ setup for DR (Disaster Recovery)
- Maintenance windows for upgrades
- Scaling capability (vertical and horizontal)
- Storage backed by EBS (gp2 or io1)
What can you NOT do with RDS?
SSH into instances
How does RDS Storage Auto Scaling work?
Helps increase storage dynamically
When RDS detects you are running out of free DB storage, it scales automatically
What do you need to set up in RDS for Auto Scale to work?
Maximum Storage Threshold
What parameters does RDS need to meet for Storage Auto Scaling to work automatically?
- Free storage is less than 10% of allocated storage
- Low storage lasts at least 5 minutes
- 6 hours passed since last modification
When is Automatically modify storage helpful in RDS?
When you have apps with unpredictable workload
Which DB is Storage Autoscale modification available for?
MariaDB
MySQL
PostgreSQL
SQL Server
Oracle
What are RDS Read Replicas?
They are replicated instances (of main RDS instance) and are ASYNChcronised
How many Read Replicas can you have?
Up to 15
Where can you have Cross Replicas of RDS?
Within AZ, Cross AZ, Cross Region
What does it mean to by ASYNC?
It means that eventually the reads will be consistent once all replicas are caught up/updated
What can you do with the replicas if you don’t want them anymore?
You can promote them to be their own DB
What does the app need to do in order to leverage read replicas?
Update the connection string
Read Replica Use case
When you have a prod app using an RDS instance, and you want to have a reporting app ontop of that RDS instance. You create an RDS instance replica, because that will not slow down the RDS instance.
This case your RDS DB instance creates an ASYNC replication with the RDS replica and the reporting app is reading from there. Leaving the RDS unaffected.
What are Read Replicas only for?
Reads
When does a network cost incur in AWS?
When data goes from one AZ to another
Do you pay network cost for RDS when moving data from one AZ to another?
No, RDS is except as long as the AZ are in the same region.
What is RDS Multi-AZ used for?
Disaster Recovery
How does RDS Multi-AZ work?
You have the master DB which the app reads/writes. Then you also have another RDS DB instance Standby in a different AZ with a SYNC replication and one DNS name for automatic app failover
What does automatic app failover in RDS need to work?
SYNC replication and ONE (same) DNS name
Can Read Replicas be setup as Multi AZ for Disaster Recovery (RD)?
Yes
Multi AZ vs Read Replicas
Read replicas are to be used for different apps that need the same data
Multi AZ is for disaster recovery by using a standby DB. If anything happens to master DB it switches over to the other one and it becomes a master. Its not accessible before the diaster
How to go from Single AZ to Multi AZ
It has zero downtime (no stopping DB)
Click modify for database, it goes from RDS DB instance to a SYNC replication to the Standby DB
What happens when you go from Single AZ to Multi AZ setup? (technical)
RDS DB instance gets snapshotted, the DB snapshot is restored into the other AZ as a standby DB, and Sync Replication between the 2 happens.
What is RDS Custom?
It is a managed Oracle & Microsoft SQL Server Database with OS and DB customisation capabilities
What does RDS do?
Automates setup, operation, scaling of DB in AWS
What access does RDS Custom give you?
To underlying DB and OS
What can you configure with RDS Custom?
Config settings
Install patches
Enable native features
Access underlying EC2 instance with SSH & SSM
What do you need to de-activate before using RDS Custom?
Automation Mode - take snapshot before
RDS vs RDS Custom?
RDS - Entire db and OS managed by AWS
RDS Custom - full admin access to underlying OS & DB
What is Amazon Aurora?
Proprietary technology from AWS (Not open sourced)
What DB are supported with Amazon Aurora DB?
Postgres & MySQL
How does Aurora storage work?
Grows in increments of 10GB up to 128TB
How many Replicas can Aurora have?
15 and replication is faster
How many replicas can MySQL have
5
What is instantaneous with Aurora?
Failover. HA native
Which is more expensive? RDS or Aurora?
Aurora - 20% more
How many copies of Aurora can you have and across how many AZ?
6 copies across 3 AZ
How many copies of Aurora do you need to operate for writes?
4 out of 6
How many copies of Aurora do you need for read?
3 out of 6
What is Aurora’s self healing with peer to peer replication?
If some data are corrupted it does peer to peer replication healing
How many master instances does Aurora have?
one Master instance
How does Aurora fail over work
It is automatic in less than 30 seconds
How many Read replicas can you have along with the Master instance?
1 master and up to 15 replicas
How does Aurora DB Cluster work?
You have the client, client is connected to Writer Endpoint which points to the master instance. The master instance writes to the shared volume (shared with read instances) and each read instance is connected to the Reader Endpoint which is doing the Connection Load Balancing. And that points to the client.
All read instances are in auto scaling mode
Aurora Features
Automatic Fail-over
Backup and Recovery
Isolation and Security
Industry compliance
Push-button scaling
Automated Patching w/ Zero Downtime
Advanced Monitoring
Routine Maintenance
Backtrack: restore data at any point of time without using backups
How does Replica Autoscaling work?
You have a client that points to writer endpoint which is connected to Aurora Master DB. Master writes on shared storage volume which is shared with Replicas.
If for example you have 2 replicas, and they are overloaded, auto scaling kicks in, and more replicas are created. This also extends the Reader Endpoint so the client can point to those Replicas too. All the replicas are now also reading from the shared storage.
How does Custom Endpoint work in Aurora DB?
If for example you have 2 db.r3 large and 2 db.r5.2xlarge replicas, you can create a custom endpoint and connect the larger replicas to that. Why? because they might be better for analytical queries rather than normal queries. Once you create a custom endpoint, the standard reader endpoint is not used, so you should create custom endpoints for all replicas.
What happens when you create a custom endpoint?
Reader endpoint is stopped being used