> For the complete documentation index, see [llms.txt](https://dev7days.gitbook.io/dev7days/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev7days.gitbook.io/dev7days/aws/elastic-cache.md).

# Elastic Cache

Elastic Cache is to get managed `Redis` or `Memcached`. It help to reduce load off DB for read intensive workloads.

There are 2 kind of cache:

1. Redis
2. Memcached

#### Redis vs Memcached

<table><thead><tr><th>Redis</th><th width="249">Memcached</th></tr></thead><tbody><tr><td>Support MultiAZ</td><td>Multi Node (sharding)</td></tr><tr><td>Has read replicas to scale read and high avaialability</td><td>No replication</td></tr><tr><td>Backup and restore features</td><td>No backup and restore features</td></tr></tbody></table>

{% hint style="info" %}
Tips: In examination the keyword `Sets and SortedSet` = Redis ElasticCache
{% endhint %}

#### Security

It support `IAM Authentication` . For Redis it support SSL and Memcached it support SASL based authentication.

#### Usecase

* Lazy loading (read data from cache before DB)
* Write through (Add or update data in the cache when written to a DB)
* Session store
* Gaming Leaderboards (Redis sorted sets guarantee both uniqueness and element ordering)
