IP Library › Granted Patent US 12,298,966
Granted Patent B2
US 12,298,966 · App. 18/418,097 · Granted May 13, 2025

Distributed transaction execution management 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)
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,298,966
App. No.
18/418,097
Granted
May 13, 2025
Kind
B2
Abstract

A distributed database system for handling transactions from multiple client systems. A database node receives a request to execute a transaction from a first client, involving a record modification. This record has an associated check-and-set (CAS) value that changes with modifications. The record is sent to the first client, which identifies the CAS value. Similarly, a second client sends a request for another transaction, receives the record, and identifies the CAS value. One of these clients attempts to stage a mutation based on their transaction. This includes sending the previously received CAS value. The system checks for a CAS value mismatch, indicating a conflicting mutation from another transaction. If a mismatch is detected, the transaction attempt is aborted to prevent conflicts. Otherwise, the mutation is staged, and the CAS value is updated.

Claims (80)

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

receiving a first request to execute a first transaction from a first client system at a database node of a distributed database system, the transaction describing a mutation of a record stored at the database node, wherein the record is associated with a check-and-set (CAS) value that is updated responsive to modifications to the record;

retrieving the record from the database node and sending the record to the first client system, causing the first client system to identify the CAS value from the received record;

receiving a second request to execute a second transaction from a second client system at the database node of the distributed database system;

retrieving the record from the database node and sending the record to the second client system, causing the second client system to identify the CAS value from the received record;

receiving a request from the first client system or the second client to attempt to stage a first mutation of the record based on the first transaction or a second mutation of the record based on the second transaction, the request comprising the CAS value received by the first client system or the second client system;

detecting whether a mismatch between the CAS value received with the request and a current CAS value of the record is present, the mismatch indicating that an additional mutation corresponding to an additional transaction has been staged for the record at the database node, the additional mutation conflicting with the first mutation or the second mutation corresponding to the request received from the first client system or the second client system;

responsive to detecting the mismatch, aborting the attempt to execute the first transaction or the second transaction corresponding to the request received from the first client system or the second client system; and

responsive to detecting no mismatch,

staging the first mutation or the second mutation corresponding to the request received from the first client system or the second client system; and

causing the CAS value associated with the record to be updated to a different CAS value.

2. The non-transitory computer-readable storage medium of claim 1 , wherein aborting execution of the transaction comprises:

modifying an active transaction record (ATR) entry for the transaction in an ATR on the distributed database system to indicate the transaction is in an aborted state.

3. The non-transitory computer-readable storage medium of claim 1 , wherein staging the first mutation or the second mutation comprises:

modifying active transaction record (ATR) entry for the transaction in an ATR on the distributed database system to indicate the transaction is in a changing state.

4. The non-transitory computer-readable storage medium of claim 1 , wherein the CAS value is stored with the record at the database node.

5. The non-transitory computer-readable storage medium of claim 1 , wherein the distributed database system comprises a second database node, and the steps further comprise:

receiving a third request to execute a third transaction from a third client system at the second database node of the distributed database system;

retrieving the from the second database node and sending the record to the third client system, causing the third client system to identify the CAS value from the received record;

receiving a request from the third client system to attempt to stage a third mutation of the record based on the third transaction, the request comprising the CAS value received by the third client system;

detecting whether a mismatch between the CAS value received with the request and a current CAS value of the record is present, the mismatch indicating that an additional mutation corresponding to an additional transaction has been staged for the record at the database node, the additional mutation conflicting with the first mutation or the second mutation corresponding to the request received from the first client system or the second client system;

responsive to detecting the mismatch, aborting the attempt to execute the third transaction;

responsive to detecting no mismatch,

staging the third mutation; and

causing the CAS value associated with the record to be updated to a different CAS value.

6. The non-transitory computer-readable storage medium of claim 1 , wherein aborting the attempt further comprises rolling back the attempt to execute the first transaction or the second transaction corresponding to the received request.

7. The non-transitory computer-readable storage medium of claim 6 , wherein staging the first mutation or the second mutation comprises generating a hidden record on the database node, and wherein rolling back the attempt to execute the first transaction or the second transaction further comprises:

removing the hidden record from the database node.

8. The non-transitory computer-readable storage medium of claim 1 , wherein the steps further comprise:

after aborting the attempt to execute the transaction, determining if the transaction has not expired; and

responsive to determining the transaction has not expired, reattempting to execute the transaction at the database node.

9. The non-transitory computer-readable storage medium of claim 8 , wherein reattempting to execute the transaction comprises:

delaying the reattempt to execute that transaction by a randomized time period.

10. The non-transitory computer-readable storage medium of claim 8 , wherein reattempting comprises reattempting for a threshold number of times.

11. A computing system comprising:

one or more processors; and

a non-transitory computer-readable storage medium for storing instructions that when executed by the one or more processors cause the one or more processors to perform steps comprising:

receiving a first request to execute a first transaction from a first client system at a database node of a distributed database system, the transaction describing a mutation of a record stored at the database node, wherein the record is associated with a check-and-set (CAS) value that is updated responsive to modifications to the record;

retrieving the record from the database node and sending the record to the first client system, causing the first client system to identify the CAS value from the received record;

receiving a second request to execute a second transaction from a second client system at the database node of the distributed database system;

retrieving the record from the database node and sending the record to the second client system, causing the second client system to identify the CAS value from the received record;

receiving a request from the first client system or the second client to attempt to stage a first mutation of the record based on the first transaction or a second mutation of the record based on the second transaction, the request comprising the CAS value received by the first client system or the second client system;

detecting whether a mismatch between the CAS value received with the request and a current CAS value of the record is present, the mismatch indicating that an additional mutation corresponding to an additional transaction has been staged for the record at the database node, the additional mutation conflicting with the first mutation or the second mutation corresponding to the request received from the first client system or the second client system;

responsive to detecting the mismatch, aborting the attempt to execute the first transaction or the second transaction corresponding to the request received from the first client system or the second client system; and

responsive to detecting no mismatch,

staging the first mutation or the second mutation corresponding to the request received from the first client system or the second client system; and

causing the CAS value associated with the record to be updated to a different CAS value.

12. The computing system of claim 11 , wherein aborting execution of the transaction comprises:

modifying an active transaction record (ATR) entry for the transaction in an ATR on the distributed database system to indicate the transaction is in an aborted state.

13. The computing system of claim 11 , wherein staging the first mutation or the second mutation comprises:

modifying active transaction record (ATR) entry for the transaction in an ATR on the distributed database system to indicate the transaction is in a changing state.

14. The computing system of claim 13 , wherein the CAS value is stored with the record at the database node.

15. The computing system of claim 11 , wherein the distributed database system comprises a second database node, and the steps further comprises:

receiving a third request to execute a third transaction from a third client system at the second database node of the distributed database system;

retrieving the from the second database node and sending the record to the third client system, causing the third client system to identify the CAS value from the received record;

receiving a request from the third client system to attempt to stage a third mutation of the record based on the third transaction, the request comprising the CAS value received by the third client system;

detecting whether a mismatch between the CAS value received with the request and a current CAS value of the record is present, the mismatch indicating that an additional mutation corresponding to an additional transaction has been staged for the record at the database node, the additional mutation conflicting with the first mutation or the second mutation corresponding to the request received from the first client system or the second client system;

responsive to detecting the mismatch, aborting the attempt to execute the third transaction;

responsive to detecting no mismatch,

staging the third mutation; and

causing the CAS value associated with the record to be updated to a different CAS value.

16. The computing system of claim 11 , wherein aborting the attempt further comprises rolling back the attempt to execute the first transaction or the second transaction corresponding to the received request.

17. The computing system of claim 11 , wherein staging the first mutation or the second mutation comprises generating a hidden record on the database node, and wherein rolling back the attempt to execute the first transaction or the second transaction further comprises:

removing the hidden record from the database node.

18. The computing system of claim 11 , wherein the steps further comprise:

after aborting the attempt to execute the transaction, determining if the transaction has not expired; and

responsive to determining the transaction has not expired, reattempting to execute the transaction at the database node.

19. The computing system of claim 11 , wherein reattempting to execute the transaction comprises:

delaying the reattempt to execute that transaction by a randomized time period.

20. A method comprising:

receiving a first request to execute a first transaction from a first client system at a database node of a distributed database system, the transaction describing a mutation of a record stored at the database node, wherein the record is associated with a check-and-set (CAS) value that is updated responsive to modifications to the record;

retrieving the record from the database node and sending the record to the first client system, causing the first client system to identify the CAS value from the received record;

receiving a second request to execute a second transaction from a second client system at the database node of the distributed database system;

retrieving the record from the database node and sending the record to the second client system, causing the second client system to identify the CAS value from the received record;

receiving a request from the first client system or the second client to attempt to stage a first mutation of the record based on the first transaction or a second mutation of the record based on the second transaction, the request comprising the CAS value received by the first client system or the second client system;

detecting whether a mismatch between the CAS value received with the request and a current CAS value of the record is present, the mismatch indicating that an additional mutation corresponding to an additional transaction has been staged for the record at the database node, the additional mutation conflicting with the first mutation or the second mutation corresponding to the request received from the first client system or the second client system;

responsive to detecting the mismatch, aborting the attempt to execute the first transaction or the second transaction corresponding to the request received from the first client system or the second client system; and

responsive to detecting no mismatch,

staging the first mutation or the second mutation corresponding to the request received from the first client system or the second client system; and

causing the CAS value associated with the record to be updated to a different CAS value.

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 Jan 14, 2025
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 069862/0793 →
Continuity (3)
Continuation 17327455 · May 21, 2021
Provisional Application 63029325 · May 22, 2020
Related Publication 20240160624A1 · May 16, 2024
References Cited (58)
US 6314417B1 · Bennett et al. · 2001 [cited by applicant]
US 6397228B1 · Lamburt et al. · 2002 [cited by applicant]
US 7689565B1 · Gandhi et al. · 2010 [cited by applicant]
US 9760571B1 · Ben-Natan et al. · 2017 [cited by applicant]
US 10489356B1 · Shah et al. · 2019 [cited by applicant]
US 10983981B1 · Sharma et al. · 2021 [cited by applicant]
US 11144275B1 · Hinckley et al. · 2021 [cited by applicant]
US 11294896B2 · Miao et al. · 2022 [cited by applicant]
US 11397750B1 · Lekakis et al. · 2022 [cited by applicant]
US 20050190949A1 · Weber · 2005 [cited by applicant]
US 20070239661A1 · Cattell et al. · 2007 [cited by applicant]
US 20080120304A1 · Calio et al. · 2008 [cited by applicant]
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 20120196615A1 · Edge · 2012 [cited by examiner]
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 applicant]
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 et al. · 2017 [cited by applicant]
US 20180095968A1 · Seki · 2018 [cited by applicant]
US 20180121492A1 · Sawhney · 2018 [cited by applicant]
US 20180165343A1 · Fan et al. · 2018 [cited by applicant]
US 20180253452A1 · Callan et al. · 2018 [cited by applicant]
US 20180349458A1 · Guirguis et al. · 2018 [cited by applicant]
US 20190102416A1 · Zhang et al. · 2019 [cited by applicant]
US 20190138743A1 · Nerurkar et al. · 2019 [cited by applicant]
US 20200160289A1 · Mahajan et al. · 2020 [cited by applicant]
US 20200327545A1 · Xie · 2020 [cited by applicant]
US 20200379999A1 · Xia et al. · 2020 [cited by applicant]
US 20200387496A1 · Holmes et al. · 2020 [cited by applicant]
US 20210240498A1 · Padmanabhan et al. · 2021 [cited by applicant]
US 20220019575A1 · Qian · 2022 [cited by applicant]
EP 3182300A1 · 2017 [cited by applicant]
WO WO2020113314A1 · 2020 [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/327,397, filed Nov. 7, 2023, 44 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/711,982, filed Dec. 22, 2022, 8 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/007,561, filed Apr. 1, 2022, 17 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/327,397, filed Mar. 27, 2024, 38 pages. [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/IB2021/057413, Nov. 9, 2021, 12 pages. [cited by applicant]
PCT International Search Report and Written Opinion, PCT Application No. PCT/US2021/033795, Aug. 17, 2021, 17 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/007,561, filed Apr. 1, 2022, 21 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/327,397, filed Aug. 17, 2022, 32 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/327,397, filed Mar. 3, 2023, 31 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/327,455, filed Jun. 2, 2023, 23 pages. [cited by applicant]
United States Office Action, U.S. Appl. No. 17/327,455, filed Nov. 10, 2022, 31 pages. [cited by applicant]
United States Patent Office, Office Action, U.S. Appl. No. 17/327,397, Sep. 30, 2024, 38 pages. [cited by applicant]