When FAQ items change in Cosmos DB, the city’s Redis cache for the resident assistant must refresh. Which Functions approach fits?
Select an answer to reveal the explanation.
Short Explanation
A Cosmos trigger is the “shelf tag just changed” sensor—when FAQ items move in the catalog, Redis gets the memo without waiting for annual inventory day.
Full Explanation
When FAQ items change in Cosmos DB, caches that feed the resident assistant must update promptly. An Azure Functions Cosmos DB trigger (change feed) runs whenever FAQ documents change, then updates Redis (or deletes affected keys) so the assistant does not keep serving stale answers. That event-driven path ties cache freshness to the system of record instead of to hope or to slow batch cycles.
Flushing Redis on a fixed timer regardless of whether any FAQ item changed wastes work and still leaves a freshness window as large as the timer interval after edits. Requiring editors to restart the Function app manually after every FAQ edit fails operations and does not clear Redis by itself in a controlled way. Ignoring Cosmos changes and serving stale FAQ vectors until the next annual purge fails resident experience and can spread outdated municipal guidance.
Exam caveat: change feed processors must checkpoint correctly and handle replays idempotently when updating Redis. Distinguish document soft-deletes from creates/updates in FAQ logic. Operational check: edit a FAQ item in Cosmos, confirm the Function runs, verify the Redis key for that FAQ updates or invalidates, and query the resident assistant to ensure the new answer appears without an app restart.