StudyToCert

All certifications / AI-200 / Lessons

Microsoft Certified: Azure AI Cloud Developer Associate AI-200 (replaced AZ-204) · Domain 2: Develop AI solutions by using Azure data management services

Azure Managed Redis: cache-aside pattern, TTL and invalidation, eviction policies

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

A cache is a small, very fast memory that keeps copies of things you look up often, like keeping your most-used spices on the counter instead of in the basement pantry. Redis is a popular cache. In the cache-aside approach, your app checks the counter first; if the spice is not there, it fetches it from the pantry (the database), puts a copy on the counter and uses it. Each copy gets an expiry timer (TTL) so old copies do not stay forever. When the real data changes, the app throws away the copy so the next lookup gets the fresh one. And when the counter is full, an eviction policy decides which copies to clear away to make room.

It is the first morning of a big sale at Copperline Kitchenware, a fictional online store, and Sofia from the platform team is watching the product API. Pages load quickly thanks to the new Redis cache, until a merchandiser drops the price of a popular skillet and customers keep seeing the old price for several minutes. Some complain at checkout. An hour later a different alert fires: Redis memory is full, and the shopping-cart service, which stores carts in the same cache, starts losing carts. Sofia now has three questions to answer before lunch. Who refreshes the cache, when should entries expire, and what gets thrown out when memory runs out?

Redis is an in-memory data store that answers in well under a millisecond, which makes it the standard cache in front of slower databases and expensive AI model calls. Azure Managed Redis is Microsoft's current managed Redis offering, built on Redis Enterprise software. It offers tiers optimized for memory, a balance of memory and compute, or compute, plus clustering, high availability and optional modules such as search and JSON that you choose when you create the cache. From Python you connect with the redis package, also called redis-py, over Transport Layer Security (TLS), authenticating with an access key or, preferably, Microsoft Entra ID so no long-lived secret sits in your configuration.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 7 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study AI-200 for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the AI-200 study plan