RDS + Aurora + Elasticache Flashcards

1
Q

RDS

A

Relational Database Service

Managed DB Service that uses SQL as a query language

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

RDS Storage AUto Scaling

A

Detects when you run out of free database storage, scales automatically

You have to set Maximum Storage Threshold

Useful for applications with unpredictable workloads.

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

RDS Read Replicas

A

Application performs reads and writes to Database instance, which sends read data to application.

Up to 15 read replicas

within AZ, cross AZ or cross Region.

Replication is asynchronous so reads are eventually consistent.

Replicas can be promoted to their own DB

Application must update the connection string to leverage read replicas.

Use Case: you have production database taking on normal load, but you want to run a reporting application. you create read replica to run the new workload there.

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

RDS Read Replicas- Network Cost

A

RDS read replicas within same region, you don’t pay that replication fee.

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

RDS

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

Multi AZ

A

For disaster recovery

Does not require you to change the SQL connection string

Sync Replication

One DNS name- automatic app failover to standby

Increases availability

Failover in case of loss of AZ, loss of network, instance or storage failure.

Not used for scaling.

Read replicas can be setup as Multi AZ for disaster recovery.

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

RDS from single-az to multi-az

A

zero downtime operation ( no need to stop DB)

just click on “modify” for the database and enable multi-AZ.

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

Amazon Aurora

A

Aurora is a proprietary technology from AWS (not opened source)

POstgres and MySql are both supported Aurora DB ( that means your drivers will work as if Aurora was a Postgres or MySql Database)

Aurora is “AWS cloud optimized” and claims 5x performance improvement over MySql on RDS, over 3x performance of Postgres on RDS

Aurora storage automatically grows in increments of 10GB up to 128 TB

Aurora can have up to 15 read replicas and the replication process is faster than MySQL

Failover in Aurora in instantaneous.

Auora costs more than RDS (20% more) but is more efficient.

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

Aurora High Availability and Read Scaling

A

6 copies of your data across 3 AZs

Shared Storage Volume: replication + self healing + auto expanding

It’s like multi-AZ for RDS. one instance takes writes (master)

automated failover for master in less than 30 seconds

Master + up to 15 aurora read replicas serve reads

Supports cross region replication

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

Aurora DB Cluster

A

Client talks to writer endpoint and redirected to right instance.

Then there is multiple read replicas. there is autoscaling. storage volume auto expands.

reader endpoint helps with connection load balancing and connects with all the multiple read replicas.

Load balancing happens at connection level not statement level.

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

Writer Endpoint

A

Cluster endpoint (or writer endpoint) for a DB cluster connects to the current primary DB instance for that DB cluster. Cluster endpoint is the only one that can perform write operations such as DDL statements as well as read operations.

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

Reader Endpoint

A

A reader endpoint for an Aurora DB cluster provides connection-balancing support for read-only connections to the DB cluster. Use the reader endpoint for read operations, such as queries. By processing those statements on the read-only Aurora Replicas, this endpoint reduces the overhead on the primary instance.

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

Custom Endpoints

A

A custom endpoint for an Aurora cluster represents a set of DB instances that you choose. When you connect to the endpoint, Aurora performs connection balancing and chooses one of the instances in the group to handle the connection. You define which instances this endpoint refers to, and you decide what purpose the endpoint serves.

use case: aurora instances with higher computing power, so you would want to query them for higher workloads.

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

Aurora Serverless

A

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

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

Global Aurora

A

Aurora Cross region read replicas

aurora global database (recommended): 1 primary region for (Read/write). up to 5 secondary (read only) regions, replication lag is less than 1 second. up to 16 read replicas per secondary region.

Typical cross-region replication takes less than 1 second.

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? use Aurora Global Database

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

Aurora Machine Learning

A

Enable you to add Machine learning based predictions to your applications via SQL

Supported services: sage maker and Amazon Comprehend.

Use cases: fraud detection, ads targeting, sentiment analysis, product recommendations.

17
Q

RDS Backups

A

Automated Backups:

  1. Daily full backup of the database (during the backup window)
  2. Transaction logs are backed up by RDS every 5 minutes. ability to restore to any point in time from oldest backup to 5 minutes ago
  3. 1 to 35 days of retention, set 0 to disable automated backups.

Manual DB Snapshots:

  1. Manually triggered by the user.
  2. retention of backup for 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 and restore instead.

18
Q

Aurora Backups

A

Automated backups:

  1. 1 to 35 days (cannot be disabled)
  2. Point-in-time recovery in that timeframe.

Manual DB Snapshots
1. manually triggered by the user.
2. retention of backup for as long as you want. good for long-term backups for disaster recovery and audit purposes.

19
Q

RDS and Aurora Restore Options

A
  1. Restoring a RDS/Aurora backup or a snpashot creates a new database.
  2. restoring Mysql rds database from S3.
  3. restoring my SQL aurora cluster from S3.
20
Q

Aurora Database Cloning

A

create a new aurora DB cluster from an existing one.

use case: Your development team would like to perform a suite of read and write tests against your production Aurora database because they need access to production data as soon as possible.

21
Q

RDS & Aurora Security

A
  1. At rest encryption: database master & replicas encryption using AWS KMS- must be defined at launch time.

If master is not encrypted the read replicas cannot be encrypted.

to encrypt an un-encrypted database, go through a DB snapshot and restore as encrypted.

  1. IN-Flight encrpytion: TLS-ready by default, use the AWS TLS root certificate client-side.
  2. IAM Authentication: IAM roles to connect to your database (instead of username/pw)

4.Security Groups: control network access to yoru RDS/ Aurora DB.

  1. No SSH available except on RDS Custom

5.Audit Logs can be enabled and sent to CloudWatch Logs for longer retention.

22
Q

RDS Proxy

A

Allows apps to pool and share DB connections established with the database. *instead of every application connecting to DB instance, it connects to DB proxy and pools the connections together into less connections into RDS instance.

Makes a lot of sense if you have a lot of connections into your database instance.

Improves database efficiency by reducing the stress on database resources (e.g CPU, RAM) and minimizes connections.

serverless, autoscaling, highly available (multi-AZ)

Reduced RDS and Aurora failover time by 66%.

No code changes required for most apps. instead of connecting to RDS instance or Aurora Database, you connect to proxy and are done.

Enforce IAM authentication for DB, and securely store credentials in AWS Secrets Manager.

RDS Proxy is never publicly accessible (must be accessed from VPC)

23
Q

Elasticache

A

The Same way RDS is to get managed relational dabases, elasticache is to get managed Redis or Memcached.

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, by putting state of application into Elasticache.

AWS takes care of OS maintenance/patching, optimizations, set up, configuration, monitoring, failure recovery and backups.

Using ElastiCache involved heavy application code changes.

24
Q

ElastiCache Solution Architecture

A

Application queries ElastiCache to see if the query has already been made. if it has been made and is stored in ElastiCache it’s called a cache hit and get answers right from ElastiCache and saves trip to RDS to do the query.

If it is not stored in cache (cache miss) reads from DB and then for other applications or instances when query is made, we can write the data back into the cache, so next query results in cache hit.

25
Q

REDIS Vs memcached

A
  1. REDIS- cache that gets replicated that is highly available and durable.

multi AZ with Auto-Failure

Read Replicas to scale reads and have high availability

Data Durability using AOF persistence

Backup and restore features

supports sets and sorted sets.

  1. MemCached- pure cache distribution where you can afford to lose data.

multi-node for partioning of data (sharding)

no high Avaialbility (replication

non persistent

26
Q

Elasticache Security

A

ElastiCache supports IAM Authentication for REDIS

IAM Policies on elasticache are only used for AWS API-level security

Redis Auth- set password/token when you create redis clusture. it is an extra level of security for your cache. supports SSL in flight encryption.

memcached: supports SASL-based authentication (Advanced)

27
Q

Patterns for ElastiCache

A

Lazy loading: all the read data is cached, data can become stale in cache.

Write Through: adds or update data in the cache when written to a DB (no stale data)

Session Store: store temporary session data in a cache (using TTL features)

28
Q

REDIS Use Case

A

Gaming leaderboards are computationally complex.

Redis Sorted sets guarantee both uniqueness and element ordering.

each time a new element added, it’s ranked in real time, then added in correct order.

29
Q

RDS Supports Which databases

A

My SQL, MariaDB, PostgreSQL, Oracle, Aurora, Microsoft SQL Server.

not MongoDB

30
Q

ElastiCache Use Case

A

Storing session data in ElastiCache is a common pattern to ensuring different EC@ instances can retrieve your user’s state if needed.

application is running on a fleet of EC@ instances managed by an ASG behind an ALB. users have to constantly log ack in and you don’t want to enable sticky sessions because it will overload some EC2 instances. store the session data in elasticache.

31
Q

Read Replica Use Case

A

An analytics application is currently performing its queries against your main production RDS database. These queries run at any time of the day and slow down the RDS database which impacts your users’ experience. What should you do to improve the users’ experience? set up a read replica.

32
Q

Replication Types

A

Read Replica- Asynchronous replication

multi-AZ- synchronous replication.

33
Q

How do you encrypt an unencrypted RDS DB instance?

A

create a snapshot of the unencrypted RDS DB instance, copy the snapshot and tick “enable encryption”, then restore the RDS DB instance from the encrypted snapshot.

34
Q

Which RDS database technology does NOT support IAM Database Authentication?

A

Oracle.

PostgreSql and SQL are supported.

35
Q

You have an un-encrypted RDS DB instance and you want to create Read Replicas. Can you configure the RDS Read Replicas to be encrypted?

A

no. You can not create encrypted Read Replicas from an unencrypted RDS DB instance.