RDS Flashcards
What is the best way to instantiate RDS quickly
Restore from a snapshot: the database will have schemas and data ready!
What is the best way to instantiate EBS quickly
Restore from a snapshot: the disk will already be formatted and have data!
What does RDS stand for??
Relational Database Service
What Databases do RDS support (6)
- Postgres
- MySQL
- MariaDB
- Oracle
- Microsoft SQL Server
- Aurora (AWS Proprietary database)
- Automated provisioning, OS patching
- Continuous backups and restore to specific timestamp (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)
RDS
Can you SSH into your RDS instance??
NO
- Helps you increase storage on your RDS DB instance dynamically
- When RDS detects you are running out of free database storage, it scales automatically
RDS – Storage Auto Scaling
You have to set ____________ (maximum limit for DB storage)
Maximum Storage Threshold
RDS – Storage Auto Scaling automatically modify storage if _____ (3)
- Free storage is less than 10% of allocated storage
- Low-storage lasts at least 5 minutes
- 6 hours have passed since last modification
RDS – Storage Auto Scaling is Useful for applications with ____________
unpredictable workloads
Does RDS - Storage Auto Scaling support all RDS database engines??
YES
……….
MariaDB
MySQL
PostgreSQL
SQL Server
Oracle
How many read replicas can an RDS instance have
up to 15 replicas
Can you have RDS in Within AZ, Cross AZ or Cross Region
YES
What type of replication does RDS have?
Async
Can RDS replicas be promoted to their own DB??
YES
Applications must update the __________ to leverage read replicas
connection string
- You have a production database that is taking on normal load
- You want to run a reporting application to run some analytics
- You create a Read Replica to run the new workload there
- The production application is unaffected
- Read replicas are used for SELECT (=read) only kind of statements (not INSERT, UPDATE, DELETE)
RDS Read Replicas – Use Cases
Is there a cost, in AWS, when data goes from one AZ to another??
YES
Is there a cost, in AWS, for RDS Read Replicas within the same region??
NO
What type of replication does RDS Multi AZ (Disaster Recovery) have??
SYNC
- One DNS name – automatic app failover to standby
- Increase availability
- Failover in case of loss of AZ, loss of network, instance or storage failure
- No manual intervention in apps
- Not used for scaling
RDS Multi AZ (Disaster Recovery)
What is the downtime to switch from a single AZ to a multi-AZ??
0 downtime
What happens internally when you switch from single AZ to a multi AZ??
- A snapshot is taken
- A new DB is restored from the snapshot in a new AZ
- Synchronization is established between the two databases
Managed Oracle and Microsoft SQL Server Database with OS and database customization
RDS Custom
Allows you 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
RDS Custom
Aurora is “AWS cloud optimized” and claims 5x performance improvement over _________ on RDS, over 3x the performance of _________ on RDS
MySQL
Postgres
Aurora storage automatically grows in increments of _________, up to ________.
10GB
128 TB
What is Aurora’s replica lag time???
sub 10ms
Are Failovers in Aurora is instantaneous????
YES
Does Aurora cost more?? If so, how much more??
YES.
20%
6 copies of your data across 3 AZ:
* 4 copies out of 6 needed for writes
* 3 copies out of 6 need for reads
* Self healing with peer-to-peer replication
* Storage is striped across 100s of volumes
RDS Aurora
Automated failover for master in less than _________
30 seconds
Can RDS Aurora support Cross Region Replication
YES
- 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 at any point of time without using backups
Features of Aurora (9)
- 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
Aurora Serverless
- In case you want continuous write availability for the writer nodes
- Every node does R/W - vs promoting a Read Replica as the new master
Aurora Multi-Master
- Useful for disaster recovery
- Simple to put in place
Aurora Cross Region Read Replicas:
- 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 of < 1 minute
- Typical cross-region replication takes less than 1 second
Aurora Global Database (recommended):
Enables you to add ___________ predictions to your applications via SQL
Aurora Machine Learning
What are 2 supported services by Aurora Machine learning?
- Amazon SageMaker (use with any ML model)
- Amazon Comprehend (for sentiment analysis)
Are RDS Backups Automated??
YES
How often are full RDS backups taken??
Daily (During the backup window)
Transaction logs are backed-up by RDS every __________ minutes
5
Doe you have the ability to restore RDS to any point in time??
YES
How to disable RDS backups??
Set retention to 0
What is the retention of Manual DB snapshots??
As long as you want
Trick: in a stopped RDS database, you will still pay for storage. If you plan on stopping it for a long time, you should snapshot & restore instead
Aurora Backups -
* 1 to 35 days (cannot be disabled)
* point-in-time recovery in that timeframe
Automated backups
Aurora Backups -
* Manually triggered by the user
* Retention of backup for as long as you want
Manual DB Snapshots
Restoring a RDS / Aurora backup or a snapshot creates a _______?
new database
Restoring MySQL RDS database from S3 (3)
- 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 (3)
- Create a 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
- Create a new Aurora DB Cluster from an existing one
- Faster than snapshot & restore
- Uses copy-on-write protocol
- Initially, the new DB cluster uses the same data volume as the original DB cluster (fast and efficient – no copying is needed)
- When updates are made to the new DB cluster data, then additional storage is allocated and data is copied to be separated
- Very fast & cost-effective
- Useful to create a “staging” database from a “production” database without impacting the production database
Aurora Database Cloning
RDS & Aurora Security -
* Database master & replicas encryption using AWS KMS – must be defined as launch time
* If the master is not encrypted, the read replicas cannot be encrypted
* To encrypt an un-encrypted database, go through a DB snapshot & restore as encrypted
At-rest encryption:
RDS & Aurora Security … TLS-ready by default, use the AWS TLS root certificates client-side
In-flight encryption
IAM roles to connect to your database (instead of username/pw)
IAM Authentication
Control Network access to your RDS / Aurora DB
Security Groups
Is SSH available for RDS / Aurora?
No, but it is for RDS Custom
RDS & Aurora Security - Audit Logs can be ________ and sent to _______ for longer retention
enabled
CloudWatch Logs
- Fully managed
- Allows apps to pool and share DB connections established with the database
- Improving database efficiency by reducing the stress on database resources (e.g., CPU, RAM) and minimize open connections (and timeouts)
- Serverless, autoscaling, highly available (multi-AZ)
- Reduced RDS & Aurora failover time by up 66%
- Supports RDS (MySQL, PostgreSQL, MariaDB, MS SQL Server) and Aurora (MySQL, PostgreSQL)
- No code changes required for most apps
- Enforce IAM Authentication for DB, and securely
store credentials in AWS Secrets Manager - Is never publicly accessible (must be accessed from VPC)
Amazon RDS Proxy
- Caches are in-memory databases with really high performance, low latency
- Helps reduce load off of databases for read intensive workloads
- Helps make your application stateless
- AWS takes care of OS maintenance / patching, optimizations, setup, configuration, monitoring, failure recovery and backups
Amazon ElastiCache Overview
Amazon ElastiCache Overview managed which to Cache services?
Redis and Memcached
- Multi AZ with Auto-Failover
- Read Replicas to scale reads and have high availability
- Data Durability using AOF persistence
- Backup and restore features
- Supports Sets and Sorted Sets
REDIS
- Multi-node for partitioning of data (sharding)
- No high availability (replication)
- Non persistent
- No backup and restore
- Multi-threaded architecture
MEMCACHED
ElastiCache supports IAM Authentication for ________
Redis
IAM policies on ElastiCache are only used for?
AWS API-level security
- You can set a “password/token” when you create a
Redis cluster - This is an extra level of security for your cache (on top of security groups)
- Support SSL in flight encryption
Redis AUTH
Supports SASL-based authentication (advanced)
Memcached
Patterns for ElastiCache (3)
Lazy Loading
Write Through
Session Store
Patterns for ElastiCache - all the read data is cached, data can become stale in cache
Lazy Loading
Patterns for ElastiCache - Adds or update data in the cache when written to a DB (no stale data)
Write Through
Patterns for ElastiCache - store temporary session data in a cache (using TTL features)
Session Store