1Z0-997-25 Question 94
Single answerYou are building a microservices-based e-commerce platform on Oracle Cloud Infrastructure (OCI). The product catalog is frequently read by multiple services but only updated occasionally. To reduce latency and improve scalability, you plan to cache product data using OCI Cache. However, new product information must be visible to users soon after it is updated, without serving significantly stale data. Which approach best satisfies these requirements?
- A
Use lazy caching with an indefinite Time to Live (TTL), only refreshing entries when they are requested after expiration
- B
Implement a write-through caching strategy, where updates to the product catalog automatically update the cache
- C
Rely solely on database-level replication and avoid using OCI Cache for product catalog lookups
- D
Configure a read-through caching approach that invalidates or refreshes cache entries immediately upon data changes
Show answer and explanation
Correct answer: D
Explanation
For product data that is updated occasionally yet heavily read, a read-through cache with an active invalidation or refresh mechanism provides the best balance of low-latency access and data consistency. When new products or updates are published, the invalidation process can remove or update the relevant entries, ensuring they do not remain stale. According to OCI best practices, leveraging OCI Cache in a pattern that aligns with your data update frequency and consistency requirements is crucial for optimal application performance and scalability.
- A. Incorrect.
Option 1: Lazy caching with an indefinite TTL can result in very stale data if updates occur and the cache does not proactively refresh. This makes it unsuitable for scenarios where data changes must be quickly reflected.
- B. Incorrect.
Option 2: Write-through caching can help keep cache and database in sync when data is written. However, in a microservices environment where updates are relatively infrequent and read volume is high, read-through caching with targeted invalidation often provides finer control over data freshness and can be more efficient in ensuring updates are visible quickly.
- C. Incorrect.
Option 3: Avoiding OCI Cache altogether means losing the performance benefits of caching. Relying solely on the database can lead to higher latency and reduced scalability under heavy read loads.
- D. Correct.
Option 4 (Correct): A read-through caching approach, combined with an invalidation or refresh mechanism upon data changes, ensures that data remains fresh with minimal stale reads. This balances performance (fast lookups from cache) with consistency (updates are reflected quickly) in a microservices environment.