Connecting Elasticache with RDS?

Viewed 3938

I am new to the Elastic Cache concept. Please pardon my knowledge on the concept.

currently, I want to set up an Elastic cache in front of my Postgres RDS.

I have theoretical knowledge of the functionality of elastic cache.

I am wording on how to set up an elastic cache that connects to my RDS instance?

What endpoint needs to be shared with the developers to access the elastic cache?

Or I completely understood the concept wrongly

Could anyone help me out of this?

1 Answers

ElastiCache is an in-memory datastore, with one of its primary use cases being to be used as a cache.

It would never directly connect to your MySQL database, instead values retrieved from the database would be added to the ElastiCache cluster.

Your application would need to make the decision of checking the cache first, and if it was empty then querying your MySQL database to retrieve the data. The successful result would then be written to the ElastiCache store so that next time your application attempts to do this it would just retrieve the result from the cache.

There will be a number of libraries that exist to combine this functionality so you could take a look at implementing one of these (dependant on your language) if you don't want to architect it yourself.

An alternative approach to caches I have also seen is called write through which involves everytime a write happens it will also write to the cache, for this reason your application only ever needs to read from the cache.

AWS have a great page to break down caching strategies that should help to provide further input.

Related