Why Did Oliveyoung Revamp Its Gift-Giving Feature? Part - 2
Key point
Oliveyoung developed a custom annotation-based cache module to improve the inconvenience of Spring's existing cache and circuit breaker settings.
Details
The Oliveyoung Display Service has used caching with Redis for real-time traffic response and Resilience4j's circuit breaker to prevent failure propagation. However, the existing approach had limitations such as inconvenience from using annotations individually, mistakes caused by using SpEL, and lack of support for Redis's Hash type.
To solve this, Oliveyoung built a separate cache module utilizing AoP (Aspect-Oriented Programming). The new @DisplayCaching annotation provides the following key features.
- Dynamic cache key generation: Enables flexible key management by including function parameters in the key value
- Support for various data structures: Supports both String and Hash types of Redis
- TTL and version management: Includes cache expiration time (TTL) settings and daily version (Suffix) management functionality
- Flexible failure handling: Allows choosing whether to throw an exception or perform Fallback logic when a cache lookup fails
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.