Client-Side Cache Consistency via Database Change Notifications

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Client-side query caches face data consistency issues, leading to potential production of incorrect query results due to the inability to simultaneously invalidate cache entries with database changes, which is not present in server-side query caches.

Innovation Solution

A method is implemented to associate a snapshot of the database with a client, indicating the state of the database after the last interaction, and invalidate cached results based on this snapshot, ensuring transactional consistency by using a Database Change Notification Module to notify clients of changes affecting cached results.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If a client-side query cache is implemented to improve response time and reduce server load, then query retrieval speed is improved, but data consistency between cached results and database changes deteriorates

Engineering Contradiction:
Improvequery retrieval speedVSAvoiddata consistency
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The system implements a feedback mechanism where the client monitors database change notifications and uses this feedback to invalidate cached query results. When the database server notifies the client of data changes, the client invalidates corresponding cached results, ensuring that subsequent queries retrieve updated data from the server rather than stale cached data.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system performs preliminary actions by pre-invalidating cached query results before they are requested. Upon receiving a database change notification, the client proactively invalidates all cached results that may be affected by the changes, so that when a query is subsequently executed, the client immediately retrieves fresh data from the server without returning stale cached results.

Inventive Principle:
Principle #10Preliminary action

2Loss of time

If a client-side query cache stores query results locally to eliminate server requests, then response time is improved, but the ability to simultaneously invalidate cache with database changes is lost

Engineering Contradiction:
Improveresponse timeVSAvoidcache invalidation capability
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The system uses an intermediary approach where the client acts as a mediator between the database server and the cached query results. The client receives database change notifications from the server and uses this information to invalidate cached results, effectively mediating the invalidation process without requiring direct server involvement in each cache invalidation event.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system implements self-service by enabling the client to autonomously manage its own query cache. The client independently monitors for database changes, determines which cached results need invalidation, and executes the invalidation process without requiring server-side cache management infrastructure, thus simplifying the overall system architecture.

Inventive Principle:
Principle #25Self-service

3Productivity

If client machines are added horizontally to provide caching capabilities, then caching capacity is improved, but the complexity of maintaining data consistency across multiple clients increases

Engineering Contradiction:
Improvecaching capacityVSAvoidconsistency management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system applies segmentation by dividing the caching responsibility among multiple independent client machines, each managing its own local query cache. Rather than having a centralized cache management system, each client independently receives database change notifications and manages its own cache invalidation, segmenting the complexity across multiple independent units.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system uses universality by implementing a standardized cache invalidation mechanism that works identically across all client machines. Each client uses the same approach of monitoring database change notifications and invalidating cached results based on those notifications, allowing the solution to be universally applied across any number of client machines without increasing complexity.

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

Data Source

PatentUS9697253B2Consistent client-side cache
Publication Date: 2017.07.04 ORACLE INT CORP
  • US9697253B2 patent drawing
  • US9697253B2 patent drawing
  • US9697253B2 patent drawing

AI summary

A method, system, and computer program product is disclosed for caching results in a client-side cache. Embodiments of a method, a system, and a computer program product are disclosed that associate a first snapshot of a database with a client that indicates a state of the database after a last database request by the client, and indicate any number of invalid cached results in the client cache for the client based upon the first snapshot. In some embodiments, the method further includes receiving a second snapshot that indicates a state of the database upon receipt of a database server request by the client, and updating the first snapshot with the second snapshot.