ElastiCache Flashcards
When do you use elasticache?
- to reduce load on databases
- to make application stateless
Why do application need code changes when using cache?
Applications need to have a mechanism to query chache first and write to cache in case of a cache miss
What is elasticache?
a very fast in-memory store
What is he difference between redis and memcached?
- redis replicates data across instances
- memcached shards data across instances
- better use redis due to backup and high availability features
How to secure elasticache?
- elasticache does not support iam authentication
- for redis you can ser a password/token
- you can use security groups
what are common patterns for elasticache?
- Lazy Loading
- Write Through
- Session Store
How does lazy loading work and what is its disadvantage?
Application always reads cache first. If cache hits, use cache data. If cache miss read from database and write data to cache.
Data can become outdated in the cache as it is never updated.
How does the write through pattern for elasticache work?
Data is updated in the cache when written to the db.
How does the session store pattern for elasticache work?
Temporary session data is stored in the cache (using time to live).