Sliding Window Cache for REST API Pagination State

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Legacy applications using REST APIs face challenges in maintaining a consistent pagination state during idempotent GET requests, leading to inconsistent data transmission between clients and servers, particularly when dealing with large datasets like index records containing millions of entries.

Innovation Solution

Implementing a mechanism that uses a continuation token and a sliding window cache to ensure idempotent GET requests are handled consistently, where the server caches index records and maintains a reference count to track which records have been sent to the client, allowing for efficient and accurate data streaming.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If a memory map with pointers is used to fulfill GET requests, then the server can efficiently retrieve and transmit data records, but the previous pointer is lost and the server lacks awareness of whether the client has received older records, leading to inconsistent pagination state

Engineering Contradiction:
Improvedata transmission efficiencyVSAvoidpagination state consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The server maintains a sliding window cache that stores references to previously transmitted data records. When a GET request arrives, the server checks the continuation token against the sliding window to determine which records have already been sent and which are still available. This feedback mechanism ensures the server is aware of the client's reception status and can consistently serve the same records for the same continuation token, resolving the pagination state inconsistency.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The server pre-caches data records in the sliding window before they are requested by the client. This preliminary action ensures that when a GET request with a continuation token arrives, the server already has the necessary records available in memory, enabling efficient retrieval without needing to re-fetch from storage, thus maintaining both productivity and reliability.

Inventive Principle:
Principle #10Preliminary action

2Ease of operation

If the server moves the pointer to the next group of files for succeeding GET requests, then new data can be transmitted, but the old pointer is lost and previous records cannot be re-transmitted

Engineering Contradiction:
Improvedata streaming continuityVSAvoidrecord re-transmission capability
Core Design Contradiction:
Ease of operationVSAdaptability or versatility

Solution Approach 1:

The server creates a copy of the data record references in the sliding window cache, separate from the original storage pointers. This copying mechanism allows the server to maintain multiple references to the same data records - the original pointers for storage and the cached references for transmission. When re-transmission is needed, the server can serve from the cached copies without losing the ability to serve the same records again, enabling both continuous streaming and re-transmission capability.

Inventive Principle:
Principle #26Copying

3Device complexity

If the server lacks awareness of client reception status, then the system remains simple, but inconsistent pagination state occurs between client and server

Engineering Contradiction:
Improveserver state trackingVSAvoidclient-server state consistency
Core Design Contradiction:
Device complexityVSReliability

Solution Approach 1:

The sliding window cache provides the server with feedback about which records have been transmitted and are still in the transmission window. The continuation token mechanism allows the server to track the client's position in the data stream. This feedback loop ensures that the server maintains awareness of the client's reception status without excessive complexity, as the tracking is done through a structured cache rather than complex state management logic.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11360858B2Method and approach for pagination over data stream with sliding window
Publication Date: 2022.06.14 EMC IP HLDG CO LLC
  • US11360858B2 patent drawing
  • US11360858B2 patent drawing
  • US11360858B2 patent drawing

AI summary

An example method includes receiving, at a server, a request for a list of a first group of index records that correspond to stored data, creating a data streaming session with a client, reading an index file and obtaining a list of the first group of index records from the index file, populating a content cache with a signature that corresponds to the first group of index records, creating a sliding window and populating it with the signature and a pointer to a next group of index records, populating an attribute cache with data streaming session information and the sliding window, creating a continuation token which, when received by the server from the client, indicates to the server that the list of the first group of index records has been received by the client.