Microsoft Certified: Azure Developer Associate (AZ-204)Monitor, troubleshoot, and optimize Azure solutionsMedium

A financial services company is developing a new online banking application in Azure. The application must process millions of transactions per day with extremely low latency, and data consistency is paramount. They are considering using Azure Cache for Redis to improve performance. Which caching strategy is most appropriate for their transaction processing requirements?

  1. ADirect-write with no cache
  2. BCache-aside with eventual consistency
  3. CCache-aside with write-through
  4. DWrite-behind with read-through
Show answer & explanation

Correct answer: C. Cache-aside with write-through

For applications requiring high data consistency, a write-through caching strategy ensures that data is written to both the cache and the permanent data store simultaneously. This minimizes the window for inconsistencies, which is critical for financial transactions.

Why the other options are wrong

  • A. Direct-write with no cache would not improve performance and would still hit the database directly for every operation.
  • B. Eventual consistency is not suitable for scenarios where strong consistency is paramount, like financial transactions.
  • D. Write-behind introduces a delay before data is written to the database, which can lead to temporary inconsistencies.

Write-Through Caching

A caching strategy where data is written simultaneously to the cache and the underlying data store. This ensures data consistency between the cache and the database.

  • Ensures strong data consistency.
  • Writes are slower due to dual write operations.
  • Reads are fast from the cache.

Memory trick: Cache consistency: Write-through keeps it tight!

More Monitor, troubleshoot, and optimize Azure solutions questions