Adding caching to a database system
In this hands-on lab, we are going to provision a Redis database to act as a cache for an existing RDS instance. We will create a Redis cluster and configure it to act as our cache, and then we will create and run some simple code on an EC2 instance that will connect to it to demonstrate the caching.
If you do not have an existing VPC and RDS MySQL database provisioned, then please create those first, following the guides from earlier chapters if required. The MySQL database should contain the Sakila
sample tables.
Firstly, we are going to create our Redis cluster:
- Log in to the AWS Management Console as an admin user.
- Navigate to ElastiCache from the main menu.
- From the ElastiCache dashboard, select Get Started Now. If this page does not appear, you can select Redis from the left-hand menu and then click Create:
- Complete the form with the following options...