IP Library Granted Patent US 11,126,625
Granted Patent B2
US 11,126,625 · App. 16/428,562 · Granted Sep 21, 2021

Caching techniques for a database change stream

Inventors: Benjamin Busjaeger (San Carlos, CA); Michael Sgroi (San Francisco, CA)
Assignee: salesforce.com, inc.
G06F16/24552G06F16/2282G06F16/2358G06F16/24568
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 11,126,625
App. No.
16/428,562
Granted
Sep 21, 2021
Kind
B2
Abstract

Techniques are disclosed relating to caching techniques for processing a database change stream. A caching module of a computer system may receive change records from a change stream that includes a plurality of records indicating changes to a database table. The change stream may include change records for multiple shards and is accessible by providing one or more position indicators for one or more of the multiple shards to request one or more change records and an updated position indicator. The caching module may store, for changes to a set of one or more shards for which the caching module is configured, one or more cache entries that each include a group of change records up to a threshold group size. A change processor module of the computer system may request a portion of the change stream by providing a received position indicator. The change processor module may receive, from the caching module, one or more cached change records from a cache entry that matches the provided position indicator.

Claims (72)

1. A method, comprising:

receiving, by a caching module of a computer system, change records from a change stream, wherein the change stream includes a plurality of records that indicate changes to a database table;

wherein the change stream includes change records for multiple shards and wherein the change stream is accessible by providing one or more position indicators for one or more of the multiple shards to request one or more change records and an updated position indicator;

storing, by the caching module for changes to a set of one or more shards for which the caching module is configured, one or more cache entries that each include a group of change records up to a threshold group size;

requesting, by a change processor module of the computer system, a portion of the change stream, wherein the requesting includes providing a received position indicator; and

receiving, by the change processor module from the caching module, one or more cached change records from a cache entry that matches the provided position indicator.

2. The method of claim 1 , further comprising:

receiving, by a multi-tenant adapter module, tenant-based requests from the change processor module; and

converting, by the multi-tenant adapter module, the tenant-based requests to requests that are supported by a database system that maintains the database table, wherein the multi-tenant adapter module uses the database table to store fields for multiple different tenants.

3. The method of claim 2 , further comprising:

determining, by the computer system, multiple tenant checkpoints based on processing change records for multiple tenants;

determining, by the computer system, a combined checkpoint based on the multiple tenant checkpoints; and

storing the combined checkpoint.

4. The method of claim 1 , wherein the caching module and the change processor module are included in a stream process, wherein the method further comprises accessing the change stream using multiple different stream processes executed by the computer system.

5. The method of claim 1 , further comprising:

storing, by the computer system, an address for the change processor module in a lease table of a database system in association with one or more shards of the change stream handled by the change processor module, wherein the database system maintains the database table and the change stream; and

wherein the received position indicator is forwarded by another module based on the stored address.

6. The method of claim 1 , further comprising:

polling, by a polling module of the computer system, the change stream using a position indicator, wherein the position indicator includes shard identifiers for one or more shards in the change stream and a sequence number for each shard;

receiving, in response to the polling, one or more new change records and an updated position indicator; and

storing, by the caching module, the one or more new change records in one or more cache entries.

7. The method of claim 1 , wherein the match between the cache entry and the provided position indicator is based on a shard identifier and sequence number included in the position indicator, and wherein cache entries include a tag value with one or more shard identifiers and one or more sequence numbers corresponding to the one or more shard identifiers.

8. A non-transitory computer-readable medium having instructions stored thereon that are capable of execution by a computing device to perform operations comprising:

receiving, by a caching module, change records from a change stream, wherein the change stream includes a plurality of records that indicate changes to a database table;

wherein the change stream includes change records for multiple shards and wherein the change stream is accessible by providing one or more position indicators for one or more of the multiple shards to request one or more change records and an updated position indicator;

storing, by the caching module for changes to a set of one or more shards for which the caching module is configured, one or more cache entries that each include a group of change records up to a threshold group size;

requesting, by a change processor module, a portion of the change stream, wherein the requesting includes providing a received position indicator; and

receiving, by the change processor module from the caching module, one or more cached change records from a cache entry that matches the provided position indicator.

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

receiving, by a multi-tenant adapter module, tenant-based requests from the change processor module; and

converting, by the multi-tenant adapter module, the tenant-based requests to requests that are supported by a database system that maintains the database table, wherein the multi-tenant adapter module uses the database table to store fields for multiple different tenants.

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

determining multiple tenant checkpoints based on processing change records for multiple tenants;

determining a combined checkpoint based on the multiple tenant checkpoints; and

storing the combined checkpoint.

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

storing an address of the change processor module in a lease table of a database system in association with one or more shards of the change stream handled by the change processor module, wherein the database system maintains the database table and the change stream; and

wherein the received position indicator is forwarded by another module based on the stored address.

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

polling, by a polling module, the change stream using a position indicator, wherein the position indicator includes shard identifiers for one or more shards in the change stream and a sequence number for each shard;

receiving, in response to the polling, one or more new change records and an updated position indicator; and

storing, by the caching module, the one or more new change records in one or more cache entries.

13. The non-transitory computer-readable medium of claim 8 , wherein the match between the cache entry and the provided position indicator is based on a shard identifier and sequence number included in the position indicator, and wherein cache entries include a tag value with one or more shard identifiers and one or more sequence numbers corresponding to the one or more shard identifiers.

14. A system, comprising:

processor circuitry; and

one or more memories having instructions stored thereon that are capable of being executed by the processor circuitry;

wherein at least one of the processor circuitry and the one or more memories implement:

a caching module configured to:

receive change records from a change stream, wherein the change stream includes a plurality of records that indicate changes to a database table;

wherein the change stream includes change records for multiple shards and wherein the change stream is accessible by providing one or more position indicators for one or more of the multiple shards to request one or more change records and an updated position indicator;

store, for changes to a set of one or more shards for which the caching module is configured, one or more cache entries that each include a group of change records up to a threshold group size; and

a change processor module configured to:

request a portion of the change stream, wherein the requesting includes providing a received position indicator; and

receive, from the caching module, one or more cached change records from a cache entry that matches the provided position indicator.

15. The system of claim 14 , further comprising:

a multi-tenant adapter module configured to:

receive tenant-based requests from the change processor module; and

convert the tenant-based requests to requests that are supported by a database system that maintains the database table, wherein the multi-tenant adapter module uses the database table to store fields for multiple different tenants.

16. The system of claim 15 , wherein the system is further configured to:

determine multiple tenant checkpoints based on processing change records for multiple tenants;

determine a combined checkpoint based on the multiple tenant checkpoints; and

store the combined checkpoint.

17. The system of claim 14 , wherein the system is further configured to:

store an address of the change processor module in a lease table of a database system in association with one or more shards of the change stream handled by the change processor module, wherein the database system maintains the database table and the change stream; and

wherein the received position indicator is forwarded by another module based on the stored address.

18. The system of claim 14 , further comprising:

a polling module configured to:

poll the change stream using a position indicator, where the position indicator includes shard identifiers for one or more shards in the change stream and a sequence number for each shard; and

receive, in response to the polling, one or more new change records and an updated position indicator.

19. The system of claim 18 , wherein the caching module is further configured to:

store the one or more new change records in one or more cache entries.

20. The system of claim 14 , wherein the match between the cache entry and the provided position indicator is based on a shard identifier and sequence number included in the position indicator, and wherein cache entries include a tag value with one or more shard identifiers and one or more sequence numbers corresponding to the one or more shard identifiers.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 31, 2019
From: BUSJAEGER, BENJAMIN; SGROI, MICHAEL
To: SALESFORCE.COM, INC.
Reel/Frame 049338/0531 →
Continuity (1)
Related Publication 20200380000A1 · Dec 3, 2020