Section 5: AWS Fundamentals: Route 53 + RDS + ElastiCache + VPC Flashcards
What is Route53?
A managed DNS
In AWS, what are the 4 most common records?
What are their use case? ___ to ___
A: URL to IPv4
AAAA: URL to IPv6
CNAME: URL to URL
Alias: URL to AWS resource.
What is the preferred record for cross referencing AWS resources?
Alias
What type of domain can Route53 use
Public domains you own (or buy)
Private domains that can be resolved by your instances in your VPCs
What are some advanced features Route53 has?
Load balancing through DNS (also called client load balancing)
Health Checks (limited)
Routing policies
What are some routing policies which Route53 is able to handle?
simple, failover, geolocation, geoproximity, latency, weighted
What does RDS stand for?
Relational Database Service
What is AWS RDS?
A managed DB service for DB which use SQL as a query language
What DB can be created with AWS RDS?
MySQL Postgres MariaDB Microsoft SQL Server Oracle Aurora (AWS Proprietary DB)
Why use RDS rather than installing a DB on an EC2 instance?
Itโs a managed service, which comes with those advantages:
- OS Patching
- Continuous backups and restore
- Monitoring dashboards
- Read replicas
- Multi AZ
- Maintenance windows
- Scaling capability
What is one drawback of using RDS rather than an EC2?
You canโt SSH into your instances
What are RDS Read Replicas used for?
Improving read scalability
How many Read Replicas can an RDS DB instance have?
Up to 5
What must the developer do to read from an RDS instance Read Replica?
Update the connection string (because the main connection string, which is used for writing to the DB, would also read from the main master DB)
What is the synchronicity of RDS DB replication to RDS DB Read Replica?
Asynchronous
What is the purpose of RDS Multi AZ
Disaster recovery
Not used for scaling
What must the developer do to start using RDS standby DB in case of disaster?
Nothing, the DNS name automatically points to the new DB instance if the main one fails
What is the synchronicity of RDS DB replication to RDS stand by DB (Multi AZ)?
Synchronous
What are automated RDS backups?
Daily full snapshot of the DB
When are RDS transaction logs captured?
In real time
With RDS backups, you can restore at what point in time?
Any, transaction logs are captured in real time
What is the default retention for automated RDS backups?
7 days
What is the maximum retention for RDS automated backups
35 days
What is the retention for manually triggered RDS DB Snapshots?
As long as you want
Is encryption available for AWS RDS?
Yes
At rest with AWS KMS (AWS-256)
In flight with SSL certificates
How to enforce SSL on Postgres?
By setting
rds.force_ssl=1 in the AWS RDS Console (Paratemer Groups)
How to enforce SSL on MySQL?
By running the following command in the DB:
ALTER USER โencrypted_userโ@โ%โ REQUIRE SSL;
or
GRANT USAGE ON . TO โmysqluserโ@โ%โ REQUIRE SSL;
How to connect to an RDS hosted DB with SSL?
Provide the SSL Trust certificate (can be downloaded from AWS)
Provide SSL options when connecting to database
In what type of subnet are RDS databases usually deployed?
Private
What does RDS Security leverages?
Security groups
What helps us define who can manage AWS RDS?
IAM policies
What is the traditional way to login to an RDS DB
With a username and password
What new alternative way now exists to connect to an RDS DB?
IAM users
What is AWS Aurora
A proprietary technology from AWS
How much faster is Aurora compared to MySQL on RDS and Postgres on RDS?
5x faster than MySQL
3x faster than Postgres
In increments of what size does Aurora storage automatically grows, and up to what size?
Increments of 10GB, up to 64TB
How many replicas can Aurora have? What about MySQL
Aurora: 15
MySQL: 5
How long is the replication process for Aurora
10ms
How fast is failover in Aurora?
Instantaneous
How much more expensive is Aurora over other DB hosted on RDS?
20%, but itโs more efficient
What is AWS ElastiCache?
A managed service to setup a Redis or Memcached cache
What are caches?
In-memory databases with really high performance and low latency
What are the two main purposes of caches?
Reduce load of databases for rend intensive workloads
Make your application stateless (User session store)
What do caches use for write scaling?
Sharding
What do caches use for read scaling?
Read replicas
What do caches use for failover capability? (Disaster recovery)
Multi AZ
Why use ElastiCache rather than a custom cache set on an EC2 instance?
AWS takes care of maintenance, updates, optimisations, setup, monitoring, failure recovery and backups
What does the cache need to have in order to make sure that only current data is present?
An invalidation strategy
What does a DB cache provide?
A load relief in RDS
How does a cache help with user sessions?
- User logs into any of the application instance
- Application store user session in the cache
- User hits another app instance
- Instance retrieves the user session from cache
What are the two type of cache supported by ElastiCache
Redis and Memcached
What is Redis?
An in-memory key-value store
How fast is Redis?
VERY FAST! Super low latency (Sub ms)
What happens to a Redis cache if the machine reboots?
The cache persists
What is Redis good for?
Hosting user sessions, leaderboard (for gaming), distributed states, relieve pressure on databases, pub/sub capability for messaging
Does Memcached survive reboots?
No
What is Memcached?
An in-memory object store
What is the most popular between Memcached and Redis?
Redis
What is ElastiCache good for in general?
Read-heavy applications
Compute-intensive workloads
What are two patterns/cache strategies for ElastiCache?
Lazy Loading
Write Through
What is the lazy loading cache strategy for ElastiCache?
- Read request comes in
- App checks if ElastiCache has the desired value
- If not, app fetches the data from DB
- Stores the value in ElastiCache for further access
- Returns result to user
What are the pros of the lazy loading cache strategy for ElastiCache?
Only requested data is in the cache
Node failures are not fatal
What are the cons of the lazy loading cache strategy for ElastiCache?
Cache miss penalty in 3 round trips (noticeable delay)
There can be stale data if invalidation strategy for cache is bad or non-existent
What is the write through cache strategy for ElastiCache?
- User post request
- App write to DB
- App write to cache
What are the pros of the write through cache strategy for ElastiCache?
Data in cache is never stale
Write penalty is much smaller than the read penalty (much less noticeable)
What are the cons of the write through cache strategy for ElastiCache?
Missing data until it's added/updated Cache churn (a lot of data will never be read)
How to mitigate the con of missing data when using the write through cache strategy for ElastiCache?
Using the lazy loading strategy as well
What does VPC stand for?
Virtual Private Cloud
What is a VPC scoped to?
A region and an AWS account
What do VPCs contain?
Subnets
What are subnets scoped to?
An AZ
What are two types of subnets?
Public and private
How many subnets are in an AZ?
As many as you want
What is a subnet?
A logical subdivision of an IP network
What do public subnets usually contain?
Load balancers
Static websites
Publicly accessible files
Public authentication layers
What do private subnets usually contains?
Web application servers
Databases
Can public and private subnets communicate?
Yes, if they are in the same VPC
How to connect to a VPC and access all private IPs from your laptop?
By using a VPN
How to monitor traffic within, in and out of your VPC?
By looking at the VPC Flow Logs
What is a typical 3-tier Web App?
A web app with a facing load balancer whose IP is findable in a public subnet through an Alias record in Route 53. The LB distributes load to EC2 instances spread accross AZ and scalled on demand by an ASG in a private subnet. Those instances communicate with a cache and a DB which are both also in the default private subnet or another private subnet like โdataโ. All resources, both in public and private subnets are protected by security groups.