RDS + Aurora + ElastiCache Flashcards
What is AWS RDS?
Relational Database Service.
Managed DB service w/ SQL as a query language. It allows you to create cloud databases managed by AWS.
What databases are supported by RDS?
- Postgres
- MySQL
- MariaDB
- Oracle
- Microsoft SQL Server
- Aurora (AWS proprietary database)
What is RDS storage auto scaling?
Helps you increate RDS DB storage dynamically. When RDS detects you’re running out of free space, it scales automatically.
Avoids manually scaling your database storage.
Must set Maximum Storage Threshold. Helpful for apps with unpredictable workloads.
When will RDS automatically scale your storage?
When:
- free storage is less than 10% of allocated
- low-storage lasts at least 5 minutes
- 6 hours have passed since last modification
What is RDS read replicas?
Helps you scale your reads. Apps must update the connection string to leverage read replicas.
You can have up to 5 replicas, either within AZ, cross AZ, or cross region.
Replication is ASYNC so reads are “eventually consistent”.
Replicas can be promoted to their own DB.
Describe situation when RDS read replicas might be useful
have a prod database, but need to run analytics on the database which would overload it.
instead - create read replica to run analytics against so it doesn’t overload prod
Do you pay network costs for creating RDS read replica in same region? Different region?
RDS replicas in same region - no fee
eg. us-east-1a -> us-east-1b = free
RDS replica in different region - fees for cross-region
eg. us-east-1a, eu-west-1b = not free
Can you set up RDS Read Replicas as multi-AZ for disaster recovery?
Yes. This can be done as synchronous replication. Acts as failover in case of loss of AZ, loss of network, or instance storage failure.
How do we make RDS database go from single AZ to multi AZ?
Just click on “modify” for the database, and enable “multi AZ”
this is a zero downtime operation
- snapshot is taken
- new db restored from snapshot in new az
- synchronization is established between the two databases
True or false:
You can encrypt RDS read replicas, even if the master DB itself is not encrypted.
False.
If the master is not encrypted, the read replicas CANNOT be encrypted.
How do you encrypt an unencrypted RDS database?
- create snapshot of unencrypted db
- copy snapshot and enable encryption for the snapshot
- restore the db from encrypted snapshot
- migrate applications to the new db
- delete the old db
What is amazon Aurora?
proprietary technology from AWS that is cloud optimized, claims 5x performance improvement over mySQL on RDS, 3x performance of postgres
aurora storage automatically grows in increments of 10GB, up to 128TB
up to 15 replicas, and replication process is faster than mysql
failover in aurora is instantaneous
What is the writer endpoint and reader endpoint in an Aurora DB cluster?
The writer endpoint points to the master db.
The reader endpoint handles connection load balancing, and connects to the read replica DBs.
Read replicas can be auto scaling.
What AWS services support Aurora machine learning?
- Amazon SageMaker
2. Amazon Comprehend
Does ElastiCache support IAM authentication?
No. Elasticache does not support IAM auth.
Name and describe the 3 patterns for ElastiCache
- Lazy loading - all read data is cached, data becomes stale in cache
- Write through - adds or updates data in cache when written to DB (no stale data)
- Session store - store temporary session data in a cache (using TTL features)
Gaming Leaderboard is a great use case for what AWS service?
ElastiCache - Redis
Redis sorted sets guarantee both uniqueness and element ordering. Each time a new element is added, it’s ranked in real time, then added in correct order.
Amazon RDS supports the following databases, EXCEPT:
a. mongodb
b. mysql
c. mariadb
d. microsoft sql server
a. mongodb
RDS supports MySQL, PostgreSQL, MariaDB, Oracle, MS SQL Server, and Amazon Aurora.
You’re planning for a new solution that requires a MySQL database that must be available even in case of a disaster in one of the Availability Zones.
What should you use?
Multi-AZ helps when you plan a disaster recovery for an entire AZ going down. If you plan against an entire AWS Region going down, you should use backups and replication across AWS Regions.
We have an RDS database that struggles to keep up with the demand of requests from our website. Our million users mostly read news, and we don’t post news very often.
Which solution is NOT adapted to this problem?
a. an ElastiCache cluster
b. RDS multi-az
c. RDS read replicas
b. RDS multi-az
Be very careful with the way you read questions at the exam. Here, the question is asking which solution is NOT adapted to this problem. ElastiCache and RDS Read Replicas do indeed help with scaling reads.
You have set up read replicas on your RDS database, but users are complaining that upon updating their social media posts, they do not see their updated posts right away.
What is a possible cause for this?
read replicas have async replication, therefore it’s likely your users will only read eventual consistency
Which RDS (NOT Aurora) feature when used does not require you to change the SQL connection string?
a. multi-az
b. read replicas
a. multi-az
Multi-AZ keeps the same connection string regardless of which database is up.
Your application running on a fleet of EC2 instances managed by an Auto Scaling Group behind an Application Load Balancer. Users have to constantly log back in and you don’t want to enable Sticky Sessions on your ALB as you fear it will overload some EC2 instances.
What should you do?
Store session data in elasticache
Storing Session Data in ElastiCache is a common pattern to ensuring different EC2 instances can retrieve your user’s state if needed.
An analytics application is currently performing its queries against your main production RDS database. These queries run at any time of the day and slow down the RDS database which impacts your users’ experience.
What should you do to improve the users’ experience?
set up a read replica
Read Replicas will help as your analytics application can now perform queries against it, and these queries won’t impact the main production RDS database.