Amazon ElastiCache is a web service that makes it easy to deploy, operate, and scale an in-memory data store or cache in the cloud. The service improves the performance of web applications by allowing you to retrieve information from fast, managed, in-memory data stores, instead of relying entirely on slower disk-based databases. The primary purpose of an in-memory key-value store is to provide ultra-fast and inexpensive access to copies of data. Most databases are seldom updated but read and queried very frequently. This article, Amazon AWS ElastiCache Exam Tips gives you a breakdown of the core concepts and key tips on what you need to know for the AWS Certification Exams.
Querying a database will always be slower and more expensive than locating it in a key-value pair cache. Some database queries are especially expensive to perform, for example, queries that involve joins across multiple tables or queries with intensive calculations. You can use caching of query results, which means you pay the price of the query once and then can quickly retrieve the data multiple times without having to re-execute the query.
Two in-memory engines
- Redis – open source in-memory data store and cache. Redis is suitable for demanding applications and used for high-performance use cases like mobile apps and gaming. Use Redis when you need Sorted Lists and Counters & Hashes. With Redis, you can store in-memory data onto disks and thus create snapshots to enable point in time recovery as well as replication.
- Memcached – memory object caching system, used when you have simple data type model and you need to run large nodes with multiple cores or threads. Memcached stores data as a key/value pair. Memcached clusters can be partitioned into shards to further enhance performance.
Data Access Patterns
You must always evaluate what kind of data is suitable to store in the cache. Storing flat files in the cache will always be faster than retrieving them from database queries. For example, you can store information on books that you sell on an e-commerce book store and this information will not change frequently. It would not be ideal to store data that changes very frequently. This is a key point to remember when designing solutions for ElastiCache.
Nodes and Clusters
ElastiCache deployments are deployed as clusters and nodes. Memcached clusters can comprise of up to 20 nodes whereas, with Redis, you have a single node in a cluster which are grouped into Redis Replication Group. It is strongly recommended that for Memcached clusters, you have many small nodes of smaller capacity. This will help decrease the impact of node failures.
Memcached Auto Discovery
With the Memcached engine, the auto discovery feature ensures that applications can easily discover the various nodes available in a cache cluster and this establish and maintain connections to the nodes.
Scaling
Both horizontal and vertical scaling options are available with Amazon Elasticache.
- Horizontal Scaling
- With Memcached, you can partition your data and scale up to 20 nodes in a cluster. Using Auto Discovery, your application will find all the nodes available.
- With Redis, you are limited to one cluster, but you can create additional clusters which can be placed in a replication group. You can only have on write node, but up to 5 read replica nodes to handle read operations.
- Vertical Scaling
- You are not able to resize a cluster on the fly. However, you can launch new clusters with the required node types and direct traffic to it.
- Memcached clusters will start empty and start to store newly cached data
- Redis clusters can be launched from a backup
Replication and Multi-AZ
Redis engines work as single clusters that can be deployed in a replication group. You can have one primary cluster and up to 5 read replica clusters. You can configure your applications to offload read queries to the replicas and thus improve efficiency. In addition, with Multi-AZ replication groups, you get automatic failover from the primary node. Multi-AZ promotes a read replica to primary in the event of a failover, and a new node will be provisioned. DNS will then be updated to point to the new primary.
- Key Note – Replication is always asynchronous and so this might create a small delay before data is available on all clusters.
Backup and Recovery
Redis clusters can be backed up to disk by creating snapshots which are then stored on Amazon S3. You can create automatics backup schedules or manual ones. Manual snapshots are stored until you delete them. Snapshots can be used to create a new cluster. Note that there is no backup option for Memcached clusters.
Security
There are two types of access levels for ElastiCache Engines
- Access to configure and manage the ElastiCache clusters is provided with IAM, with the use of policies.
- Access to the ElastiCache endpoints for caching and reading data is managed as follows
- Inbound traffic to ElastiCache clusters can be controlled via Security Groups
- Clusters can be created in a VPC and thus have internal IP Addressing only. As such, the nodes cannot be accessed from the Internet or from instances outside of the VPC
- Network Access Control Lists can further restrict traffic to the clusters on a subnet level.
AWS Certification – 540 Practice Exam Questions – Get Prepared for your Exam Day!
Our AWS Exam Simulator with 540 practice exam questions comes with comprehensive explanations that will help you prepare for one of the most sought-after IT Certifications of the year. Register Today and start preparing for your AWS Certification.