# US 2021/0240687 A1 · Reducing requests using probabilistic data structures

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0240687 A1
- Document ID: US20210240687A1
- Status: Published application
- Kind: A1
- Application number: 16/777,870
- Filed: 2020-01-30
- Published: 2021-08-05
- Earliest claimed: 2020-01-30
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, inc.
- Inventors: Atish Agrawal; Jameison Bear Martin
- Web page: https://patentgrep.com/patent/US20210240687A1

## CPC

- G06F 16/2255: {Hash tables}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 12/0802: Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F 16/1734: {Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs}
- G06F 16/1865: {Transactional file systems}
- G06F 16/2246: {Trees, e.g. B+trees}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 16/908: using metadata automatically derived from the content
- H04L 9/3242: {involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC}
- G06F 2212/163: Server or database system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Techniques are disclosed relating to providing and using probabilistic data structures to at least reduce requests between database nodes. In various embodiments, a first database node processes a database transaction that involves writing a set of database records to an in-memory cache of the first database node. As part of processing the database transaction, the first database node may insert, in a set of probabilistic data structures, a set of database keys that correspond to the set of database records. The first database node may send, to a second database node, the set of probabilistic data structures to enable the second database node to determine whether to request, from the first database node, a database record associated with a database key.

## Claims

### Claim 1

A method, comprising:
processing, by a first database node, a database transaction that involves writing a set of database records to an in-memory cache of the first database node, wherein the processing includes inserting, in a set of probabilistic data structures, a set of database keys that correspond to the set of database records; and
sending, by the first database node to a second database node, the set of probabilistic data structures to enable the second database node to determine whether to request, from the first database node, a database record associated with a database key.

### Claim 2 (depends on 1)

The method of claim 1, wherein inserting a given one of the set of database keys in a given one of the set of probabilistic data structures includes:
applying, by the first database node, a hash function to the given database key to derive a hash value corresponding to particular one of a plurality of cache lines included in the given probabilistic data structure; and
inserting, by the first database node, the given database key in the particular cache line of the given probabilistic data structure.

### Claim 3 (depends on 2)

The method of claim 2, wherein inserting the given database key in the particular cache line of the given probabilistic data structure includes:
applying, by the first database node, a set of hash functions to the given database key to derive a set of hash values; and
setting, by the first database node, a set of bits of the particular cache line based on the set of hash values.

### Claim 4 (depends on 1)

The method of claim 1, wherein inserting the set of database keys includes:
inserting, by the first database node, ones of the set of database keys in a first one of the set of probabilistic data structures; and
in response to the first probabilistic data structure including a defined threshold number of database keys, the first database node inserting remaining ones of the set of database keys in a second, different one of the set of probabilistic data structures.

### Claim 5 (depends on 1)

The method of claim 1, wherein a given one of the set of probabilistic data structures is associated with metadata that indicates a number of active transactions for which database keys have been inserted in the given probabilistic data structure, wherein the method further comprises:
determining, by the first database node, whether the given probabilistic data structure can be purged based on whether the number of active transactions indicates that there are active transactions for the given probabilistic data structure.

### Claim 6 (depends on 5)

The method of claim 5, wherein at least two of the set of probabilistic data structures each include a respective database key inserted as part of processing the database transaction, and wherein the method further comprises:
in response to committing the database transaction in relation to the in-memory cache, the first database node decrementing, for each of the at least two probabilistic data structures, the number of active transactions associated with that probabilistic data structure.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
subsequent to sending the set of probabilistic data structures to the second database node, the first database node adding one or more additional probabilistic data structures to the set of probabilistic data structures;
receiving, by the first database node from the second database node, a database record request for a most recent version of a database record associated with a particular database key; and
including, by the first database node in a response to the database record request, the one or more additional probabilistic data structures.

### Claim 8 (depends on 7)

The method of claim 7, wherein a given one of the set of probabilistic data structures is associated with metadata that indicates a latest transaction commit corresponding to the given probabilistic data structure, wherein the method further comprises:
prior to the including, the first database node determining to include the one or more additional probabilistic data structures based on each of the one or more additional probabilistic data structures being associated with a respective latest transaction commit that corresponds to a later point in time than a particular transaction commit that is specified in the database record request.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
writing, by the first database node, one or more of the set of database records from the in-memory cache to a persistent storage shared between the first and second database nodes; and
in response to the writing, the first database node determining whether to purge a given one of the set of probabilistic data structures.

### Claim 10 (depends on 1)

The method of claim 1, wherein at least one of the set of probabilistic data structures is associated with database keys from a plurality of different transactions.

### Claim 11

A non-transitory computer readable medium having program instructions stored thereon that are capable of causing a first computer system to perform operations comprising:
processing a database transaction that involves writing a set of database records to an in-memory cache of the first computer system, wherein the processing includes inserting, into a set of probabilistic data structures, a set of database keys that correspond to the set of database records; and
sending, to a second computer system, the set of probabilistic data structures to enable the second computer system to determine whether to request, from the first computer system, a database record associated with a particular database key.

### Claim 12 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein inserting a given one of the set of database keys in a given one of the set of probabilistic data structures includes:
applying a hash function to the given database key to derive a hash value;
selecting one of a plurality of cache liens of the given probabilistic data structure based on the hash value; and
inserting the given database key in the selected cache line.

### Claim 13 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein inserting the set of database keys in the set of probabilistic data structures includes:
inserting ones of the set of database keys in a first one of the set of probabilistic data structures capable of including at least a threshold number of database keys; and
inserting other ones of the set of database keys in a second one of the set of probabilistic data structures subsequent to the threshold number being reached for the first probabilistic data structure.

### Claim 14 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein a particular one of the set of probabilistic data structures includes metadata specifying an active transaction count that indicates a number of active transactions for which database keys have been inserted in the particular probabilistic data structure, wherein processing the database transaction involves inserting at least one database key in the particular probabilistic data structure, and wherein the operations further comprise:
decrementing the active transaction count of the particular probabilistic data structure in response to committing the database transaction.

### Claim 15 (depends on 11)

The non-transitory computer readable medium of claim 11, wherein the operations further comprise:
writing the set of database records from the in-memory cache of the first computer system to a persistent storage shared between the first and second computer systems and
in response to writing the set of database records to the persistent storage, determining whether to purge one or more of the set of probabilistic data structures.

### Claim 16

A method, comprising:
receiving, by a first database node from a second database node, a set of probabilistic data structures that is usable to determine whether a given database record is not stored within an in-memory cache of the second database node;
receiving, by the first database node, a request to process a database transaction that involves a particular database key; and
determining, by the first database node based on the set of probabilistic data structures, whether to request, from the second database node, a most recent version of a database record that is associated with the particular database key.

### Claim 17 (depends on 16)

The method of claim 16, wherein a given one of the set of probabilistic data structures includes a plurality of cache lines, and wherein the determining includes:
applying, by the first database node, a hash function to the particular database key to derive a hash value;
based on the hash value, the first database node selecting one of the plurality of cache lines of the given probabilistic data structure; and
determining, by the first database node, whether information stored in the cache line is indicative of the particular database key.

### Claim 18 (depends on 17)

The method of claim 17, further comprising:
in response to determining that the information stored in the cache line is not indicative of the particular database key, the first database node requesting the most recent version of the database record from a persistent storage shared by the first and second database nodes.

### Claim 19 (depends on 17)

The method of claim 17, further comprising:
in response to determining that the information stored in the cache line is indicative of the particular database key, the first database node sending a request to the second database node for the most recent version of the database record; and
receiving, by the first database node, a response from the second database node.

### Claim 20 (depends on 19)

The method of claim 19, wherein the request identifies a latest transaction commit associated with the set of probabilistic data structures, and wherein the response includes a set of additional probabilistic data structures, each of which is associated with a latest transaction commit occurring later than the latest transaction commit identified by the request.
