IP Library › Granted Patent US 12,493,607
Granted Patent B2
US 12,493,607 · App. 17/327,397 · Granted Dec 9, 2025

Distributed transaction execution in distributed databases

Inventors: Graham Timothy Pople (Manchester, GB); Brett Phillip James Lawson (Surrey, CA); Matthew William Ingenthron (Huntington Beach, CA); David John Finlay (Mountain View, CA); Shivani Gupta (Irvine, CA); John Sae Liang (Palo Alto, CA); Stephen Ching-Sing Yen (Atherton, CA)
Assignee: Couchbase, Inc.
G06F16/2379G06F9/547G06F16/215G06F16/27
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 12,493,607
App. No.
17/327,397
Granted
Dec 9, 2025
Kind
B2
Abstract

Client systems of a distributed database system execute transactions on data stored within the distributed database system. The client systems communicate directly with database nodes of the distributed database system in order to execute transactions. The client systems interact with the database nodes of the distributed database system via a client-side interface that performs various operations to execute transactions at the distributed database nodes, including retrieving records, staging mutations or insertions, committing mutations or insertions, or rolling back mutations or insertions on records stored on the distributed database nodes. Interactions between the client-side interface and the database nodes of the distributed database system are further configured to prevent conflicts between different transactions executed by one or more client systems at the database nodes.

Claims (98)

1 . A non-transitory computer-readable storage medium for storing instructions that when executed by a client computing device cause the client computing device to perform steps comprising:

receiving, by an application programming interface (API) of the client computing device, a function representing a transaction, causing the transaction to be executed at a database node of a plurality of database nodes of a distributed database system, the transaction describing a modification of data in a record at the database node, wherein each of the plurality of database nodes stores the record persistently;

executing, by the client computing device, the function, wherein executing the function comprises:

retrieving the record and a virtual attribute associated with the record from the database node, a value of the virtual attribute indicating whether the record is being modified by another transaction;

determining whether there is a conflicting stage of data associated with the record based on the value of the virtual attribute, wherein the conflicting stage of data comprises a modified record temporarily stored at one of the plurality of database nodes;

responsive to a determination, by the client computing device, that there is no conflicting stage of data associated with the record, executing a first set of API instructions configured to stage new data for storage in the record at the database node,

wherein staging new data comprising causing the database node to change the value of the virtual attribute of the record to a new value indicating that the record is being modified by the transaction, and temporarily storing new data of the record at the database node, and wherein the first set of API instructions includes an instruction for staging an insertion in a hidden record at the database node,

wherein the hidden record is not visible to other database nodes that request for executing transaction,

wherein the hidden record is only accessible to an entity having information that particularly identifies the hidden record, and

wherein the hidden record becomes visible after a state of the transaction changes to a committed state;

responsive to receiving, from the database node, a first indication, indicating that staging of the new data is allowed or successfully completed, executing a second set of API instructions configured to commit the staged new data to the record at database node responsive to receiving an indication that the new data was successfully staged from the distributed database system, wherein committing the staged new data causes the new data to be persistently stored at each of the plurality of database nodes; and

responsive to receiving, from the database node, a second indication, indicating that staging of the new data is not allowed or not successfully completed, executing a third set of API instructions configured to rollback execution of the first set of API instructions.

2 . The computer-readable storage medium of claim 1 , wherein executing the function further comprises:

executing a custom set of instructions configured to process an intermediate result of the execution of the transaction by the API.

3 . The computer-readable storage medium of claim 2 , wherein the function is provided to the API by an application of the client computing device, and wherein the custom set of instructions is further configured to provide the intermediate result to a component of the application.

4 . The computer-readable storage medium of claim 1 , wherein the data for storage in the record corresponds to a mutation, and wherein the first set of API instructions is further configured to:

stage the mutation in a set of virtual attributes of the record at the database node.

5 . The computer-readable storage medium of claim 4 , wherein the data for storage in the record corresponds to a mutation, and wherein the first set of API instructions is further configured to:

identify a check-and-set (CAS) value corresponding to the record; and

stage the mutation in the set of virtual attributes using the CAS value.

6 . The computer-readable storage medium of claim 4 , wherein:

the second set of API instructions is further configured to update the record to persistently reflect the mutation staged in the set of virtual attributes; and

the third set of API instructions is further configured to remove the staged mutation from the set of virtual attributes.

7 . The computer-readable storage medium of claim 1 , wherein:

the second set of API instructions is further configured to convert the hidden record to a non-hidden record at the database node; and

the third set of API instructions is further configured to remove the hidden record from the database node.

8 . The computer-readable storage medium of claim 1 , wherein one or more of the first, second, or third set of API instructions is further configured to use a universally unique identifier (UUID) assigned to the transaction.

9 . The computer-readable storage medium of claim 1 , wherein function is configured to:

after rolling back execution of the transaction at the database node, determining that the transaction has not expired; and

re-executing the transaction at the database node using the first set of API instructions.

10 . The computer-readable storage medium of claim 1 , wherein one or more of the first, second, or third sets of API instructions are further configured to:

generate an active transaction record (ATR) entry for the transaction in an ATR on the distributed database system, the ATR accessible to other client computing devices of the distributed database system, the ATR entry indicating the transaction is in a pre-commit state;

responsive to receiving an indication that the modification was successfully staged from the distributed database system:

modify the ATR entry to indicate the transaction is in a post-commit state; and

after committing the staged data to the record at the database node, modify the ATR entry to indicate the transaction is in a completed state; and

responsive to receiving an indication that the data was not successfully staged from the distributed database system, modify the ATR entry to indicate the transaction is in an aborted state.

11 . A non-transitory computer readable storage medium for storing instructions that when executed by a client computing device cause the client computing device to perform steps comprising:

executing a transaction at a database node of a plurality of database nodes of a distributed database system, wherein the executing comprises:

receiving, from a second client computing device, a request for a transaction describing a modification of a record stored at the database node, each of the plurality of database nodes stores the record persistently;

generating an active transaction record (ATR) entry for the transaction in an ATR on the distributed database system, causing the ATR to be temporarily stored with the record at the database node, the ATR accessible to other client computing devices of the distributed database system, the ATR entry indicating whether the transaction is in a pre-commit state, the pre-commit state indicating that the record is not being modified by another transaction, as such there is no conflicting stage of data;

transmitting the record and the ATR to the second client computing device, causing the second client computing device to determine whether there is a conflicting stage of data in the record based on the ATR entry;

responsive to determining that there is no conflicting stage of data in the record,

receiving a request from the second client computing device to stage data in the record;

 staging the data for storage in the record at the database node, wherein staging data comprises temporarily storing new data of the record at the database node,

wherein staging the data for storage in the record at the database node includes staging an insertion in a hidden record at the database node,

wherein the hidden record is not visible to other database nodes that request for executing transaction,

wherein the hidden record is only accessible to an entity having information that particularly identifies the hidden record, and

wherein the hidden record becomes visible after a state of the transaction changes to a committed state;

modifying the ATR entry to indicate the transaction is in a post-commit state, the post-commit state indicating that the record is being modified by the transaction, and there is a conflicting stage of data against another transaction that attempts to modify the record; and

committing the staged data to the record at the database node, wherein committing the staged data causes the new data to be persistently stored at each of the plurality of database node; and

responsive to determining that there is a conflicting stage of data in the record, rejecting the request for the transaction.

12 . The computer readable storage medium of claim 11 , wherein the transaction describes a mutation of an existing record stored at the database node, and wherein executing the transaction further comprises:

during the pre-commit state of the transaction, staging the mutation of the existing record at the database node in a set of virtual attributes of the existing record; and

during the post-commit state of the transaction, updating the record to persistently reflect the mutation staged in the set of virtual attributes.

13 . The computer readable storage medium of claim 12 , wherein staging the mutation further comprises:

determining, by the client computing device, a first CAS value corresponding to a current CAS value of the existing record;

requesting that the database node stages the mutation using the first CAS value; and

responsive to the first CAS value matching the current CAS value for the existing record, receiving confirmation that the mutation was successfully staged.

14 . The computer readable storage medium of claim 11 , wherein the transaction describes an insertion of a new record for storage at the database node, and wherein executing the transaction further comprises:

during the pre-commit state of the transaction, staging the insertion in a hidden record stored on the database node; and

during the post-commit state of the transaction, converting the hidden record to a non-hidden record.

15 . The computer readable storage medium of claim 11 , wherein the steps further comprise:

receiving, by the client computing device, a request for an additional record stored at an additional database node of a plurality of database nodes of the distributed database system;

retrieving, by the client computing system, the additional record stored at the additional database node;

identifying, by the client computing system, staged data for the additional record corresponding to an additional transaction executed by an additional client computing device;

responsive to identifying the staged data for the additional record, accessing, by the client computing device, an additional ATR entry for the additional transaction;

responsive to determining that the additional transaction is in a pre-commit state based on the ATR entry, providing data stored in a body of the record in a response to the request; and

responsive to determining that the additional transaction is in a post-commit state based on the ATR entry, providing the staged data for the additional record in response to the request.

16 . The computer readable storage medium of claim 11 , wherein the ATR is stored on the database node.

17 . The computer readable storage medium of claim 11 , wherein the transaction describes additional data for storage in an additional record at an additional database node of the plurality of database nodes, and wherein committing the staged data to the record at the database node comprises:

during the pre-commit state of the transaction, staging the additional data for storage in the additional record at the additional database node; and

during the post-commit state of the transaction:

after committing the staged data to the record, preventing committing of the additional staged data while the distributed database has not achieved a threshold level of durability for the committed staged data; and

after the distributed database achieves the threshold level of durability, committing the additional staged data.

18 . The computer readable storage medium of claim 11 , wherein the steps further comprise:

executing, by the client computing device, an additional transaction at an additional database node of the plurality of database nodes of the distributed database system, the additional transaction describing additional data for storage in an additional record at the additional database node;

before completing execution of the additional transaction, determining that the transaction has expired; and

re-executing the additional transaction.

19 . The computer readable storage medium of claim 11 , further comprising:

after committing the staged data to the record at the database node, modifying the ATR entry to indicate the transaction is in a completed state.

20 . A computing system, comprising:

one or more processors; and

non-transitory computer readable storage medium for storing instructions that when executed by a client computing device cause the client computing device to perform steps comprising:

executing a transaction at a database node of a plurality of database nodes of a distributed database system, wherein the executing comprises:

receiving, from a second client computing device, a request for a transaction describing a modification of a record stored at the database node, each of the plurality of database nodes stores the record persistently;

generating an active transaction record (ATR) entry for the transaction in an ATR on the distributed database system, causing the ATR to be temporarily stored with the record at the database node, the ATR accessible to other client computing devices of the distributed database system, the ATR entry indicating whether the transaction is in a pre-commit state, the pre-commit state indicating that the record is not being modified by another transaction, as such there is no conflicting stage of data;

transmitting the record and the ATR to the second client computing device, causing the second client computing device to determine whether there is a conflicting stage of data in the record based on the ATR entry;

responsive to determining that there is no conflicting stage of data in the record,

receiving a request from the second client computing device to stage data in the record;

 staging the data for storage in the record at the database node,

 wherein staging data comprises temporarily storing new data of the record at the database node,

 wherein staging the data for storage in the record at the database node includes staging an insertion in a hidden record at the database node,

 wherein the hidden record is not visible to other database nodes that request for executing transaction,

 wherein the hidden record is only accessible to an entity having information that particularly identifies the hidden record, and

 wherein the hidden record becomes visible after a state of the transaction changes to a committed state;

 modifying the ATR entry to indicate the transaction is in a post-commit state, the post-commit state indicating that the record is being modified by the transaction, and there is a conflicting stage of data against another transaction that attempts to modify the record; and

 committing the staged data to the record at the database node, wherein committing the staged data causes the new data to be persistently stored at each of the plurality of database node; and

responsive to determining that there is a conflicting stage of data in the record, rejecting the request for the transaction.

Assignments (2)
GRANT OF SECURITY INTEREST IN PATENTS Recorded Sep 25, 2025
From: COUCHBASE, INC.
To: APOLLO ADMINISTRATIVE AGENCY LLC, AS COLLATERAL AGENT
Reel/Frame 072925/0610 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 15, 2023
From: POPLE, GRAHAM TIMOTHY; LAWSON, BRETT PHILLIP JAMES; INGENTHRON, MATTHEW WILLIAM; FINLAY, DAVID JOHN; GUPTA, SHIVANI; LIANG, JOHN SAE; YEN, STEPHEN CHING-SING
To: COUCHBASE, INC.
Reel/Frame 063967/0330 →
Continuity (2)
Provisional Application 63029325 · May 22, 2020
Related Publication 20210365439A1 · Nov 25, 2021
References Cited (56)
US 6314417B1 · Bennett et al. · 2001 [cited by applicant]
US 6397228B1 · Lamburt et al. · 2002 [cited by applicant]
US 7689565B1 · Gandhi · 2010 [cited by examiner]
US 9760571B1 · Ben-Natan et al. · 2017 [cited by applicant]
US 10489356B1 · Shah · 2019 [cited by examiner]
US 10983981B1 · Sharma et al. · 2021 [cited by applicant]
US 11144275B1 · Hinckley et al. · 2021 [cited by applicant]
US 11397750B1 · Lekakis · 2022 [cited by examiner]
US 12032560B2 · People et al. · 2024 [cited by applicant]
US 20050190949A1 · Weber · 2005 [cited by applicant]
US 20070239661A1 · Cattell et al. · 2007 [cited by applicant]
US 20080120304A1 · Calio · 2008 [cited by examiner]
US 20100138407A1 · Fraser et al. · 2010 [cited by applicant]
US 20100180257A1 · Dern · 2010 [cited by applicant]
US 20120102377A1 · Viswanathan et al. · 2012 [cited by applicant]
US 20120124563A1 · Chung et al. · 2012 [cited by applicant]
US 20130006950A1 · Adayilamuriyil et al. · 2013 [cited by applicant]
US 20130339960A1 · Greiner et al. · 2013 [cited by applicant]
US 20140379693A1 · May et al. · 2014 [cited by applicant]
US 20160055261A1 · Reinhardt et al. · 2016 [cited by applicant]
US 20160110403A1 · Lomet et al. · 2016 [cited by applicant]
US 20160378820A1 · Marcotte · 2016 [cited by examiner]
US 20170031990A1 · Chakkappen et al. · 2017 [cited by applicant]
US 20170161352A1 · Horii · 2017 [cited by applicant]
US 20170177697A1 · Lee et al. · 2017 [cited by applicant]
US 20170220617A1 · Bortnikov · 2017 [cited by examiner]
US 20180095968A1 · Seki · 2018 [cited by applicant]
US 20180121492A1 · Sawhney · 2018 [cited by examiner]
US 20180165343A1 · Fan · 2018 [cited by examiner]
US 20180253452A1 · Callan · 2018 [cited by examiner]
US 20180349458A1 · Guirguis · 2018 [cited by examiner]
US 20190102416A1 · Zhang · 2019 [cited by examiner]
US 20190138743A1 · Nerurkar et al. · 2019 [cited by applicant]
US 20200160289A1 · Mahajan · 2020 [cited by examiner]
US 20200327146A1 · Hoeppner · 2020 [cited by examiner]
US 20200327545A1 · Xie · 2020 [cited by applicant]
US 20200379999A1 · Xia et al. · 2020 [cited by applicant]
US 20200387496A1 · Holmes · 2020 [cited by examiner]
US 20210240498A1 · Padmanabhan · 2021 [cited by examiner]
US 20220019575A1 · Qian · 2022 [cited by applicant]
EP 3182300A1 · 2017 [cited by applicant]
WO WO2020113314A1 · 2020 [cited by examiner]
U.S. Appl. No. 16/788,923, filed Feb. 12, 2020, Inventor Bingjie Miao et al. [cited by applicant]
U.S. Appl. No. 63/029,325, filed May 22, 2020, Inventor Graham Timothy Pople et al. [cited by applicant]
Gottschlich, J.E. et al., “An Efficient Software Transactional Memory Using Commit-Time Invalidation,” Code Generation and Optimization, Apr. 2010, pp. 101-110. [cited by applicant]
Mayuram, R., “Couchbase Brings Multi-Document ACID Transactions to JSON Database,” Aug. 9, 2019, pp. 1-10, [Online] [Retrieved on Jun. 8, 2021] Retrieved from the Internet <URL: https://blog.couchbase.com/couchbase-brin… [cited by applicant]
PCT International Search Report and Written Opinion, PCT Application No. PCT/US2021/033795, Aug. 17, 2021, 17 pages. [cited by applicant]
PCT International Search Report and Written Opinion, PCT Application No. PCT/IB2021/057413, Nov. 9, 2021, 12 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/327,455, Nov. 10, 2022, 35 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/007,561, Apr. 1, 2022, 21 pages. [cited by applicant]
“Redis-transactions,” HEXH's Blog, Jul. 3, 2015, 11 pages, Retrieved from the internet <URL:http://dangxia.github.io/2015/07/03/redis/redis-transactions/ . [cited by applicant]
United States Office Action, U.S. Appl. No. 17/327,455, Jun. 2, 2023, 25 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 18/418,097, Aug. 15, 2024, 12 pages. [cited by applicant]
Gordo, A. et al., “Large-Scale Document Image Retrieval and Classification with Run-Length Histograms and Binary Embeddings,” Pattern Recognition, vol. 46, Dec. 19, 2012, pp. 1989-1905. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/711,982, Dec. 22, 2022, 8 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/007,561, Oct. 3, 2022, 17 pages. [cited by applicant]