Bird
0
0

Consider this Spring Boot Redis cache configuration snippet:

medium📝 Debug Q14 of 15
Spring Boot - Caching
Consider this Spring Boot Redis cache configuration snippet:
@Bean
public RedisCacheManager cacheManager(RedisConnectionFactory factory) {
    return RedisCacheManager.builder(factory).build();
}
If the Redis server is down, what will happen when the application tries to cache data?
AApplication falls back to file-based cache
BApplication throws a runtime exception and crashes
CData is cached in memory without Redis
DCaching silently fails but application continues
Step-by-Step Solution
Solution:
  1. Step 1: Understand RedisCacheManager dependency

    RedisCacheManager requires a running Redis server to store cache data.
  2. Step 2: Analyze behavior if Redis is down

    Without Redis, cache operations typically fail silently and the application continues unless explicitly configured to fail.
  3. Final Answer:

    Caching silently fails but application continues -> Option D
  4. Quick Check:

    Redis down usually does not crash app by default [OK]
Quick Trick: Redis down causes silent cache failure unless handled [OK]
Common Mistakes:
  • Assuming fallback to memory cache
  • Thinking caching silently fails
  • Expecting file-based fallback

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes