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
Q

How does RDS Multi-AZ work?

A

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

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

What does automatic app failover in RDS need to work?

A

SYNC replication and ONE (same) DNS name

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

Can Read Replicas be setup as Multi AZ for Disaster Recovery (RD)?

A

Yes

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

Multi AZ vs Read Replicas

A

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

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

How to go from Single AZ to Multi AZ

A

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

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

What happens when you go from Single AZ to Multi AZ setup? (technical)

A

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.

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

What is RDS Custom?

A

It is a managed Oracle & Microsoft SQL Server Database with OS and DB customisation capabilities

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

What does RDS do?

A

Automates setup, operation, scaling of DB in AWS

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

What access does RDS Custom give you?

A

To underlying DB and OS

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

What can you configure with RDS Custom?

A

Config settings
Install patches
Enable native features
Access underlying EC2 instance with SSH & SSM

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

What do you need to de-activate before using RDS Custom?

A

Automation Mode - take snapshot before

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

RDS vs RDS Custom?

A

RDS - Entire db and OS managed by AWS
RDS Custom - full admin access to underlying OS & DB

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

What is Amazon Aurora?

A

Proprietary technology from AWS (Not open sourced)

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

What DB are supported with Amazon Aurora DB?

A

Postgres & MySQL

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

How does Aurora storage work?

A

Grows in increments of 10GB up to 128TB

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

How many Replicas can Aurora have?

A

15 and replication is faster

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

How many replicas can MySQL have

A

5

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

What is instantaneous with Aurora?

A

Failover. HA native

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

Which is more expensive? RDS or Aurora?

A

Aurora - 20% more

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

How many copies of Aurora can you have and across how many AZ?

A

6 copies across 3 AZ

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

How many copies of Aurora do you need to operate for writes?

A

4 out of 6

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

How many copies of Aurora do you need for read?

A

3 out of 6

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

What is Aurora’s self healing with peer to peer replication?

A

If some data are corrupted it does peer to peer replication healing

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

How many master instances does Aurora have?

A

one Master instance

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

How does Aurora fail over work

A

It is automatic in less than 30 seconds

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

How many Read replicas can you have along with the Master instance?

A

1 master and up to 15 replicas

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

How does Aurora DB Cluster work?

A

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

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

Aurora Features

A

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

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

How does Replica Autoscaling work?

A

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.

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

How does Custom Endpoint work in Aurora DB?

A

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.

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

What happens when you create a custom endpoint?

A

Reader endpoint is stopped being used

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

When would you create custom endpoints?

A

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
Q

What does Aurora Serverless provide??

A

Automated DB instantiation & auto scaling based on actual usage

58
Q

What is Aurora Serverless good for?

A

Infrequent, intermittent or unpredictable workloads

59
Q

Do you need to do any capacity planning for Aurora Serverless?

A

No

60
Q

How do you pay with Aurora Serverless?

A

Per second (more cost effective)

61
Q

Aurora Serverless Architecture

A

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
Q

What does Aurora Multi-Master do?

A

Immediate failover for write nodes (HA)

63
Q

What happens during Multi Master Aurora?

A

All nodes do Read/Write instead of just read

64
Q

Aurora Multi-Master architecture

A

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
Q

What does Global Aurora do?

A

Cross Region Read Replicas
Global Database

66
Q

What is Cross Region Read Replicas benefit for Global Aurora?

A

Useful of disaster recovery
Simple to put in place

67
Q

Aurora Global Database benefits

A
  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
Q

Global Aurora architecture/scenario

A

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
Q

What is Aurora Machine Learning

A

Enables ML-based predictions to apps via SQL

Simple, optimised, secure integration between Aurora and AWS ML services

70
Q

What services does Aurora ML support?

A

Amazon SageMaker (use with any ML model)
Amazon Comprehend (for sentiment analysis)

71
Q

Aurora ML use cases?

A

fraud detection, ads targeting, sentiment analysis, product recommendations

72
Q

RDS Backups options

A

Automated Backups
Manual DB Snapshots

73
Q

Features of Automated RDS Backups

A

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
Q

What is the retention period of RDS Backups? (automated)

A

1-35

75
Q

How do you disable automated RDS backups?

A

Set retention period to 0

76
Q

Downside of Automated Backups RDS?

A

They expire

77
Q

Manual DB Snapshots benefits

A

Manually triggered by the user
Retention of backup is unlimited

78
Q

How long is the retention period for Manual DB Snapshots?

A

as long as you want - unlimited

79
Q

A stopped RDS DB you get charged for storage. What can you do to not pay?

A

Snapshot, stop it, and restore later.

80
Q

How do Aurora Backups work?

A

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
Q

RDS & Aurora Restore Options

A

Restore backup or snapshot create new db

Restore MySQL RDS db from S3

Restore MySQL Aurora cluster from S3

82
Q

How does Restoring MySQL RDS DB from S3 work

A

create backup of on prem data

store on amazon S3

restore backup file onto new RDS instance running MySQL

83
Q

How does restoring MySQL Aurora cluster from S3 work

A

create backup of on prem data using Percona XtraBackup

store backup on S3

Restore backup file on new aurora cluster running MySQL

84
Q

What happens when you restore an RDS/Aurora back up or snapshot?

A

Creates a new DB

85
Q

How does Aurora DB Cloning work?

A

Create a new Aurora DB cluster from an existing one

86
Q

Benefits of Aurora DB Cloning

A

Faster than snapshot & restore
Uses Copy-on-write protocol

Fast and cost effective

87
Q

How does Copy-On-Write protocol work in Aurora DB Cloning?

A

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
Q

When is Aurora DB Cloning useful?

A

When creating staging DB from a prod DB without impacting prod db

89
Q

What does RDS & Aurora Security provide?

A

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
Q

How does Data At Rest encryption work for RDS & Aurora

A

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
Q

How does In-Flight encryption work for RDS & Aurora?

A

TLS-ready by default

use AWS TLS root cert client-side

92
Q

What is an Amazon RDS Proxy?

A

Fully Managed DB proxy for RDS

93
Q

Why do I need RDS Proxy?

A

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
Q

Why would you use an RDS Proxy?

A

To improve efficiency and reduce stress on DB resources. Also minimise open connections/timeouts

95
Q

Is RDS Proxy serverless, autoscaling, HA (multi- AZ)?

A

Yes

96
Q

What happens incase of fail over and RDS Proxy?

A

It reduces failover time by 66%. Connections just connect to that automatically

97
Q

What DB does RDS Proxy support?

A

RDS (MySQL, PostgresSQL, MariaDB and Aurora (mySQL, PostgreSQL)

98
Q

Can you enforce IAM Auth for DB and securely store credentials in AWS Secrets manager with RDS Proxy>

A

Yes

99
Q

Is RDS Proxy publicly accessible?

A

No - must be from VPC

100
Q

How can RDS Proxy benefit AWS Lambda?

A

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
Q

What does Amazon ElastiCache do?

A

Helps you get managed Redis or Memcached

102
Q

What are caches?

A

In memory DB with really high perf & low latency

103
Q

What do caches help with?

A

reduce load of DB for read intensive workloads

104
Q

What happens to applications that you ElastiCache?

A

They become stateless

105
Q

Does AWS take care of OS maintenance / patching, optimisations, setup, configuration, monitoring, failure recovery and backups?

A

Yes

106
Q

What does ElastiCache require you to do before using it?

A

Heavy app code changes

107
Q

ElastiCache Architecture

A

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
Q

Redis features

A

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
Q

Memcached features

A

Multi-node for partitioning of data (sharding)
no HA
non persistent
no backup and restore
multi-threaded architecture

110
Q

What to remember for Redis

A

HA, backup, read replicas

111
Q

What to remember for Memcached

A

Pure cache distributed
can lose data
no backup restore
no HA

112
Q

ElastiCache Security

A

Supports IAM Auth for Redis

113
Q

What are policies on ElastiCache only used for?

A

AWS API-level security

114
Q

What is Redis AUTH?

A

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
Q

Memcached supports for security?

A

SASL-based auth (advanced)

116
Q

What are the patterns for loading data into ElastiCache?

A

Lazy Loading
Write Through
Session Store

117
Q

What is Lazy Loading?

A

all read data is cached - data can become stale in cache

118
Q

What is write through?

A

adds or update data in cache when written to a DB (no stale date)

119
Q

What is session store?

A

store temp session data in cache (using Time To Live features)

120
Q

What is ElastiCache Redis use cases?

A

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
Q

What is Redis Sorted Sets?

A

Guarantees uniqueness and element ordering

122
Q

Port 21

A

FTP

123
Q

Port 22

A

SSH

124
Q

Port 22 (same as ssh)

A

SFTP

125
Q

Port 80

A

HTTP

126
Q

Port 443

A

HTTPS

127
Q

Port 5432

A

PostgreSQL

128
Q

Port 3306

A

MySQL

129
Q

Port 1521

A

Oracle RDS

130
Q

Port 1433

A

MSSQL Server

131
Q

Port 3306 (same as MySQL)

A

MariaDB

132
Q

Port 5432

A

Aurora

133
Q

What do you do when you plan for Disaster recovery with a MySQL database?

A

Enable Multi-AZ

134
Q

Which RDS feature does not require you to change SQL connection string when used?

A

Multi-AZ

135
Q

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?

A

Aurora Global Database

136
Q

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?

A

Create read replica in diff AZ and run analytics workload on replica db

137
Q

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?

A

Create read replica in diff region and enable multi-az on the read replica

138
Q

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?

A

Enable IAM DB Authentication

139
Q

Read Replicas use Async Replication and Multi-AZ uses Sync replication?

A

True