Search code examples
postgresqlamazon-web-servicesredisamazon-rdsamazon-elasticache

When an RDS Postgres DB is dropped, does it clear the connected Redis Elasticache?


This question as simple as the title suggests...

We are not fully confident that reloading data into our RDS Postgres instance, clears our Redis cache that is caching calls made to that DB. We are therefore not confident our new data displayed in our UI is made up of new or stale cache data. Does anyone have an idea.

We've mined AWS to the best of our ability to see if we can see the data/size of what is in the cache, but to little avail.

It seems fairly difficult to research what appears to be a simple question as most google results are related to clearing a Cache, full stop (I'm guessing a lot of people have issues with doing that).


Solution

  • A bit more digging into this and I've found a reasonable metric with gives the information I needed. For any person who runs into the same issue in the future follow these steps:

    1. Drop your DB.
    2. Navigate to the ElasticCache Dashboard in AWS.
    3. Select the cache you're interested in.
    4. Scroll down through the metrics graphs until you see 'Current Items (Count)'
    5. From this graph you can see the number of items in your cache and it should be pretty clear if the DB Drop emptied the cache.

    N.B. At the current time of writing, a DB drop appears to be clearing our cache, although we are not entirely sure if this is an optional setting we've introduced and can be turned off.