Cache invalidation based on a declarative approach for separating business logic of microservices from cache update rules
Vitalii Falkevych, A Lisniak · Eastern-European Journal of Enterprise Technologies · 2025
The object of this study is the mechanisms of cache invalidation within a microservice architecture. The research addresses the challenge of reducing inter-service dependences, enhancing system performance, and ensuring data consistency in distributed high-load environments by optimizing cache management strategies. The study's findings include the development of a declarative approach to cache invalidation, which ensures the decoupling of microservice business logic from cache update mechanisms. The proposed solution is based on a centralized cache management strategy utilizing YAML configurations in conjunction with asynchronous message exchange between services. Optimization of the mechanisms for adding, updating, and deleting cache elements enables efficient management of cached data, warranting the avoidance of residual entries after deletion, updating all lists in which the element appeared, as well as maintaining cache consistency when updating or deleting data. The proposed approach contributes to increasing the autonomy of microservices, reducing inter-service dependences, and more efficient use of the cache. The features and distinctive characteristics of the results relate to the fact that the proposed approach uses a declarative cache management model, which differs from conventional imperative solutions. This enables flexibility in configuring cache update mechanisms without the need to modify the business logic of microservices. The practical implications of the study extend to high-load distributed systems where rapid data retrieval, scalability, and resilience to varying workloads are critical. The proposed approach could be applied in the design of effective caching strategies within microservice-based architectures