A developer is integrating Amazon ElastiCache in an application. The cache will store data from a database. The cached data must populate real-time dashboards.
Which caching strategy will meet these requirements?
The best caching strategy for populating real-time dashboards using Amazon ElastiCache would be a write-through caching strategy. In this strategy, when new data is written to the database, it is also written to the cache. This ensures that the most current data is always available in the cache for the real-time dashboards to access, reducing the latency of the data retrieval. Additionally, using a write-through cache ensures that data consistency is maintained between the database and the cache, as any changes to the data are written to both locations simultaneously.
When using a write-through cache strategy, the cache is updated in real-time alongside the database. This ensures that the cached data remains consistent with the underlying database. According to AWS best practices, this approach pushes data into the cache at the time it is written to the database, reducing the risk of serving stale data.
In contrast, option A (a read-through cache strategy) may result in stale data, particularly if the cache has a time-to-live (TTL) setting that allows data to remain in the cache longer than it remains accurate in the database. This can be problematic for real-time dashboards that require up-to-date information. For these reasons, I opted for option D.
https://aws.amazon.com/caching/best-practices/#:~:text=Write%2Dthrough,also%20pushed%20into%20the%20cache.
Please correct me if my understanding is incorrect, as I am still learning.
D. A write-through cache: A write-through caching strategy immediately writes data to both the cache and the database at the same time. This approach ensures that the cache always contains the most recent data, making it highly suitable for applications that require up-to-date information, such as real-time dashboards.
ans- A
Option D, a write-through cache, is incorrect because it would not meet the requirement of populating real-time dashboards. A write-through cache writes data to the cache and the database at the same time. This means that the data in the cache would always be up-to-date, but it would also mean that the cache would always be lagging behind the database. This would cause a delay in populating real-time dashboards.
I agree. I think it's A because D is better option when you need data to be consistent and highly available since data is always up to date but as Prem28 says it lags behind on latency when compared to read-through. What I get from the question is they need strategy for "real-time" dashboards --> reduction of latency not accuracy or consistent data
A write-through cache strategy involves writing data to both the cache and the underlying database simultaneously. When data is updated or inserted into the database, it is also stored or updated in the cache to ensure that the cache remains up-to-date with the latest data.
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
MrTee
Highly Voted 1 year, 6 months agoSaudis
Most Recent 2 weeks agotirthyakamaldasgupta
3 months ago65703c1
5 months, 3 weeks agoWalker17
9 months, 1 week agoSerialiDr
10 months agotqiu654
11 months, 2 weeks agoPrem28
1 year, 5 months ago[Removed]
11 months, 1 week agoloctong
1 year, 6 months ago