IP Library Granted Patent US 10,515,013
Granted Patent B2
US 10,515,013 · App. 15/813,936 · Granted Dec 24, 2019

Techniques for handling requests for data at a cache

Inventors: Jimmy Hua (San Francisco, CA); Alejandro Soini (Berkeley, CA); Christopher Wall (Austin, TX); Matthew Small (Mill Valley, CA); Raj Advani (Santa Ana, CA); Shumin Zhao (Union City, CA); Weiping Tan (Dublin, CA)
Assignee: salesforce.com, inc.
G06F12/0815G06F9/00G06F12/0804G06F12/0811G06F12/0859G06F12/0891G06F12/1018G06F16/24552
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 10,515,013
App. No.
15/813,936
Granted
Dec 24, 2019
Kind
B2
Abstract

Techniques are disclosed relating to retrieving data from an in-memory cache, such as that for a database system. In various embodiments, an in-memory cache receives a request from an application for data, where the request specifies a class having a function executable to access the data from a location external to the cache in response to a cache miss. The cache handles the request such that the cache miss is not returned to the application. Specifically, the cache, in some embodiments, determines whether it stores the requested data, and in response to determining that it does not store the data, calls the function of the class to access the data from the location external to the cache and receives the data returned by the execution of the function. The cache then stores the received data in the cache and returns the received data in response to the request.

Claims (64)

1. A method, comprising:

receiving, at an in-memory cache of a computer system, a request from an application for particular data, wherein the request passes in a class having a function executable to access the particular data from a location external to the in-memory cache in response to a cache miss;

handling, at the in-memory cache, the request such that the cache miss is not returned to the application, wherein the handling includes:

determining whether the in-memory cache stores the particular data;

in response to determining that the in-memory cache does not store the particular data:

calling the function of the class passed in by the request to access the particular data from the location external to the in-memory cache;

receiving the particular data returned by execution of the function;

storing the particular data in the in-memory cache; and

returning the particular data in response to the request; and

invalidating, at the in-memory cache, data returned by execution of the function in response to determining that the function included in the class has been modified.

2. The method of claim 1 , further comprising:

calling another function of the class to determine whether data in the in-memory cache has been stored for an interval of time that satisfies a staleness threshold; and

in response to determining that a portion of the data in the in-memory cache has been stored for an interval of time that satisfies the staleness threshold, invalidating the portion of the data.

3. The method of claim 1 , wherein the particular data is stored in the in-memory cache based on a key, and the method further comprising:

generating the key based on a value corresponding to the class passed in by the request and a hash of variables passed to the function.

4. The method of claim 1 , further comprising:

after storing the particular data in cache, receiving an additional request for the particular data, wherein the additional request passes in the class; and

returning the particular data in response to receiving the additional request without calling the function of the class passed in by the additional request.

5. The method of claim 1 , wherein the request includes variables usable to generate a query for accessing the particular data from a database at the external location, and wherein the particular data is stored in the in-memory cache in association with the variables.

6. The method of claim 1 , wherein the function of the class is stored outside of the in-memory cache, and wherein the external location is a database of the computer system.

7. A non-transitory, computer-readable medium having program instructions stored thereon that are capable of causing a database system to perform operations comprising:

receiving a request from an application for requested data stored in a cache of the database system, wherein the request passes in a class having a function that is executable to retrieve the requested data from a database;

prior to handling the request, making a particular determination on whether the function is capable of returning data when called by the database system;

determining, based on the particular determination, whether to generate a record having an indication specifying that the function is not capable of returning data, wherein the indication is displayable to a user associated with the application; and

handling the request by:

determining whether the requested data is stored in the cache;

based on determining that the requested data is stored in the cache:

returning the requested data in response to the request; and

based on determining that the requested data is not stored in the cache:

calling the function included in the class to retrieve the requested data from the database;

storing the requested data in the cache; and

returning the requested data in response to the request.

8. The computer-readable medium of claim 7 , wherein the operations further comprise:

in response to the function being modified such that a manner in which data is retrieved has changed, invalidating data in the cache that is associated with calling the function prior to the function having been modified.

9. The computer-readable medium of claim 7 , wherein the operations further comprise:

after determining that the requested data is stored in the cache, calling another function included in the class to determine whether the requested data has become stale; and

in response to determining that the requested data has not become stale, returning the requested data in response to the request.

10. The computer-readable medium of claim 7 , wherein the received request includes a set of values usable to retrieve the requested data from the database, and wherein the operations further comprise:

deriving a key based on performing a hash of the set of values, wherein the requested data is stored in the cache in association with the derived key.

11. The computer-readable medium of claim 10 , wherein data is stored in the cache based on a key-value pair scheme, wherein the determining whether the requested data is stored in the cache includes:

determining whether the requested data is stored in association with the derived key.

12. The computer-readable medium of claim 7 , wherein the operations further comprise:

prior to receiving the request from the application and in response to determining that data is to be stored in association with the class, requesting that a definition be provided for the function.

13. A method, comprising:

in response to determining that a class of an application is to store data in an in-memory cache, a computer system requesting a function executable to provide values to be stored in the in-memory cache;

verifying, by the computer system, that the class of the application includes the function in response to receiving a first request to execute the application;

receiving, by the computer system, a second request for a value from the in-memory cache, wherein the second request specifies the class of the application;

determining, by the computer system, whether the in-memory cache stores the value;

in response to determining that the in-memory cache does not store the value:

calling, by the computer system, the function of the class to access the value;

receiving, by the computer system, the value returned by execution of the function;

storing, by the computer system, the value in the in-memory cache; and

returning, by the computer system, the value in response to the second request.

14. The method of claim 13 , wherein the second request specifies a set of variables usable to access the value, and the method further comprising:

generating, by the computer system, a key used to store the value in the in-memory cache based on a hash of the set of variables, wherein the key specifies a first version associated with the class.

15. The method of claim 14 , further comprising:

in response to the class being updated to a second version, the computer system invalidating values in the in-memory cache that correspond to keys specifying the first version.

16. The method of claim 13 , further comprising:

calling, by the computer system, an additional function to determine values in the in-memory cache that have become stale; and

invalidating, by the computer system, the determined values.

17. The method of claim 13 , further comprising:

calling, by the computer system, an additional function to determine a value in the in-memory cache to be replaced by the received value; and

storing, by the computer system, the received value in place of the determined value in the in-memory cache.

18. The method of claim 13 , wherein the determining that a class of an application is to store data in the in-memory cache is based on the class implementing an interface having a signature for the function.

Assignments (3)
CHANGE OF NAME Recorded Nov 21, 2024
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 069431/0247 →
CORRECTIVE ASSIGNMENT TO CORRECT THE SPELLING OF THE THIRD ASSIGNOR'S NAME PREVIOUSLY RECORDED ON REEL 044138 FRAME 0156. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jun 5, 2018
From: HUA, JIMMY; SOINI, ALEJANDRO; WALL, CHRISTOPHER; SMALL, MATTHEW; ADVANI, RAJ; ZHAO, SHUMIN; TAN, WEIPING
To: SALESFORCE.COM, INC.
Reel/Frame 046296/0036 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 15, 2017
From: HUA, JIMMY; SOINI, ALEJANDRO; WALL, CHRIS; SMALL, MATTHEW; ADVANI, RAJ; ZHAO, SHUMIN; TAN, WEIPING
To: SALESFORCE.COM, INC.
Reel/Frame 044138/0156 →
Continuity (1)
Related Publication 20190146920A1 · May 16, 2019
Cited By (1)
US 12,474,980