RDS & ElastiCache Flashcards

1
Q

What are RDS read replicas and its features?

A

Read replicas are useful when the application has a really read-intense workload.
* It can be within AZ, cross AZ or cross region (fee)
* writing is taken only on the master node and the replication to the read replicas is ASYNC, so the reads can be eventually inconsistent
* you must update the application connection string to leverage read replicas
* up to 15 read replicas

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

testing prompt

What is RDS multi AZ and its features?

testing clarifier

testing footnote

A
  • a standby instance is created with automatic failover
  • SYNC replication. The changes made on the master instances are immediately replicated to the standby instance
  • only one DNS name - no need to change the application to failover to the standby instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When you should and should not use RDS multi AZ?

A

Multi AZ should not be used when you want to scale your application, since the standby instance is only for failover
Multi AZ should be used to increase availability, because of the failover to the standby instance

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

How can you go from single AZ to multi AZ with no downtime?

A

It is possible to select the option multi AZ on the interface. Behind the scenes, a snapshot of the master database will be taken, restored to a new (standby instance) and the synchronization will be enabled between them.

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

What are the differences of using Aurora vs other databases?

A
  • Aurora is cloud optimized, the performance is better than other databases. However, it is more expensive
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why Aurora is claimed to be high available and scales very well?

A
  • Aurora stores 6 copies of your data across 3 AZs
  • Master aurora instance handles writes and up to 15 read replicas handles reads
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are security features you can enable on RDS?

A

At-rest encryption:
* master and replicas encrypted using AWS KMS - must be enabled at launch time
* if the master is not encrypted, replicas can not be

In-flight encryption:
* use AWS TLS certificates client-side

create IAM roles instead of username/PW
create security groups
no SSH available

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

Why you should use RDS proxy?

A

RDS proxy is useful when you need to pool and share DB connections. It also reduces stress on the database by minimizing open connections

Only accessed within the VPC. Common use case: Lambda functions accessing the database can open many connections. By using RDS proxy, it is reduced.

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

Why you should use ElastiCache?

A

ElastiCache are in-memory databases with really high performance and low latency, useful to alleviate database reads for read intensive workloads

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

What are some common ElastiCache use cases?

A
  • DB cache: query from elasticache. If not available, get from RDS and store on elasticache
  • user session store: store the session data into elasticache. If the user hits another instance of the app, it will be logged
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When you should and not use elasticache?

A

Should use:
* data changing slowly (no need to update data inside the cache)
* few keys are frequently needed

Should not use:
* data changing rapidly, all large key space frequently needed

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

What is the lazy loading / cache aside strategy?

A

Look for the data on cache. If not available, get from RDS and save it on elasticache, so on the next time it is needed, will be on cache.

Pros:
* only requested data is cached
* node failures are not fatal

Cons:
* cache miss results in 3 round trips
* data can be updated in the database and outdated in the cache

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

What is the write through strategy?

A

Add or update the cache when the database is updated.

Pros:
* Cache data will never be outdated
* writes will cost more, since it will update the database and the cache

Cons:
* missing data until it is added/updated in the DB - use lazy loading
* cache churn - a lot of data in the cache will never be read

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

What is cache eviction and how it can occur?

A

Cache eviction is when some data on the cache is deleted.
It can occur when:
* the item is deleted explicitly
* memory is full and not recently used
* you set a TTL

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