AWS Fundamentals: RDS & AURORA & ElastiCache Flashcards

1
Q

What does RDS stand for

A

Relatable Database Service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is SQL?

A

Structured Query Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is RDS?

A

Managed DB service that uses SQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does RDS allow you to do?

A

Create databases in the cloud, managed by AWS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What kind of Databases are created using RDS?

A

Postgres
MySQL
MariaDB
Oracle
Microsoft SQL Server
Aurora (AWS Proprietary Database)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Advantage of using RDS instead of deploying DB on EC2?

A

It is a Managed Service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does being managed service mean with RDS?

A
  1. Automated provisioning, OS patching
  2. Continuous backups and point in time restore
  3. monitoring dashboards
  4. read replicas for improved read performance
  5. multi AZ setup for DR (Disaster Recovery)
  6. Maintenance windows for upgrades
  7. Scaling capability (vertical and horizontal)
  8. Storage backed by EBS (gp2 or io1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What can you NOT do with RDS?

A

SSH into instances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does RDS Storage Auto Scaling work?

A

Helps increase storage dynamically
When RDS detects you are running out of free DB storage, it scales automatically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do you need to set up in RDS for Auto Scale to work?

A

Maximum Storage Threshold

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What parameters does RDS need to meet for Storage Auto Scaling to work automatically?

A
  1. Free storage is less than 10% of allocated storage
  2. Low storage lasts at least 5 minutes
  3. 6 hours passed since last modification
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When is Automatically modify storage helpful in RDS?

A

When you have apps with unpredictable workload

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which DB is Storage Autoscale modification available for?

A

MariaDB
MySQL
PostgreSQL
SQL Server
Oracle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are RDS Read Replicas?

A

They are replicated instances (of main RDS instance) and are ASYNChcronised

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How many Read Replicas can you have?

A

Up to 15

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Where can you have Cross Replicas of RDS?

A

Within AZ, Cross AZ, Cross Region

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does it mean to by ASYNC?

A

It means that eventually the reads will be consistent once all replicas are caught up/updated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What can you do with the replicas if you don’t want them anymore?

A

You can promote them to be their own DB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does the app need to do in order to leverage read replicas?

A

Update the connection string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Read Replica Use case

A

When you have a prod app using an RDS instance, and you want to have a reporting app ontop of that RDS instance. You create an RDS instance replica, because that will not slow down the RDS instance.

This case your RDS DB instance creates an ASYNC replication with the RDS replica and the reporting app is reading from there. Leaving the RDS unaffected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What are Read Replicas only for?

A

Reads

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

When does a network cost incur in AWS?

A

When data goes from one AZ to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Do you pay network cost for RDS when moving data from one AZ to another?

A

No, RDS is except as long as the AZ are in the same region.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is RDS Multi-AZ used for?

A

Disaster Recovery

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How does RDS Multi-AZ work?
You have the master DB which the app reads/writes. Then you also have another RDS DB instance Standby in a different AZ with a SYNC replication and one DNS name for automatic app failover
26
What does automatic app failover in RDS need to work?
SYNC replication and ONE (same) DNS name
27
Can Read Replicas be setup as Multi AZ for Disaster Recovery (RD)?
Yes
28
Multi AZ vs Read Replicas
Read replicas are to be used for different apps that need the same data Multi AZ is for disaster recovery by using a standby DB. If anything happens to master DB it switches over to the other one and it becomes a master. Its not accessible before the diaster
29
How to go from Single AZ to Multi AZ
It has zero downtime (no stopping DB) Click modify for database, it goes from RDS DB instance to a SYNC replication to the Standby DB
30
What happens when you go from Single AZ to Multi AZ setup? (technical)
RDS DB instance gets snapshotted, the DB snapshot is restored into the other AZ as a standby DB, and Sync Replication between the 2 happens.
31
What is RDS Custom?
It is a managed Oracle & Microsoft SQL Server Database with OS and DB customisation capabilities
32
What does RDS do?
Automates setup, operation, scaling of DB in AWS
33
What access does RDS Custom give you?
To underlying DB and OS
34
What can you configure with RDS Custom?
Config settings Install patches Enable native features Access underlying EC2 instance with SSH & SSM
35
What do you need to de-activate before using RDS Custom?
Automation Mode - take snapshot before
36
RDS vs RDS Custom?
RDS - Entire db and OS managed by AWS RDS Custom - full admin access to underlying OS & DB
37
What is Amazon Aurora?
Proprietary technology from AWS (Not open sourced)
38
What DB are supported with Amazon Aurora DB?
Postgres & MySQL
39
How does Aurora storage work?
Grows in increments of 10GB up to 128TB
40
How many Replicas can Aurora have?
15 and replication is faster
41
How many replicas can MySQL have
5
42
What is instantaneous with Aurora?
Failover. HA native
43
Which is more expensive? RDS or Aurora?
Aurora - 20% more
44
How many copies of Aurora can you have and across how many AZ?
6 copies across 3 AZ
45
How many copies of Aurora do you need to operate for writes?
4 out of 6
46
How many copies of Aurora do you need for read?
3 out of 6
47
What is Aurora's self healing with peer to peer replication?
If some data are corrupted it does peer to peer replication healing
48
How many master instances does Aurora have?
one Master instance
49
How does Aurora fail over work
It is automatic in less than 30 seconds
50
How many Read replicas can you have along with the Master instance?
1 master and up to 15 replicas
51
How does Aurora DB Cluster work?
You have the client, client is connected to Writer Endpoint which points to the master instance. The master instance writes to the shared volume (shared with read instances) and each read instance is connected to the Reader Endpoint which is doing the Connection Load Balancing. And that points to the client. All read instances are in auto scaling mode
52
Aurora Features
Automatic Fail-over Backup and Recovery Isolation and Security Industry compliance Push-button scaling Automated Patching w/ Zero Downtime Advanced Monitoring Routine Maintenance Backtrack: restore data at any point of time without using backups
53
How does Replica Autoscaling work?
You have a client that points to writer endpoint which is connected to Aurora Master DB. Master writes on shared storage volume which is shared with Replicas. If for example you have 2 replicas, and they are overloaded, auto scaling kicks in, and more replicas are created. This also extends the Reader Endpoint so the client can point to those Replicas too. All the replicas are now also reading from the shared storage.
54
How does Custom Endpoint work in Aurora DB?
If for example you have 2 db.r3 large and 2 db.r5.2xlarge replicas, you can create a custom endpoint and connect the larger replicas to that. Why? because they might be better for analytical queries rather than normal queries. Once you create a custom endpoint, the standard reader endpoint is not used, so you should create custom endpoints for all replicas.
55
What happens when you create a custom endpoint?
Reader endpoint is stopped being used
56
When would you create custom endpoints?
When you have larger more powerful replicas that can be used for something else, not just standard queries. It could be Analytical Queries for example.
57
What does Aurora Serverless provide??
Automated DB instantiation & auto scaling based on actual usage
58
What is Aurora Serverless good for?
Infrequent, intermittent or unpredictable workloads
59
Do you need to do any capacity planning for Aurora Serverless?
No
60
How do you pay with Aurora Serverless?
Per second (more cost effective)
61
Aurora Serverless Architecture
Client speaks to Proxy Fleet (managed by Aurora), which talks to many back end Aurora Instances that are created (shared volume) based on workload.
62
What does Aurora Multi-Master do?
Immediate failover for write nodes (HA)
63
What happens during Multi Master Aurora?
All nodes do Read/Write instead of just read
64
Aurora Multi-Master architecture
3 Aurora DB, all using shared volume. All 3 are replicating from each other, and the Client is connected to all 3 of them just incase one fails.
65
What does Global Aurora do?
Cross Region Read Replicas Global Database
66
What is Cross Region Read Replicas benefit for Global Aurora?
Useful of disaster recovery Simple to put in place
67
Aurora Global Database benefits
1. 1 primary region (read/write) 2. Up to 5 secondary (read only) regions, replication lag is less than 1 sec 3. Up to 16 read replicas per secondary region 4. helps for decreasing latency 5. promoting another region (for disaster recoverY) has an RTO of < 1 min 6. Typical cross-region replication takes less than 1 second
68
Global Aurora architecture/scenario
Region 1 has Amazon Aurora connected to apps and has read/write. Region 2 has Amazon Aurora, connected to apps, and read only. Both are connected by replication. When something happens to the master DB, the other one gets promoted and begins read/write
69
What is Aurora Machine Learning
Enables ML-based predictions to apps via SQL Simple, optimised, secure integration between Aurora and AWS ML services
70
What services does Aurora ML support?
Amazon SageMaker (use with any ML model) Amazon Comprehend (for sentiment analysis)
71
Aurora ML use cases?
fraud detection, ads targeting, sentiment analysis, product recommendations
72
RDS Backups options
Automated Backups Manual DB Snapshots
73
Features of Automated RDS Backups
Daily full backup of DB Transaction logs backed up every 5 min restore any point in time from oldest to 5 min ago 1-35 days retention, 0 to disable
74
What is the retention period of RDS Backups? (automated)
1-35
75
How do you disable automated RDS backups?
Set retention period to 0
76
Downside of Automated Backups RDS?
They expire
77
Manual DB Snapshots benefits
Manually triggered by the user Retention of backup is unlimited
78
How long is the retention period for Manual DB Snapshots?
as long as you want - unlimited
79
A stopped RDS DB you get charged for storage. What can you do to not pay?
Snapshot, stop it, and restore later.
80
How do Aurora Backups work?
Automated 1-35 days (cant disable) pint n time recovery in that timeframe Manual DB Snapshots manually triggered by user retention of backup for as long as you want
81
RDS & Aurora Restore Options
Restore backup or snapshot create new db Restore MySQL RDS db from S3 Restore MySQL Aurora cluster from S3
82
How does Restoring MySQL RDS DB from S3 work
create backup of on prem data store on amazon S3 restore backup file onto new RDS instance running MySQL
83
How does restoring MySQL Aurora cluster from S3 work
create backup of on prem data using Percona XtraBackup store backup on S3 Restore backup file on new aurora cluster running MySQL
84
What happens when you restore an RDS/Aurora back up or snapshot?
Creates a new DB
85
How does Aurora DB Cloning work?
Create a new Aurora DB cluster from an existing one
86
Benefits of Aurora DB Cloning
Faster than snapshot & restore Uses Copy-on-write protocol Fast and cost effective
87
How does Copy-On-Write protocol work in Aurora DB Cloning?
The new DB cluster uses the same data volume as the original DB (no copy needed) When updates are made to the new DB cluster data, additional storage is allocated and data is copied to be separated
88
When is Aurora DB Cloning useful?
When creating staging DB from a prod DB without impacting prod db
89
What does RDS & Aurora Security provide?
Encryption at rest/in flight IAM Auth Security Groups No SSH available except on RDS custom Send audit logs to CloudWatch for longer retention
90
How does Data At Rest encryption work for RDS & Aurora
DB master & replicas encryption using AWS KMS - defined at launch time If master is not encrypted - read replicas will also not be to encrypt an unencrypted DB you need to snapshot and restore as encrypted
91
How does In-Flight encryption work for RDS & Aurora?
TLS-ready by default use AWS TLS root cert client-side
92
What is an Amazon RDS Proxy?
Fully Managed DB proxy for RDS
93
Why do I need RDS Proxy?
To allow apps to pool and share DB connections established with the DB Instead of having all connections to RDS DB, they will connect to the proxy and the proxy will send them to the instance.
94
Why would you use an RDS Proxy?
To improve efficiency and reduce stress on DB resources. Also minimise open connections/timeouts
95
Is RDS Proxy serverless, autoscaling, HA (multi- AZ)?
Yes
96
What happens incase of fail over and RDS Proxy?
It reduces failover time by 66%. Connections just connect to that automatically
97
What DB does RDS Proxy support?
RDS (MySQL, PostgresSQL, MariaDB and Aurora (mySQL, PostgreSQL)
98
Can you enforce IAM Auth for DB and securely store credentials in AWS Secrets manager with RDS Proxy>
Yes
99
Is RDS Proxy publicly accessible?
No - must be from VPC
100
How can RDS Proxy benefit AWS Lambda?
It will soak all the connections (1000s) from Lambda and take care of open connections and timeouts. Then it will transfer them to the RDS DB Instance
101
What does Amazon ElastiCache do?
Helps you get managed Redis or Memcached
102
What are caches?
In memory DB with really high perf & low latency
103
What do caches help with?
reduce load of DB for read intensive workloads
104
What happens to applications that you ElastiCache?
They become stateless
105
Does AWS take care of OS maintenance / patching, optimisations, setup, configuration, monitoring, failure recovery and backups?
Yes
106
What does ElastiCache require you to do before using it?
Heavy app code changes
107
ElastiCache Architecture
Application performs cache hit on Elasti Cache, if the querry is written there then thats perfect. If its not, then a cache miss happens and the app reads directly from Amazon RDS. Then it writes the querry to ElastiCache for when it is requested again.
108
Redis features
Multi-AZ with Auto-Failover Read replicas to scale reads and HA Data Durability using AOF persistence Backup and restore features Supports Sets and Sorted Sets Cache that is replicated, HA and durable
109
Memcached features
Multi-node for partitioning of data (sharding) no HA non persistent no backup and restore multi-threaded architecture
110
What to remember for Redis
HA, backup, read replicas
111
What to remember for Memcached
Pure cache distributed can lose data no backup restore no HA
112
ElastiCache Security
Supports IAM Auth for Redis
113
What are policies on ElastiCache only used for?
AWS API-level security
114
What is Redis AUTH?
setting password/token for when you create a Redis cluster extra level of security for your cache (on top of sec groups) Supports SSL in flight encryption
115
Memcached supports for security?
SASL-based auth (advanced)
116
What are the patterns for loading data into ElastiCache?
Lazy Loading Write Through Session Store
117
What is Lazy Loading?
all read data is cached - data can become stale in cache
118
What is write through?
adds or update data in cache when written to a DB (no stale date)
119
What is session store?
store temp session data in cache (using Time To Live features)
120
What is ElastiCache Redis use cases?
Gaming leaderboards - computationally complex Redis Sorted sets - guarantee both uniqueness and element ordering Each time new element added, its ranked in real time, then added in correct order
121
What is Redis Sorted Sets?
Guarantees uniqueness and element ordering
122
Port 21
FTP
123
Port 22
SSH
124
Port 22 (same as ssh)
SFTP
125
Port 80
HTTP
126
Port 443
HTTPS
127
Port 5432
PostgreSQL
128
Port 3306
MySQL
129
Port 1521
Oracle RDS
130
Port 1433
MSSQL Server
131
Port 3306 (same as MySQL)
MariaDB
132
Port 5432
Aurora
133
What do you do when you plan for Disaster recovery with a MySQL database?
Enable Multi-AZ
134
Which RDS feature does not require you to change SQL connection string when used?
Multi-AZ
135
You would like to ensure you have a replica of your database available in another AWS Region if a disaster happens to your main AWS Region. Which database do you recommend to implement this easily?
Aurora Global Database
136
Your company has a production Node.js application that is using RDS MySQL 5.6 as its database. A new application programmed in Java will perform some heavy analytics workload to create a dashboard on a regular hourly basis. What is the most cost-effective solution you can implement to minimize disruption for the main application?
Create read replica in diff AZ and run analytics workload on replica db
137
You would like to create a disaster recovery strategy for your RDS PostgreSQL database so that in case of a regional outage the database can be quickly made available for both read and write workloads in another AWS Region. The DR database must be highly available. What do you recommend?
Create read replica in diff region and enable multi-az on the read replica
138
You have migrated the MySQL database from on-premises to RDS. You have a lot of applications and developers interacting with your database. Each developer has an IAM user in the company's AWS account. What is a suitable approach to give access to developers to the MySQL RDS DB instance instead of creating a DB user for each one?
Enable IAM DB Authentication
139
Read Replicas use Async Replication and Multi-AZ uses Sync replication?
True