IP Library › Granted Patent US 12,412,025
Granted Patent B2
US 12,412,025 · App. 17/715,384 · Granted Sep 9, 2025

Supporting piecewise update of JSON document efficiently

Inventors: Zhen Hua Liu (San Mateo, CA); Beda Christoph Hammerschmidt (Los Gatos, CA); Douglas James McMahon (Redwood City, CA); Joshua Jeffrey Spiegel (St. Louis, MO)
Assignee: Oracle International Corporation
G06F40/146G06F16/2282G06F16/2358
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,412,025
App. No.
17/715,384
Granted
Sep 9, 2025
Kind
B2
Abstract

Herein are fine grained updates to pieces of JavaScript object notation (JSON) documents by database statements that can update, delete, and insert parts of JSON documents. In an embodiment, a computer receives a request that specifies a modification of a JSON document that is stored in a compressed format in persistent storage. The modification adds additional content to the JSON document, and/or replaces an old value in the JSON document with a new value that is not a same size as the old value. The modification is recorded in a change log. The change log is eventually applied to the compressed format of the JSON document in the persistent storage without entirely rewriting the compressed format of the JSON document in the persistent storage.

Claims (80)

1. A method comprising:

storing a JavaScript object notation (JSON) document in a compressed format in persistent storage;

automatically deciding, after said storing the JSON document in the compressed format in persistent storage, to compact the JSON document in the compressed format in persistent storage;

compacting, in response to said automatically deciding to compact the JSON document in the compressed format in persistent storage, the JSON document in the compressed format in persistent storage.

2. The method of claim 1 wherein:

said storing the JSON document in the compressed format in persistent storage comprises inlining the JSON document in the compressed format in a table row in persistent storage;

the method further comprises receiving a write request that would cause the JSON document in the compressed format to exceed the capacity of the table row;

said deciding to compact the JSON document is in response to said receiving the write request that would cause the JSON document in the compressed format to exceed the capacity of the table row.

3. The method of claim 2 further comprising in response to said compacting the JSON document in the compressed format, retaining the JSON document in the compressed format in the table row.

4. The method of claim 1 wherein:

said storing the JSON document in the compressed format in persistent storage comprises persisting the JSON document in the compressed format outside of a table row that is in persistent storage;

the method further comprises in response to said compacting the JSON document in the compressed format, inlining the JSON document in the compressed format in the table row.

5. The method of claim 1 wherein said compacting the JSON document in the compressed format consists essentially of one selected from the group consisting of:

a partial rewrite of the JSON document in the compressed format in persistent storage, and

an entire rewrite of the JSON document in the compressed format in persistent storage.

6. The method of claim 1 wherein said automatically deciding to compact the JSON document is caused by one selected from the group consisting of:

database archiving,

a cache write back,

a commit of a database transaction,

a numeric compaction threshold being crossed,

an access to the JSON document in the compressed format, and

moving the JSON document in the compressed format from a faster storage tier to a slower storage tier.

7. The method of claim 6 wherein the numeric compaction threshold is selected from the group consisting of:

a count of free disk space,

a count of requests to modify the JSON document that were fulfilled without entirely rewriting the JSON document in the compressed format in persistent storage,

a count of bytes or storage blocks appended onto the JSON document in the compressed format without entirely rewriting the JSON document in the compressed format,

a count of requests to modify the JSON document that increased the size of the JSON document in the compressed format without entirely rewriting persistent JSON document,

a ratio or difference between the last compact size of the JSON document in the compressed format and the accumulated additional size of the JSON document in the compressed format, and

a duration elapsed, without entirely rewriting the JSON document in the compressed format in persistent storage, since the size of the JSON document in the compressed format in persistent storage was last increased.

8. The method of claim 6 wherein said automatically deciding to compact the JSON document is based on at least one of selected from the group consisting of:

a timer,

multiple numeric compaction thresholds,

a threshold that specifies a count of numeric compaction thresholds, and

a forecast of future accesses to the JSON document in the compressed format.

9. The method of claim 1 wherein:

an activity occurs in one selected from the group consisting of the foreground and the background;

the activity is one selected from the group consisting of:

said deciding to compact the JSON document, and

said compacting the JSON document in the compressed format.

10. The method of claim 1 wherein said automatically deciding to compact the JSON document is not in response to a client request.

11. One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause:

storing a JavaScript object notation (JSON) document in a compressed format in persistent storage;

automatically deciding, after said storing the JSON document in the compressed format in persistent storage, to compact the JSON document in the compressed format in persistent storage;

compacting, in response to said automatically deciding to compact the JSON document in the compressed format in persistent storage, the JSON document in the compressed format in persistent storage.

12. The one or more non-transitory computer-readable media of claim 11 wherein:

said storing the JSON document in the compressed format in persistent storage comprises inlining the JSON document in the compressed format in a table row in persistent storage;

the instructions further cause receiving a write request that would cause the JSON document in the compressed format to exceed the capacity of the table row;

said deciding to compact the JSON document is in response to said receiving the write request that would cause the JSON document in the compressed format to exceed the capacity of the table row.

13. The one or more non-transitory computer-readable media of claim 12 wherein the instructions further cause in response to said compacting the JSON document in the compressed format, retaining the JSON document in the compressed format in the table row.

14. The one or more non-transitory computer-readable media of claim 11 wherein:

said storing the JSON document in the compressed format in persistent storage comprises persisting the JSON document in the compressed format outside of a table row that is in persistent storage;

the instructions further cause in response to said compacting the JSON document in the compressed format, inlining the JSON document in the compressed format in the table row.

15. The one or more non-transitory computer-readable media of claim 11 wherein said compacting the JSON document in the compressed format consists essentially of one selected from the group consisting of:

a partial rewrite of the JSON document in the compressed format in persistent storage, and

an entire rewrite of the JSON document in the compressed format in persistent storage.

16. The one or more non-transitory computer-readable media of claim 11 wherein said automatically deciding to compact the JSON document is caused by one selected from the group consisting of:

database archiving,

a cache write back,

a commit of a database transaction,

a numeric compaction threshold being crossed,

an access to the JSON document in the compressed format, and

moving the JSON document in the compressed format from a faster storage tier to a slower storage tier.

17. The one or more non-transitory computer-readable media of claim 16 wherein the numeric compaction threshold is selected from the group consisting of:

a count of free disk space,

a count of requests to modify the JSON document that were fulfilled without entirely rewriting the JSON document in the compressed format in persistent storage,

a count of bytes or storage blocks appended onto the JSON document in the compressed format without entirely rewriting the JSON document in the compressed format,

a count of requests to modify the JSON document that increased the size of the JSON document in the compressed format without entirely rewriting persistent JSON document,

a ratio or difference between the last compact size of the JSON document in the compressed format and the accumulated additional size of the JSON document in the compressed format, and

a duration elapsed, without entirely rewriting the JSON document in the compressed format in persistent storage, since the size of the JSON document in the compressed format in persistent storage was last increased.

18. The one or more non-transitory computer-readable media of claim 16 wherein said automatically deciding to compact the JSON document is based on at least one of selected from the group consisting of:

a timer,

multiple numeric compaction thresholds,

a threshold that specifies a count of numeric compaction thresholds, and

a forecast of future accesses to the JSON document in the compressed format.

19. The one or more non-transitory computer-readable media of claim 11 wherein:

an activity occurs in one selected from the group consisting of the foreground and the background;

the activity is one selected from the group consisting of:

said deciding to compact the JSON document, and

said compacting the JSON document in the compressed format.

20. The one or more non-transitory computer-readable media of claim 11 wherein said automatically deciding to compact the JSON document is not in response to a client request.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 7, 2022
From: LIU, ZHEN HUA; HAMMERSCHMIDT, BEDA CHRISTOPH; MCMAHON, DOUGLAS JAMES; SPIEGEL, JOSHUA JEFFREY
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 059532/0745 →
Continuity (3)
Continuation 16863268 · Apr 30, 2020
Provisional Application 62916154 · Oct 16, 2019
Related Publication 20220229971A1 · Jul 21, 2022
References Cited (26)
US 8805849B1 · Christensen · 2014 [cited by examiner]
US 9864816B2 · Liu et al. · 2018 [cited by applicant]
US 10333709B2 · Dictos · 2019 [cited by applicant]
US 11144513B1 · Padisetty · 2021 [cited by examiner]
US 11423001B2 · Liu et al. · 2022 [cited by applicant]
US 20120174075A1 · Carteri · 2012 [cited by examiner]
US 20150039587A1 · Liu et al. · 2015 [cited by applicant]
US 20160117410A1 · Kamiya · 2016 [cited by examiner]
US 20170060912A1 · Liu et al. · 2017 [cited by applicant]
US 20170141791A1 · Balegar et al. · 2017 [cited by applicant]
US 20180137176A1 · Geissinger · 2018 [cited by applicant]
US 20180218019A1 · Libow · 2018 [cited by examiner]
US 20190306237A1 · Srinivasan · 2019 [cited by examiner]
US 20190340278A1 · Bensberg · 2019 [cited by examiner]
US 20190384841A1 · Geissinger et al. · 2019 [cited by applicant]
US 20210081389A1 · Liu et al. · 2021 [cited by applicant]
US 20210117611A1 · Liu et al. · 2021 [cited by applicant]
CN 108052320A · 2018 [cited by applicant]
Wikipedia, the free encyclopedia, “BSON”, last viewed on Dec. 28, 2015, https://en.wikipedia.org/wiki/BSON, 3 pages. [cited by applicant]
Odie's Oracle Blog, “JSON Patch, Merge Patch, and Redact features in Oracle 18c”, dated Aug. 27, 2018, 16 pages. [cited by applicant]
IMB, “BSON and JSON Built-in Opaque Data Types”, https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.sqls.doc/ids_sqs_1770.htm, last viewed on Jun. 18, 2020, 9 pages. [cited by applicant]
Idalko, Tools for Aglie Teams, “CRUD operations with Postgres JSONB”, dated May 31, 2017, 18 pages. [cited by applicant]
Hoffman, P. et al., “JSON Merge Patch”, Internet Engineering Task Force (IETF), dated Oct. 2014, 9 pages. [cited by applicant]
Hatlen, Knut, “Partial update of JSON values”, dated Apr. 3, 2018, https://mysqlserverteam.com/partial-update-of-json-values/, 6 pages. [cited by applicant]
Bryan et al., “JavaScript Object Notation (JSON) Patch”, https://www.hjp.at/doc/rfc/rfc6902.html, dated Apr. 2013, 18 pages. [cited by applicant]
Amazon Ion, “Doc/Specification”, http://amzn.github.io/ion-docs/docs/spec.html, dated Aug. 20, 2019, 13 pages. [cited by applicant]