Cache Invalidation via Notification Channels in Microservices

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In distributed microservices environments, cached data across consuming microservices may become invalid due to changes on the producer side, but these changes do not immediately propagate, leading to stale caches until the time-to-live (TTL) period expires.

Innovation Solution

Implementing a notification channel that allows consumers to receive near-real-time notifications of data modifications on the producer side, enabling them to invalidate their caches promptly without relying on TTL expiration.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If TTL-based caching is used, then data freshness is improved, but cache invalidation responsiveness deteriorates

Engineering Contradiction:
Improvedata freshnessVSAvoidcache invalidation responsiveness
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system implements a feedback mechanism where the producer publishes change notifications to a notification channel when data changes occur. Consumers subscribe to this channel and receive real-time feedback about data changes, allowing them to invalidate their caches immediately without waiting for TTL expiration. This resolves the contradiction by providing timely invalidation feedback while maintaining the benefits of caching.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system performs preliminary action by pre-establishing notification channels and subscription mechanisms before data changes occur. When a change happens, the pre-configured notification system immediately alerts consumers, who can then invalidate their caches proactively. This preliminary setup eliminates the need to wait for TTL expiration and enables immediate cache invalidation while maintaining data freshness.

Inventive Principle:
Principle #10Preliminary action

2Loss of time

If notification channels are implemented, then cache invalidation responsiveness is improved, but system complexity increases

Engineering Contradiction:
Improvecache invalidation responsivenessVSAvoidsystem complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The notification channel serves multiple functions: it notifies consumers of data changes, enables cache invalidation, and can trigger other consumer actions. By making this single component multi-functional, the system achieves improved cache invalidation responsiveness without proportionally increasing complexity. The same notification infrastructure handles change propagation and cache management tasks.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The notification channel acts as an intermediary between the producer and consumers. Instead of consumers directly polling for changes or relying on complex distributed locking mechanisms, the notification channel mediates the communication, providing a simple publish-subscribe interface that reduces overall system complexity while enabling fast cache invalidation.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If TTL period is extended, then data freshness is improved, but cache validity window increases

Engineering Contradiction:
Improvedata freshnessVSAvoidcache validity window
Core Design Contradiction:
ReliabilityVSDuration of action of stationary object

Solution Approach 1:

The system performs preliminary action by pre-establishing notification channels and subscription mechanisms before data changes occur. When a change happens, the pre-configured notification system immediately alerts consumers, who can then invalidate their caches proactively. This preliminary setup eliminates the need to wait for TTL expiration and enables immediate cache invalidation while maintaining data freshness.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12242382B2Cache invalidation across distributed microservices
Publication Date: 2025.03.04 ORACLE INT CORP
  • US12242382B2 patent drawing
  • US12242382B2 patent drawing
  • US12242382B2 patent drawing

AI summary

Techniques for cache invalidation across distributed microservices are disclosed, including: monitoring, by a resource manager, a resource that is available for obtaining by a set of one or more resource utilizers, wherein a resource utilizer in the set of one or more resource utilizers obtains a version of the resource; publishing, by the resource manager, a notification stream including notifications associated with the resource, wherein the resource utilizer subscribes to the notification stream including the notifications associated with the resource; detecting, by the resource manager, a modification of the resource; responsive to detecting the modification of the resource: publishing a notification to the notification stream that indicates the modification to the resource.