Client-Side Cache Consistency via Database Change Notifications
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Client-side query caches face data consistency issues, leading to potential production of incorrect query results due to their inability to simultaneously invalidate cache entries with database changes, which is not present in server-side query caches.
Innovation Solution
A method and system that involve retrieving a snapshot of the database state after the last client request, determining invalid cached results, and transmitting updates to ensure transactional consistency by using a database change notification module to invalidate cached results and provide an updated snapshot.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If a client-side query cache is implemented, then response time is improved and server load is reduced, but data consistency is compromised
Solution Approach 1:
The system performs preliminary actions by sending a database change notification to the client cache before the actual data change is applied. This allows the client cache to proactively invalidate its cached results in advance, ensuring consistency when the client subsequently queries the database. The notification mechanism enables the client to take preparatory action (cache invalidation) before the inconsistency would otherwise occur.
Solution Approach 2:
The system implements a feedback mechanism where the server monitors database changes and sends notifications back to the client cache. This feedback loop ensures that the client cache is aware of data changes and can adjust its cached results accordingly. The notification system creates a closed-loop control where the server's knowledge of database state is communicated back to the client, enabling the client to maintain consistency without continuously polling the server.
2Speed
If a client-side query cache is used, then query retrieval speed is improved, but the ability to maintain transactional consistency with database changes is lost
Solution Approach 1:
The patent introduces a notification mechanism as an intermediary between the database server and the client cache. This intermediary component receives database change notifications from the server and relays them to the client cache, enabling the client to maintain transactional consistency without directly monitoring the database. The intermediary handles the coordination and communication, allowing the client cache to operate independently while staying synchronized with database changes.
3Device complexity
If a client-side cache stores query results, then additional caching capabilities are provided without requiring additional servers, but the complexity of maintaining cache validity increases
Solution Approach 1:
The client cache implements self-service by automatically receiving and processing database change notifications. When the cache receives a notification about a data change, it autonomously invalidates its relevant cached results without requiring manual intervention or complex validation logic. This self-service approach simplifies cache maintenance by making the system self-regulating based on incoming notifications from the server.
Data Source
AI summary
A method, system, and computer program product is disclosed for interacting with a client supported by a client-side cache. Embodiments of a method, a system, and a computer program product are disclosed that retrieve a first snapshot, indicating a state of the database after a last database request by the client, associated with the client, determine any number of invalid cached results for the client based on the first snapshot, and transmit the any number of invalid cached results and a second snapshot, an update for the first snapshot.


