Fundamentals-RDS,Aurora,ElastiCache Flashcards
Amazon ____ is a managed DB service that allows you to create databases in the cloud that are managed by AWS.
RDS
List 7 database engines that are supported by Amazon RDS
Postgres, MySQL, MariaDB, Oracle, Microsoft SQL Server, IBM DB2, Aurora
Advantage of RDS vs deploying DB on EC2:
Because RDS is a managed service:
- automated provisioning, OS patching
- continous backups and restore to specific timestamp (Point in Time Restore)
- monitoring dashboards
- read replicas for improved read performance
- multi AZ setup for disaster recovery
- maintenance windows for upgrades
- scaling capability (vertical and horizontal)
- storage backed by EBS
One disadvantage of Amazon RDS is that you cannot ____ into your instances. Since they are managed services, you don’t have access to the underlying EC2 instance.
SSH
What RDS feature can help you increase storage on your RDS DB instance automatically when it detects you are running out of free database storage?
RDS - Storage Auto Scaling
When configuring RDS Storage Auto Scaling, you need to set a ____ that will be the maximum limit for DB storage.
Maximum Storage Threshold
Amazon RDS Storage Auto Scaling will automatically modify storage if:
- free storage is less than ____% of allocated storage
- low-storage lasts at least ____ minutes
- ____ hours have passed since the last modification
10
5
6
Amazon RDS Storage Auto Scaling is useful for applications with ____ workloads.
unpredictable
Which RDS database engines are supported with the Storage Auto Scaling feature?
all of them
Postgres, MySQL, MariaDB, Oracle, Microsoft SQL Server, IBM DB2, Aurora
You can have up to ____ read replicas when using Amazon RDS.
15
This provides read scalability.
Read replicas with Amazon RDS can be Within AZ, Cross AZ or Cross Region.
Amazon RDS replication is ____, so the reads are eventually consistent.
async
Amazon RDS read replicas can be ____ to their own DB.
promoted
In order to use Amazon RDS read replicas, the application must update the ____ to leverage the read replicas.
connection string
Use case for RDS Read Replicas:
- You have a production database for the normal load
- You want to run a reporting application for analytics
- You create the read replica to run the reporting against and the production database is not impacted.
Normally, there is a network cost when data goes from one AZ to another.
For RDS read replicas within the same ____, you don’t pay that fee.
region
RDS Multi AZ is used for disaster recovery by using ____ replication to a standby RDS DB instance.
This standby instance is not used/accessible unless there is a failover to it.
sync
No manual intervention in the apps.
Not used for scaling.
RDS Multi AZ provides automatic app failover by using one ____ name.
DNS
RDS Multi AZ ____ can be triggered in the case an AZ loss, network loss, instance or storage failure.
failover
An alternative RDS Multi AZ disaster recovery setup to using a standby DB instance, is to use your RDS ____ if they are located in separate AZs.
read replicas
With RDS, to convert from a Single-AZ to Multi-AZ, there is no need to stop the DB. It is a zero downtime operation.
You simply click the “modify” option for the database.
Behind the scenes, how does it work:
- A snapshot is taken of the RDS DB instance
- A new DB is restored from the snapshot in a new AZ
- Synchronization is started between the two databases
With RDS ____, you have access to the OS and database customization.
Which two database engines are support by this feature?
Custom
Oracle and Microsoft SQL Server
RDS Custom allows access to the underlying database and OS so you can:
- configure settings
- install patches
- enable native features
- access the underlying EC2 instance using SSH or SSM Session Manager
When using RDS Custom, before you customize anything it is recommended that you do what two things?
deactivate automation mode
take a DB snapshot
Amazon ____ is a proprietary DB from AWS (not open source) that is compatible with Postgres and MySQL.
Aurora
Amazon Aurora is “AWS Cloud Optimized” and performance is 5x better than MySQL on RDS and 3x better than Postgres on RDS.
Amazon Aurora storage automatically grows in increments of __ GB, up to ___ TB.
10
128
Amazon Aurora can have up to __ read replicas and the replication process is faster than MySQL (sub 10 ms replica lag).
15
Failover in Amazon Aurora is ____ and is much faster than Multi AZ on RDS.
It is also high availability natively.
instantaneous
Amazon Aurora costs about 20% ____ than RDS, but is more efficient especially at scale.
more
Amazon Aurora stores __ copies of your data across __ AZs
- __ copies out of __ needed for ____
- __ copies out of __ needed for ____
- self healing with peer-to-peer replication
- storage is striped across 100s of volumes
6,3
4,6, writes
3,6, reads
Amazon Aurora supports:
- automated ____ for master in less than 30 seconds.
- up to __ Aurora read replicas.
- ____ replication
failover
15
Cross Region
Amazon Aurora uses a ____ endpoint that points to the master DB so you always know which DB is the master. This is done via a DNS.
Amazon Aurora uses a ____ endpoint that points to all the read replicas via connection load balancing.
Amazon Aurora’s read replicas can ____ up to the maximum number of replicates allowed, 15.
Amazon Aurora uses a ____ storage volume that can auto expand from 10GB to 128TB.
writer
reader
auto scale
shared
Features of Amazon Aurora:
- automatic fail-over
- backup and recovery
- isolation and security
- industry compliance
- push-button scaling
- automated patching with zero downtime
- advanced monitoring
- routine maintenance
- backtrack: restore data to any point in time without using backups
You can define a subset of Aurora replica instances as a ____ endpoint.
This allows you to run analytical queries on specific replicas.
Generally, the reader endpoint is not used after defining Custom Endpoints as you would create multiple custom endpoints to cover your replicas.
custom
Aurora Serverless:
- automated database instantiation and auto-scaling based on actual usage
- good for infrequent, intermittent or unpredictable workloads
- no capacity planning needed
- pay per second, can be more cost-effective
Global Aurora:
Cross Region read replicas are useful for ____.
disaster recovery
Global Aurora:
Aurora Global Database:
- 1 primary region (read / write)
- up to 5 secondary (read-only) regions, replication lag is less than 1 second
- up to 16 read replicas per secondary region
- helps for decreasing latency
- promoting another region (for disaster recovery) has an RTO < 1 minute
- typical cross-region replication takes less than 1 second
Aurora ____ enables you to add ML-based predictions to your applications via SQL.
You don’t need to have ML experience.
Machine Learning
Aurora ____ provides simple, optimized, and secure integration between Aurora and AWS ML services.
Machine Learning
What two AWS services support the Aurora Machine Learning feature?
Amazon SageMaker (use with any ML model)
Amazon Comprehend (for sentiment analysis)
What are some use cases for Aurora Machine Learning?
fraud detection, ad targeting, sentiment analysis, product recommendations
What are the two backup options for an RDS database?
automated
manual DB snapshot
RDS automated backups do a ____ fully backup of the database (during the backup window).
Transaction logs are backed-up by RDS every ____.
To disable the automated backups, you set the days of retention to ____.
Automated backups provide the ability to restore to any point in time (from oldest backup to ____ ago)
daily
5 minutes
0
5 minutes
RDS ____ are manually triggered backups by the user.
Unlike RDS automated backups that can only be kept up to 35 days, manual backups ____.
manual DB snapshots
are kept as long as you want
RDS backup trick:
Let’s say you have a RDS database that you plan to have stopped for a long time. You still will be paying for that storage. Instead, take a manual snapshot of the RDS database and then delete it. This way you are only paying for the cheaper snapshot storage. Then just restore the database when you need to use it again.
Aurora automated backups can be retained from 1 to 35 days.
Unlike RDS automated backups, they cannot be ____.
Aurora manual DB snapshots are the same as RDS in that:
- ?
- ?
disabled
manually triggered
backups are kept as long as you want
Restoring an RDS / Aurora backup or a snapshot creates ____.
a new database
Restoring MySQL RDS database from S3
- create a backup of your on-premises database
- store it on Amazon S3 (object storage)
- restore the backup file onto a new RDS instance running MySQL
Restoring MySQL Aurora cluster from S3
- create backup of your on-premises database using Percona XtraBackup
- store the backup file on Amazon S3
- restore the backup file onto a new Aurora cluster running MySQL
Aurora database ____ allows you to create a new Aurora DB cluster from an existing one.
cloning
Aurora Database cloning is faster than a ____.
snapshot and restore
Aurora database cloning uses a ____ protocol:
- initially, the new DB cluster uses the same data volume as the original DB cluster (fast and efficient - no copying needed)
- when updates are made to the new DB cluster data, then additional storage is allocated and data is copied to be separated
copy-on-write
What Aurora feature is useful to create a “staging” database from a “production” database without impacting the production database?
Aurora Database Cloning
With ____ encryption, RDS master and replicas encryption using AWS KMS.
at-rest
When using at-rest encryption with RDS and Aurora, the encryption must be defined at ____.
launch time
With at-rest encryption for RDS and Aurora, if the ____ is not encrypted, then the read replicas cannot be encrypted.
master
To encrypt an un-encrypted RDS / Aurora database, you must perform what steps?
take a DB snapshot and restore as encrypted
Amazon RDS provides ____ encrpytion by default with TLS.
You can use the AWS TLS root certificates client-side.
in-flight
Using ____, you can use Roles to connect to your database (instead of username/pw).
IAM Authentication
____ control network access to your RDS / Aurora DB.
security groups
There is no SSH available on RDS / Aurora except on RDS ____.
Custom
Audit logs can be enabled on RDS and sent to ____ logs for longer retention.
CloudWatch
Amazon RDS ____ is a fully managed database proxy for RDS.
Proxy
Amazon ____ allows apps to pool and share DB connections established with the database.
RDS Proxy
Amazon RDS Proxy can improve database efficiency by reducing stress on ____ and minimize ____.
database resources (CPU, RAM, etc)
open connections (and timeouts)
Features of Amazon RDS Proxy:
- serverless
- auto scaling
- highly available (multi-AZ)
Amazon RDS Proxy can reduce RDS / Aurora failover time by up to 66%.
Amazon RDS Proxy supports:
- RDS: MySQL, PostgreSQL, MariaDB, MS SQL Server
- Aurora: MySQL, PostgreSQL
No code changes are required in most apps to use Amazon RDS Proxy.
Just point the database connection to the proxy.
Amazon ____ allows you to enforce IAM authentication for DB, and securely store credentials in AWS Secrets Manager.
RDS Proxy
The RDS Proxy is never ____ accessible.
publicly
only accessible from VPC
Use RDS Proxy to pool connections from ____ functions to reduce timeouts and open connections.
Lambda
The three main uses for Amazon RDS Proxy:
- minimize and pool connections on RDS instances
- reduce RDS failover time
- enforce IAM authentication for DB
Amazon ____ is a way to get managed Redis or Memcached databases.
ElastiCache
____ are in-memory databases with really high performance, low latency.
They help to reduce the load off databases for read intensive workloads.
Helps make your application stateless.
Caches
With Amazon ____, AWS takes care of OS maintenance / patching, optimizations, setup, configuration, monitoring, failure, recovery and backups for in-memory databaeses.
ElastiCache
Using ElastiCache involves heavy ____ changes.
application code
ElastiCache Solution Architecture - DB Cache
Applications query ElastiCache, if not available, get from RDS and store in ElastiCache.
Cache must have an ____ strategy to make sure only the most current data is used.
invalidation
ElastiCache Solution Architecture - User Session Store (making application stateless)
- user logs into any of the application
- the application writes the session data into ElastiCache
- the user hits another instance of the application
- the instance retrieves the data and the user is already logged in
Redis vs Memcached
ElastiCache supports IAM Authentication for ____ only, for the rest you use username/password.
Redis
IAM policies on ElastiCache are only used for AWS ____ security.
API-level
Memcached with ElastiCache supports ____-based authentication.
SASL
With Redis AUTH:
- you can set a “password/token” when you create a Redis cluster
- provides an extra level of security for your cache (on top of security groups)
- supports SSL in-flight encryption
Which ElastiCache loading pattern is described:
All the read data is cached, data can become stale in cache. Only when you don’t find data in cache do you then load ElastiCache.
a) lazy loading
b) write through
c) session store
lazy loading
Which ElastiCache loading pattern is described:
Adds or update data in the cache when written to a DB (no stale data)
a) lazy loading
b) write through
c) session store
write through
Which ElastiCache loading pattern is described:
store temporary session data in a cache (using TTL features)
a) lazy loading
b) write through
c) session store
session store
Redis ____ guarantee both uniqueness and element ordering.
Each time a new element is added, it is ranked in real time, then added in the correct order. Very userful for gaming leaderboards.
sorted sets
You should be able to differentiate between an Important (HTTPS - port 443) and a database port (PostgreSQL - port 5432) :
Important Ports:
- FTP: 21
- SSH: 22
- SFTP: 22
- HTTP: 80
- HTTPS: 443
RDS Database Ports:
- PostgreSQL: 5432
- MySQL: 3306
- Oracle RDS: 1521
- MSSQL Server: 1433
- MariaDB: 3306
- Aurora: 5432 (if PostgreSQL compatible) or 3306 (if MySQL compatible)