ElastiCache Flashcards

1
Q

purpose

A

to get managed cache (Redis or Memcached)

it’s basically RDS for caches

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

Caches

A

in-memory databases with really high performance and low latency, run on RAM

we cache data to reduce load off databases so that the read-intensive workloads read from cache instead of rreading from the database

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

AWS takes care of

A
  1. OS maintenance and patching
  2. optimizations
  3. setup
  4. configuration
  5. monitoring
  6. failure recovery and backups
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Scaling

A

there is Read Scaling, Write Scaling and Multi-AZ

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

how do ElastiCache and RDS work together

A

Applications query EC, if not available - cache miss - get from RDS and store in EC

otherwise - cache hit - get data from EC, the retrieval is super fast

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

invalidation strategy

A

must be handled by the application itself - the strategy to keep only the most relevant and current data in cache

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

user session store

A

for the scenario when user logs into any of the apllication instances for ex. in an auto scaling group

and his session data should be stored so that when he connects to another instance next time - the data is already avaialble

To accomplish this, the app writes session data into ElastiCache. So when the user hits another instance of the application, it can retrieve his data from the cache

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

Redis features

A
  1. Multi AZ with Auto-Failover
  2. Read Replicas to scale reads and for High Availability (there is a primary instance and replicas)
  3. Data Durability with AOF persistance
  4. You can backup and restore Redis clusters

can be used as database

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

Redis Durability with AOF persistance

A

even if your cache is stopped and restarted, you can still have your data

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

Memcached

A
  1. uses sharding for partitioning of data
  2. non-persistent cache - if a node goes down, the data is lost
  3. no backup and restore
  4. multi-threaded architecture

pure cache

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

Memcached sharding

A

part of the cache is on one shard, another - on a different shard, each shard is a node

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

Security for all caches in ElastiCache

A
  1. support SSL in-flight encryption
  2. do not support IAM authentication
  3. IAM policies on ElastiCache are only used for AWS API-level security - creating a cluster, deleting…
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Redis Security

A

Redis AUTH, by default disabled, so anyone can connect to Redis cluster, so it is important to use security groups as extra level of security for your cache. For ex., we configure that Redis security group allows requests from security groups around our EC2 instances

you can set a password or token when you set up a cluster. Only clients (EC2 instances) in posession of this token or pwd will be able to access

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

Memcached Security

A

SASL-based authentication

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

patterns for ElastiCache

A
  1. Lazy Loading
  2. Write Through
  3. Session Store
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

patterns for ElastiCache: Lazy Loading

A

all the read data is cached, data can become stale in cache

17
Q

patterns for ElastiCache: Write Through

A

adds or updates data in cache when written to DB –> no stale data

18
Q

patterns for ElastiCache: Session Store

A

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