exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 280 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 280
Topic #: 1
[All AWS Certified Developer Associate Questions]

A company has a two-tier application that consists of a frontend application and an Amazon RDS for MySQL database. The frontend application retrieves data from the database. The data consists of postal codes and their associated geographic coordinates The application performs many more database reads than writes. The application retrieves each postal code from the database thousands of times each day.

A developer must improve the performance of the application to decrease latency.

Which change should the developer make to the application to meet these requirements?

  • A. Modify the application to use a lazy loading caching strategy with a small TTL value.
  • B. Modify the application to use a write-behind caching strategy.
  • C. Modify the application to use a write-through caching strategy.
  • D. Modify the application to use a lazy loading caching strategy with a large TTL value.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
fe2
Highly Voted 2 years, 6 months ago
Selected Answer: D
It is for sure D. Write-through is better for data that is changing often. But here it is not the case. The app is doing READS a lot, and few WRITES. That means LAZY LOADING is better. When it comes to TTL, postcode and geolocation is not something that changes frequently. So, you can go for larger TTL. It saves cost, cache is not invalidated too often, and you will not need to update cache very often. Also, your requests will be very fast, since it will directly read from cache. Shortly, the answer is D.
upvoted 17 times
tony554556
2 years, 5 months ago
Great explanation, thanks
upvoted 2 times
...
AsmaZoheb
1 year, 5 months ago
I really appreciate your help and the way of explanation. Thank you.
upvoted 1 times
...
...
k1kavi1
Highly Voted 2 years, 7 months ago
Selected Answer: D
Cache evicts data with small TTL value. So choosing large TTL value.
upvoted 5 times
...
rcaliandro
Most Recent 2 years ago
Selected Answer: C
In my opinion C is the correct anwer. First of all because using write-through caching strategy the writes are so heavy but guarantee that the cache is always updated (it is ok because there are more reads than writes). Secondly, it is ok to choose a lazy loading strategy (D) but I don't understand why you guys put a TTL record in the table. We don't want to remove the row from the table.
upvoted 1 times
...
m4r0ck
2 years, 4 months ago
Selected Answer: C
For those arguing that there are more reads than writes, this argument just makes option C the most optimised solution as it improves latency by doing less DB roundtrips as the cache is not stale. Option D will make the data stale in the cache and will eventually increase latency once the cache is invalidated.
upvoted 2 times
...
Ankit1010
2 years, 4 months ago
C is correct answer. Write-through caching strategy - is appropriate for an application that performs many more reads than writes, and the application retrieves the same data repeatedly. By using a write-through caching strategy, the application writes data to the cache and the database simultaneously. This ensures that the data in the cache is always up-to-date and the database is used only to retrieve data that is not in the cache. This approach can improve the application's read performance and decrease latency. Write-behind caching strategy - is appropriate for an application that performs more writes than reads. It is a technique that defers database updates until after new data is written to the cache. In the given scenario, as the application performs many more reads than writes, this strategy is not suitable.
upvoted 2 times
m4r0ck
2 years, 4 months ago
spot on!
upvoted 1 times
...
Ankit1010
2 years, 4 months ago
Lazy loading caching strategy with a small TTL value could potentially increase the number of cache misses, resulting in slower performance. On the other hand, using a lazy loading caching strategy with a large TTL value could potentially result in stale data being served to users, which could impact the application's reliability and accuracy.
upvoted 1 times
...
...
Nosal
2 years, 6 months ago
Selected Answer: C
Go with C
upvoted 1 times
...
xicomynor
2 years, 6 months ago
Selected Answer: C
I chose C. The reason is that with write-through caching strategy, data will always be available at cache, so there will be less latency. One of the disadvantages of using write-through is related to situations when you cache data that will never be read (Cache churn), but this questions states that "The application retrieves each postal code from the database thousands of times each day", so most of the data cached will be read.
upvoted 2 times
...
hamimelon
2 years, 7 months ago
Why not C? It says each postcode will be accessed thousands of times a day. Also, the content won't change very often, because the coordinates of a zipcode is unlikely to change.
upvoted 1 times
KT_Yu
2 years, 6 months ago
The application performs many more database reads than writes.
upvoted 1 times
...
...
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.

SaveCancel
Loading ...