RDS, Aurora, and ElastiCache Flashcards
(22 cards)
What are the benefits of RDS being a managed service?
- Automated provisioning
- Continuous backups and point in time restore
- Monitoring dashboards
- Read replicas
- Multi AZ setup for disaster recovery
What are the conditions of RDS auto scaling?
- Free storage is less that 10%
- Low-storage lasts at least 5 minutes
- 6 hours have passed since last modification
Regarding read replicas in Aurora, how many can you create, how is the data replicated, and what other benefits may they provide?
Allows you to scale up to 15 read replicas that can either be within AZ, cross AZ, or cross region. This replication is async which means it is eventually consistent (very quick). They can also be promoted to their own database aswell. (Good use case is duplicating data to another database for a reporting application to run on)
When will read replica network usage be charged?
When the read replica is in a different region
What does RDS Mutli AZ allow you to do?
Multi AZ is sync replication and is purely used as a standby database in case failover is required
How can you change an RDS from single-AZ to multi-AZ?
Just click ‘modify’ in the database, it is a zero downtime operation
What increments does Aurora storage grow in?
10gb
Why is Aurora good for high availibity and read scaling?
6 copies of your data will be stored across 3 AZ
How does reading and writing from Aurora work?
There is 1 primary Aurora instance which manages all writes and up to 15 read replicas which will access a shared storage volume.
Define a writer and reader endpoint
Writer endpoint - Points to a master instance which will perform writes
Reader endpoint - Connection point which will load balance traffic across multiple read replicas
What are the 2 forms of encryption?
- At-rest encryption where the storage is encrypted using AWS KMS
- In-flight encryption which uses AWS TLS root certificates client side
Why would you want to use an Amazon RDS Proxy? (3 primary reasons)
Allows you to pool and share DB connections into a database, thus improving database efficiency. Also reduces failover time by up to 66% and allows you to enforce IAM authentication.
What is the purpose of Amazon ElastiCache?
It is a managed service for Redis or MemCache
Describe how AWS ElastiCache could be used to manage user sessions
AWS ElastiCache can be used to store and manage user sessions by saving session data (like login status, user preferences, etc.) in an in-memory cache. When a user logs in, their session information is stored in Redis. Each time the user interacts with the application, the session data can be quickly retrieved from the cache, improving performance. ElastiCache’s fast access speeds make it ideal for handling large numbers of user sessions in real-time.
How does Redis handle read and writes to ensure availability?
Read replicas are created across multiple AZ’s. A single master node handles all write operations.
What technology does Memcached use? What is 1 benefit and 1 downside of this technology?
Sharding allowing for multi-threaded architecture but no high availability
Describe the lazy loading / cache aside / lazy population cache strategy and list 2 pros and 2 cons?
When data is requested, the cache is checked to see if it contains an entry. If it does, that entry is returned from the cache. If it doesn’t the request is then sent to the database, and then returned to the client. The client will also write the data to the cache for the next request.
Pros:
1. Only requested data is cached
2. Node failures are not fatal
Cons:
1. Cache miss penalty means 3 round trips
2. Data in cache may be out of data (although eventually consistent) with DB
What are the 2 ElastiCache strategies?
- Lazy loading/cache aside/lazy population
- Write through
Describe the write through cache strategy and list 2 pros and 2 cons.
When data is written to the database, it is also written to the cache.
Pros:
1. Data in cache is never stale and reads are quick
2. Write penalty is longer than read penalty which users expect
Cons
1. Missing data in cache until the data is written to DB (can be mitigated using lazy loading)
2. Cache churn - lots of data is written to cache
What are three ways to ensure cache size does not get too large (via cache eviction)?
Enforce cache eviction using
- Explicitly deleting items
- Evict items when memory is being filled based on least recently used
- Set a time-to-live (TTL)
What is MemoryDB? List 3 benefits.
Provides a redis-compatible, durable, in-memory database service. Benefits include:
1. Ultra-fast performance
2. Seamless scaling
3. Durable
Which of the following RDS features when used does not require you to change the SQL connection string:
1. Read replicas
2. Multi-AZ
Multi-AZ