Blog Amazon Web Services AWS ElasticCache – Fully managed, in-memory data store and cache in the...

AWS ElasticCache – Fully managed, in-memory data store and cache in the cloud

Are you preparing for AWS Certified Solutions Architect Professional certification exam? In this space, we are writing series of articles on topics which are covered in the Solutions Architect Professional certification exam. In this article, we are explaining one of the important service available with Amazon web services which is  AWS Elastic Cache. You would expect lot of questions from this topic for Solutions Architect Professional exam. You can subscribe to us for receiving the further updates on this topic.

AWS Elastic Cache

This topic addresses the Scalability and Elasticity domain as highlighted in the AWS Blueprint for the exam guide

AWS Certified Solutions Architect Professional BluePrint

What is Elastic Cache?

Elastic cache is a web service that allows one to retrieve data faster from fast, managed and in-built caches. Instead of relying on slower disk based databases. Since the read write operation on a disk is higher than that of an in-built cache, having a cache mechanism in place can severely improve the performance of an application.

Amazon does all the background work of managing in-built caches. So the infrastructure, the upgrades to the cache software is all done by AWS. You don’t need to worry about managing all of this and can focus on just your application.

Caches are normally used by real time applications such as gaming, social networking and media sharing.

  • AWS gives you a choice of 2 Cache Engine (Redis or memcached) – Some of the key differences between these solutions are given below
  • Memcached is multi-threaded whilst Redis is single threaded. So in Redis, it’s just one application that can work with one piece of data at a time.
  • There is no persistence when it comes to Memcached. So if you bring a node down, all of the data gets flushed.
  • Should as a flat string cache – So if you want to store plain string HTML files or serialize JSON data, this is a great fit.
  • Memcached is easy to scale horizontally, so you can nodes to supplement the load on the database on the fly.
  • Memcached is easier to maintain.

ElastiCache Cluster

Some of the advantages of Elastic Cache are given as shown below

  • Easy to deploy – Using the AWS console, the cache service is just so easy to deploy. With just a few steps, you can get your cache service up and running in no time.
  • Easy Scaling of Nodes – its super simple to add new nodes to an existing cluster in AWS. AWS provides you with easy options via the console to add nodes on the fly to an existing cluster.
  • Fault Tolerant – Through AWS Cloudwatch, the entire infrastructure for Elastic cache is monitored by AWS. AWS can automatically detect node failures and replace nodes on the fly
  • All clusters in Elastic cache are spread across multiple availability zones. This helps in ensuring that the cache is always available to end users or the application.
  • Replication groups for redisIn Redis, you have the option of creating clusters. By having clusters, you can ensure better fault tolerance for your application. By adding a read replica to your existing cluster, and adding it to another availability zone. By doing this, you can ensure availability if your primary server goes down for any reason.
  • Backups- A backup is a point-in-time copy of a Redis cluster. Backups can be used to restore an existing cluster or to seed a new cluster. Backups consist of all the data in a cluster plus some metadata. Backups are not supported by the Memcached engine
  • Endpoints – By having end points, it becomes very easy for any type of application to connect and work with the cache. Then end point consists of a domain name and a port number for the connection. Applications such as .Net, PHP or java can then use these end points in their applications to work with caches.

Creating an Elastic Cache Cluster

Let’s now look at the steps to creating an Elastic Cache

Step 1:Log into the AWS console and go to the database section and select ElastiCache

Goto Database and Select Elastic Cache

Step 2: Choosing the cache type – In the next screen you will be prompted to choose the elastic cache type. As noted in the features of elastic cache, AWS provides you will 2 types of caches. Let’s choose Memcache for the purpose of this exercise

Create Memcached Cluster

Step 3: Next you need to choose the Node type and number of nodes in your cache. This is important and depends on the number of requests that will be cached by your application. Here you also need to specify a name for your cache.

You can leave the default values for the Engine version compatibility and Parameter Group.

 

You need to make a note of the Port no, because this will be required when connecting to the cache from an application.

Memcached Settings

You can then click on Create located at the bottom of the screen.

Click on Create

Step 4: Once the cache is created, you will be able to see the details of the cache.

Creating an Elastic Cache Cluster- Redis

Let’s now look at the steps to creating an Elastic Cache – Redis

Step 1: Log into the AWS console and go to the database section and select ElastiCache

Goto Database and Select Elastic Cache

Step 2: Choosing the cache type – In the next screen you will be prompted to choose the elastic cache type. As noted in the features of elastic cache, AWS provides you will 2 types of caches. Let’s choose Redis for the purpose of this exercise

Create Redis Cluster

Step 3: Next you need to specify the parameters for the cache. The important part is the Node type and the number of replica’s. The cache node is important to ensuring that the right number of cache entries can be stored in the cache. And next is the number of replica’s which can used for scaling purposes.

Redis Settings

Once all the parameters have been entered, you can click on Create at the bottom of the screen.

Once done you will then be able to see your Redis cache

See your Redis Cache

Final Points to Remember about Elastic Cache

  • Memcached is multi-threaded whilst Redis is single threaded. So in Redis, it’s just one application that can work with one piece of data at a time.
  • There is no persistence when it comes to Memcached. So if you bring a node down, all of the data gets flushed.
  • Should as a flat string cache – So if you want to store plain string HTML files or serialize JSON data, this is a great fit.
  • Memcached is easy to scale horizontally, so you can nodes to supplement the load on the database on the fly.
  • Memcached is easier to maintain

Summary

In this article we have explained about AWS Elastic Cache. This is one of the most important service offered by Amazon Web Services (AWS) that will help the developerz . You would expect lot of questions from this topic in your certification exam. 

If you are preparing for the AWS certifications exam and looking for any help, please send us a mail or call to our customer support team.

About Mark Oswald

Mark is an experienced software engineer and technology blogger. He has over five years of experience in writing in different technological domains. Writing is his passion and he contributes regularly to the Whizlabs blog to share his knowledge.
Spread the love

LEAVE A REPLY

Please enter your comment!
Please enter your name here