AWS Certified Solutions Architect - Professional 2020

Sign Up Free or Log In to participate!

Elasticache Lazy Loading vs Write Through

There is a question in AWS Exam Readiness that I couldn’t figure out why the answer is to configure elasticache write through.

Here is the question: 

"A company has an application that accesses a relational DB tier and runs on several EC2 instances placed behind an application load balancer. This application will now be used with a read-heavy workload to make medical records accessible to multiple insurance companies. Due to the nature of the data, compliance requires data protection at-rest and high availability, especially during sudden large peaks in load."

If it’s write through, then it has to add/update first the db before the cache gets filled. While Lazy Loading will have cache misses on the first run, the second run would make the data available in the cache. It says that it will be read-heavy so assuming that the first insurance company reads the data of a patient, the second insurance who will request for the same data would’ve hit the cache. Is there something that I am missing?

1 Answers

I think it may have something to do with managing the data expiration with Elasticcache. If you’re using the lazy loading, how do you ensure that you’re reading the most updated data from the cache. The write through cache is updated in real time when the database is updated.

Allan Francis Zabala

Won’t the cache be updated only when there is an add/update? The question does say that it’s read heavy. Can stale data be fixed by applying a ttl?

Allan Francis Zabala

Though write through would be the best answer in case there are no records to begin with. What the safe assumption for the exam? Always start from scratch unless explicitly stated that it contains existing data?

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?