IP Library Granted Patent US 12,222,960
Granted Patent B2
US 12,222,960 · App. 18/326,683 · Granted Feb 11, 2025

Scalable compaction for a distributed database

Inventors: Chen Luo (San Mateo, CA); Alexander Miller (San Mateo, CA); William Waddington (Stateline, NV); Zhaohui Zhang (Redwood City, CA)
Assignee: Snowflake Inc.
G06F16/273G06F16/2343G06F16/2379
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,222,960
App. No.
18/326,683
Granted
Feb 11, 2025
Kind
B2
Abstract

The subject technology performs, using asynchronous threads of execution nodes of a distributed database, asynchronous transformation and compaction of key-value pairs of data that correspond to a plurality of transactional queries, the asynchronous threads transforming the key-value pairs from an initial format to a commit format that includes a commit time of data committed to the distributed database, the asynchronous threads compacting the key-value pairs by deleting the key-value pairs in the initial format. The subject technology processes, using transactional threads in the execution nodes, the plurality of transactional queries to generate results data, the asynchronous threads performing the asynchronous transformation and compaction while the transactional threads generate the results data. The subject technology stores the results data.

Claims (47)

1. A method comprising:

performing, using asynchronous threads of execution nodes of a distributed database, asynchronous transformation and compaction of key-value pairs of data that correspond to a plurality of transactional queries, the asynchronous threads transforming the key-value pairs from an initial format to a commit format that includes a commit time of data committed to the distributed database, the asynchronous threads compacting the key-value pairs by deleting the key-value pairs in the initial format;

processing, using transactional threads in the execution nodes, the plurality of transactional queries to generate results data, the asynchronous threads performing the asynchronous transformation and compaction while the transactional threads generate the results data; and

storing the results data.

2. The method of claim 1 , further comprising:

receiving a plurality of additional transactional queries against the distributed database;

processing, by the transactional threads, the plurality of additional transactional queries using the key-value pairs in the commit format, the transactional threads using commit times in the key-value pairs to generate additional results data; and storing the additional results data.

3. The method of claim 1 , wherein the distributed database comprises a transaction status table that indicates whether data of transactions has committed to the distributed database.

4. The method of claim 3 , wherein queries for data having key-value pairs in the initial format are executed by identifying transaction identifiers in the key-value pairs and access the transaction status table to determine commit statuses.

5. The method of claim 3 , further comprising: performing, using a dedicated compactor thread in one of the execution nodes, transformation and compaction of the key-value pairs from the initial format to the commit format.

6. The method of claim 5 , further comprising: performing, using the dedicated compactor thread, compaction of the transaction status table by deleting key-value pairs in the transaction status table that have corresponding key-value pairs in the commit format.

7. The method of claim 1 , wherein each key-value pair in the initial format includes a transaction identifier value.

8. The method of claim 7 , wherein the asynchronous threads perform transformation by rewriting each key-value pair such that the commit time replaces the transaction identifier value.

9. The method of claim 1 , wherein the key-value pairs having transaction identifiers are deleted by the asynchronous threads.

10. A system comprising:

one or more processors of a machine; and

a memory storing instructions that, when executed by the one or more processors, cause the machine to perform operations comprising:

performing, using asynchronous threads of execution nodes of a distributed database, asynchronous transformation and compaction of key-value pairs of data that correspond to a plurality of transactional queries, the asynchronous threads transforming the key-value pairs from an initial format to a commit format that includes a commit time of data committed to the distributed database, the asynchronous threads compacting the key-value pairs by deleting the key-value pairs in the initial format;

processing, using transactional threads in the execution nodes, the plurality of transactional queries to generate results data, the asynchronous threads performing the asynchronous transformation and compaction while the transactional threads generate the results data; and

storing the results data.

11. The system of claim 10 , wherein the operations further comprise:

receiving a plurality of additional transactional queries against the distributed database;

processing, by the transactional threads, the plurality of additional transactional queries using the key-value pairs in the commit format, the transactional threads using commit times in the key-value pairs to generate additional results data; and storing the additional results data.

12. The system of claim 10 , wherein the distributed database comprises a transaction status table that indicates whether data of transactions has committed to the distributed database.

13. The system of claim 12 , wherein queries for data having key-value pairs in the initial format are executed by identifying transaction identifiers in the key-value pairs and access the transaction status table to determine commit statuses.

14. The system of claim 12 , wherein the operations further comprise:

performing, using a dedicated compactor thread in one of the execution nodes, transformation and compaction of the key-value pairs from the initial format to the commit format.

15. The system of claim 14 , wherein the operations further comprise:

performing, using the dedicated compactor thread, compaction of the transaction status table by deleting key-value pairs in the transaction status table that have corresponding key-value pairs in the commit format.

16. The system of claim 10 , wherein each key-value pair in the initial format includes a transaction identifier value.

17. The system of claim 16 , wherein the asynchronous threads perform transformation by rewriting each key-value pair such that the commit time replaces the transaction identifier value.

18. The system of claim 10 , wherein the key-value pairs having transaction identifiers are deleted by the asynchronous threads.

19. A non-transitory machine storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:

performing, using asynchronous threads of execution nodes of a distributed database, asynchronous transformation and compaction of key-value pairs of data that correspond to a plurality of transactional queries, the asynchronous threads transforming the key-value pairs from an initial format to a commit format that includes a commit time of data committed to the distributed database, the asynchronous threads compacting the key-value pairs by deleting the key-value pairs in the initial format;

processing, using transactional threads in the execution nodes, the plurality of transactional queries to generate results data, the asynchronous threads performing the asynchronous transformation and compaction while the transactional threads generate the results data; and

storing the results data.

20. The non-transitory machine storage medium of claim 19 , wherein the operations further comprise:

receiving a plurality of additional transactional queries against the distributed database;

processing, by the transactional threads, the plurality of additional transactional queries using the key-value pairs in the commit format, the transactional threads using commit times in the key-value pairs to generate additional results data; and

storing the additional results data.

21. The non-transitory machine storage medium of claim 19 , wherein the distributed database comprises a transaction status table that indicates whether data of transactions has committed to the distributed database.

22. The non-transitory machine storage medium of claim 21 , wherein queries for data having key-value pairs in the initial format are executed by identifying transaction identifiers in the key-value pairs and access the transaction status table to determine commit statuses.

23. The non-transitory machine storage medium of claim 21 , wherein the operations further comprise: performing, using a dedicated compactor thread in one of the execution nodes, transformation and compaction of the key-value pairs from the initial format to the commit format.

24. The non-transitory machine storage medium of claim 23 , wherein the operations further comprise: performing, using the dedicated compactor thread, compaction of the transaction status table by deleting key-value pairs in the transaction status table that have corresponding key-value pairs in the commit format.

25. The non-transitory machine storage medium of claim 19 , wherein each key-value pair in the initial format includes a transaction identifier value.

26. The non-transitory machine storage medium of claim 25 , wherein the asynchronous threads perform transformation by rewriting each key-value pair such that the commit time replaces the transaction identifier value.

27. The non-transitory machine storage medium of claim 19 , wherein the key-value pairs having transaction identifiers are deleted by the asynchronous threads.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 31, 2023
From: LUO, CHEN; MILLER, ALEXANDER; WADDINGTON, WILLIAM; ZHANG, ZHAOHUI
To: SNOWFLAKE INC.
Reel/Frame 063813/0564 →
Continuity (3)
Continuation 17463353 · Aug 31, 2021
Provisional Application 63233097 · Aug 13, 2021
Related Publication 20230325409A1 · Oct 12, 2023
References Cited (13)
US 9189513B1 · Castellano · 2015 [cited by examiner]
US 11256515B2 · Kulkarni · 2022 [cited by examiner]
US 11709866B2 · Luo et al. · 2023 [cited by applicant]
US 20140172898A1 · Aguilera · 2014 [cited by examiner]
US 20180357240A1 · Miller · 2018 [cited by examiner]
US 20210117443A1 · Zheng · 2021 [cited by examiner]
US 20210124754A1 · Yang · 2021 [cited by examiner]
US 20220217072A1 · Singhal · 2022 [cited by examiner]
US 20230055715A1 · Luo et al. · 2023 [cited by applicant]
US 20230205785A1 · Katsipoulakis et al. · 2023 [cited by applicant]
“U.S. Appl. No. 17/463,353, Notice of Allowance mailed Mar. 2, 2023”, 21 pages. [cited by applicant]
U.S. Appl. No. 17/463,353 U.S. Pat. No. 11,709,866, filed Aug. 31, 2021, Scalable Compaction in a Concurrent Transaction Processing Distributed Database. [cited by applicant]
U.S. Appl. No. 18/171,297, filed Feb. 17, 2023, A Distributed Database that Uses Hybrid Table Secondary Indexes. [cited by applicant]
Cited By (1)
US 12,461,854