IP Library Granted Patent US 9,251,199
Granted Patent B2
US 9,251,199 · App. 14/074,047 · Granted Feb 2, 2016

Stateless database cache

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,251,199
App. No.
14/074,047
Granted
Feb 2, 2016
Kind
B2
Abstract

A cache and method of caching for a database are provided, in which the cache and the database are in the same state. Responsive to a query for data, the method extracts search terms from the query and maps filter settings to an appropriate format. The method also (a) outputs data retrieved from a cache, if there is a cache hit and (b) builds cache and retrieves the data from the database, if there is a cache miss. If there are multiple users and/or instances, the cache may be updated for all users and/or instances by determining whether all changes are to be committed, in which case the changes are pushed to all users and/or instances.

Claims (105)

1. A computer-implemented method of storing and outputting data in a cache, the method comprising:

receiving, by a processor, a request for the data;

extracting, by the processor, search terms from the request;

mapping, by the processor, filter settings to a format recognizable by a database in which the data is stored;

determining, by the processor, a user from which the request originated;

responsive to a determination that the request is initiated by a source user:

instantiating a source user data access client (DAC);

mapping a key table from a middleware format to a second format;

retrieving keys of a navigation target user via the source user DAC;

determining, by the processor, whether the data exists in the cache;

responsive to a determination, by the processor, that the data exists in the cache, retrieving the data from the cache;

responsive to a determination, by the processor, that the data does not exist in the cache, retrieving the data from the database and saving the data to the cache; and

outputting, by the processor, the retrieved data based on the filter settings.

2. The method of claim 1 further comprising:

responsive to a determination, by the processor, that the source user is different from a current user, mapping a key table to a format recognizable by the database in which the data is located.

3. The method of claim 1 , further comprising responsive to a determination by the processor that the requested data is in tabular form:

performing, by the processor, count-call handling; and

subsequent to the performance of the count-call handling, performing, by the processor, get-data handling.

4. The method of claim 3 , wherein the count-call handling includes:

receiving, by the processor, the request for data, the request including a count of the tabular data;

responsive to a determination, by the processor, that the requested data does not exist in the cache, saving the count to the cache; and

constructing, by the processor, a response structure based on the count;

wherein the count corresponds to at least one of: the number of rows and the number of entries in the tabular data.

5. The method of claim 4 , wherein the get-data handling includes:

receiving, by the processor, the request for data;

responsive to a determination, by the processor, that the requested data does not exist in the cache, mapping sorting options to a format recognizable by the database, saving the requested data to the cache, and searching a response structure; and

responsive to a determination, by the processor, that the requested data exists in the cache, using keys for data extraction from the cache and using selection parameters for filtering in the cache; and

sorting, paging, and filling, by the processor, the response structure;

wherein a format in which the retrieved data is output is as the response structure.

6. The method of claim 5 , wherein the selection parameters are based on the request for data.

7. The method of claim 3 , wherein the count-call handling and the get-data handling are each called with a same query and the count-call handling is performed the first time the same query is made, and the get-data handling is performed subsequent times that the same query is made.

8. The method of claim 1 , wherein the cache is a cluster table including buckets, the cluster table including:

a client field representing a client with which data in a bucket of the cluster table is associated;

a region identifier identifying at least one region in the cluster table that is readable or writable;

a user identifier identifying a user with whom the cluster table is associated;

an entity field identifying a middleware entity used to determine a structure of the data in the cluster table;

a record counter for the at least one readable or writable region of the cluster table;

a timestamp recording events;

a line identifier identifying the size of the cluster table;

a status identifier indicating an availability of the cache; and

a cluster identifier identifying a length field for user data in the at least one readable or writable region.

9. The method of claim 8 , further comprising responsive to a determination that the cache is unavailable, retrieving the data from the database.

10. The method of claim 9 , further comprising extracting, by the processor, corresponding node instances from a change object, wherein the change object includes at least one of: a business object, a business object node, a key, a change mode indicating types of changes to be made, and changed attributes.

11. The method of claim 9 , further comprising:

determining, by the processor, that changes made during a session are to be committed;

wherein the writing of the updated entity instances into the cache is performed responsive to a determination, by the processor, that the changes are to be committed.

12. The method of claim 9 , wherein the determination of committing changes is made by a business object processing framework transaction manager, the manager coordinating document changes made within one logic unit of work to related business objects.

13. The method of claim 1 , wherein the cache is a database table including a rawstring.

14. The method of claim 1 , further comprising:

responsive to a determination, by the processor, to commit changes made to the cache in a current session, pushing, by the processor, the changes to all users.

15. The method of claim 1 , wherein the cache comprises:

a client field representing a client with which data in a bucket of the cluster table is associated;

a region identifier identifying at least one region in the cluster table that is readable or writable;

a user identifier identifying a user with whom the cluster table is associated;

an entity field identifying a middleware entity used to determine a structure of the data in the cluster table;

a record counter for the at least one readable or writable region of the cluster table;

a timestamp recording events;

a line identifier identifying the size of the cluster table;

a status identifier indicating an availability of the cache; and

a cluster identifier identifying a length field for user data in the at least one readable or writable region.

16. A computer-implemented method for updating a cache, the method comprising:

receiving, by a processor, a command to update the cache;

determining, by the processor, a user from which the command originated;

responsive to a determination that the request is initiated by a source user:

instantiating a source user data access client (DAC);

mapping a key table from a middleware format to a second format;

retrieving keys of a navigation target user via the source user DAC;

identifying, by the processor, a list of entities to be updated;

retrieving, by the processor, updated entity instances; and

writing, by the processor, the updated entity instances into the cache.

17. A computer-implemented method of updating a cache based on a query in a business object processing framework (BOPF), the method comprising:

instantiating, by a processor, an entity data access client (DAC);

mapping, by the processor, filter settings from a middleware format to a BOPF format;

extracting, by the processor, at least one search term from the query;

instantiating, by the processor, a BOPF service manager;

setting defaults for paging;

calculating navigation paths as follows: responsive to a determination that the query is initiated by a source entity:

instantiating a source entity DAC;

mapping a key table from the middleware format to the BOPF format;

retrieving keys of a navigation target entity via the source entity DAC;

responsive to a determination, by the processor, that no navigation paths are specified, mapping the key table from the middleware format to the BOPF format;

responsive to a determination, by the processor, that data associated with the at least one search term is stored in the cache:

retrieving the data from the cache based on the BOPF keys;

filtering the cache based on BOPF selection parameters and the at least one search term; and

sorting, paging, and filling a request response structure;

responsive to a determination by the processor that the data associated with the at least one search term is not stored in the cache:

mapping middleware sorting options into BOPF sorting options;

retrieving data via the entity DAC; and

searching, sorting, paging, and filling the request response structure.

18. The method of claim 17 , further comprising responsive to a determination by the processor that the query is for table data, the table data including an associated count, and prior to the setting of defaults for paging:

responsive to a determination, by the processor, that the count is stored in the cache, retrieving the count;

responsive to a determination, by the processor, that the count is not stored in the cache:

retrieving, by the processor, the count from the entity DAC; and

saving, by the processor, the count from the entity in parallel with the retrieving of the count; and

constructing, by the processor, the request response structure.

19. The method of claim 17 , further comprising responsive to a determination by the processor that the query is for table data and prior to the setting of defaults for paging:

responsive to a determination, by the processor, that the table data is stored in the cache:

using keys for data extraction from the cache;

using selection parameters and search strings for filtering in the cache; and

sorting, paging, and filling the request response structure;

responsive to a determination, by the processor, that the table data is not stored in the cache:

mapping sorting options from the middleware format to the BOPF format;

retrieving data via the entity DAC; and

searching, sorting, paging, and filling the request response structure.

20. The method of claim 17 , further comprising responsive to a determination, by the processor, to commit changes made to the cache in a current session, updating, by the BOPF service manager, all instances with the changes.

Assignments (2)
CHANGE OF NAME Recorded Aug 26, 2014
From: SAP AG
To: SAP SE
Reel/Frame 033625/0223 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 7, 2013
From: SCHIEBELER, DIRK
To: SAP AG
Reel/Frame 031561/0216 →