Course menuSAA-C03

Exams / SAA-C03 / Caching and content delivery / Question 2

SAA-C03 practice question: Caching and content delivery (2 of 3)

Design High-Performing Architectures A free question from our original SAA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

An online retailer's product catalogue runs on Amazon RDS for PostgreSQL. The same few thousand product queries run tens of thousands of times a minute, and database CPU stays above 85%. The team wants these reads served in well under a millisecond. A supplier feed updates prices directly in the database several times a day, and customers must see a new price within 5 minutes. The team can change how the application reads data but cannot change the supplier feed. Which solution meets these requirements?

Choose one answer.

  1. A. Add Amazon ElastiCache, and change the application to cache query results on a cache miss with a 5-minute time to live (TTL).
  2. B. Add Amazon ElastiCache, and change the application to cache query results on a cache miss with no expiry, so popular items stay warm.
  3. C. Add three read replicas of the DB instance, and change the application to spread the catalogue queries evenly across the replicas.
  4. D. Put Amazon RDS Proxy in front of the DB instance, and change the application to send all the catalogue queries through the proxy endpoint.
Show the answer and explanation

Answer: A

  • A. Right: Correct. Repeated queries are answered from memory with microsecond-level latency, which takes most of the load off the database. Because the feed writes straight to the database, the cache cannot be updated on write; a 5-minute TTL makes each cached price expire and reload within the allowed delay. Learn more: Caching strategies for Memcached (opens in a new tab)
  • B. Wrong: This gives fast reads and removes the database load, but lazy loading with no expiry never refreshes an entry after the database changes. Prices updated by the supplier feed would stay stale indefinitely. A TTL is needed to bound how old a cached price can be. Learn more: Caching strategies for Memcached (opens in a new tab)
  • C. Wrong: Replicas would share out the CPU load, but every read is still a full database query, so latency stays at database speeds rather than in-memory speeds. Replication is also asynchronous, and the company pays for three more database instances. An in-memory cache meets the latency goal. Learn more: Working with DB instance read replicas (opens in a new tab)
  • D. Wrong: RDS Proxy pools and reuses database connections, which helps when many connections strain the database. It does not cache query results, so every query still runs on the database and CPU stays high. A cache is needed to avoid running the queries at all. Learn more: Amazon RDS Proxy (opens in a new tab)

Explanation

Very fast repeated reads point to an in-memory cache, but the freshness rule decides how to use it. The supplier feed writes straight to the database, so write-through caching is not possible; lazy loading with a TTL of 5 minutes or less bounds how stale a price can get. Read replicas and RDS Proxy still run every query on a database engine.

Study

Keep practising

Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.