QuestionQ40

VerifiedDesigning integration solutions to meet persistence requirements

An external API regularly calls an Employees System API to retrieve employee data from a MySQL database. The architect must create a caching strategy that queries the database only when the Employees table is updated; otherwise, it must return a cached response to minimize redundant transactions handled by the database.

What must the architect do to meet the caching objective?

Explanation

An On Table Row source configured for the Employees table can detect newly obtained table rows and trigger Invalidate Cache when the table changes. This removes the cached response only on a relevant data update, so subsequent API requests retrieve fresh MySQL data while unchanged data continues to be served from the object-store cache. A time-based Scheduler could invalidate the cache even when no update occurred, causing unnecessary database queries. MuleSoft documents that On Table Row selects from a table at intervals and emits messages for the rows obtained, and that Invalidate Cache clears the referenced caching strategy.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!