So let's talk about some
additional information you need to know,
going into the exam for
the Solutions Architects with ElastiCache.
First of all, all the caches in ElastiCache
do not support IAM authentication.
The IAM policies, you will define on ElastiCache
are only used for AWS API-level security.
That means creating a cache,
deleting the cache,
that kind of stuff.
But any operations within the cache is not using IAM.
Now, if you want to authenticate your Redis,
you can use Redis AUTH,
and you can set a password/token
when you create a Redis cluster.
And this allows you to have a password
when going into your cache.
This is an extra level of security
on top of security groups,
that you can use for your cache.
And you can support SSL,
SSL security, for in flight encryption.
Whereas, for Memcached,
it supports SASL-based authentication,
which is quite advanced.
Sort of different kind of authentication mechanism.
So if you look at the security of your cache,
an EC2 instance will have it's own security group,
which can access Redis
for their own security group as well.
So you can do security group level security
using ElastiCache.
And then for encryption in flight,
you have SSL encryption.
And for authentication,
you can have Redis AUTH
if you're using the Redis kind of cache
in ElastiCache.
Now there are three kinds of patterns
for loading data into ElastiCache.
The number one is Lazy Loading,
where all the read data is cached
and data can become stale in the cache.
Write Through, which is to add or update data
in the cache whenever it is written
to the database where there is no stale data.
And using ElastiCache as a Session Store
that we saw before,
and then we can expire a session
using the Time To Live features.
Now, caching is very hard
and there's this very famous quote
in computer science,
That there are only two hard things in Computer Science:
cache invalidation, and naming things.
So caching is a very complicated topic
and I gave you a very high level overview,
but let's illustrate the Lazy Loading strategy here.
So your application, if it has a cache hit in ElastiCache,
gets the data from the cache,
otherwise there's a cache miss,
therefore you read from the database
and you write to the cache.
This is something we've seen from before,
and it is called Lazy Loading
because only when you don't have a cache hits,
then you load the data into Amazon ElastiCache.
So, now let's talk about the use cases for Redis,
and there's one you need to know going into the exam.
It is around creating a Gaming Leaderboard.
So it is very complex.
The idea is that you want to say,
Who is number one, who is number two,
who is number three at any moment in time,
for your game.
And so there is a feature in Redis called Sorted sets,
which guarantees both uniqueness and element ordering.
And each time an element is added
it's going to be ranked in real time
and then add it in the correct order.
The idea is that if you have a Redis cluster,
you can create a Real-time Leaderboard
with a number one, number two,
and number three player in real time.
And all the Redis cache will have
the same leaderboard available.
That means that your clients
when talking to your Amazon ElastiCache using Redis,
they can have access to this leverage,
Real-time leaderboard,
and we don't need to program that feature application side.
We can use, leverage, Redis,
with the Sorted sets
to get access to Real-time Leaderboard.
And this is, yet again,
something that can come up in the exam.
Okay. So that's it for this lecture.
I hope you liked it.
And I will see you in the next lecture.