Elasticache
Elasticache Introduction
Elasticache is a web service that makes it easy to deploy, operate, and scale an in-memory cache in the cloud. The service improves the performance of web applications by allowing you to retrieve information from fast, managed, in-memory caches, instead of relying entirely on slower disk-based databases.
Amazon Elasticache can be used to significcantly improve latency and throughput for amny read-heavy application workloads (such as social networking, gaming, media sharing, and Q&A portals) or compute intensive workloads (such as a recommendation engine).
Caching improves application performance by storing critical pieces of data in memory for low latency access. Cached information my include the results of I/O-intensive database queries or the results of computationally-intensive calculations.
Types of Elasticache
Memcached
Memcached is a widely-adopted memory object caching system. Elasticache is protocol compliant with memcached, so popular tools that you use today with existing memcached environments will work seamlessly with the service.
Because Memcached is designed as a pure caching solution with no persistence, Elasticache manages Memcached nodes as a pool that can grow and shrink, similar to an EC2 Auto Scaling Group. Individual nodes are expendable, and Elasticache provides additional capabilities here, such as automatic node replacement and Auto Discovery.
Memcached Use Cases
- Is object caching your primary goal, for example to offload your database? If so, use Memcached.
- Are you interested in as simple a caching model as possible? If so, use Memcached.
- Are you planning on running large cache nodes and require multithreaded performance with utilization of multiple cores? If so, use Memcached.
- Do you want the ability to scale your cache horizontally as you grow? If so, use Memcached.
Redis
Redis is a popular open-source in-memory key-value store that supports data structures such as sorted sets and lists. Elasticache supports master/slave replication and Multi-AZ, which can be used to achieve cross AZ redundancy.
Although both Memcached and Redis appear similar on the surface (in that they are both in-memory key stores), they are actually quite different in practice. because of the replication and persistence features of redis, Elasticache manages Redis more as a relational database. Redis Elasticache clusters are managed as stateful entities that includ efailover, similar to how RDS manages database failover.
Redis Use Cases
- Are you looking for more advanced data types, such as lists, hashes, and sets? If so, use Redis.
- Does sorting and ranking datasets in memory help you, such as with leaderboards? If so, use Redis.
- Is persistence of your key store important? If, so, use Redis.
- Do you want o run multiple AWS AZs (Multi-AZ) with failover? If so, use Redis.