IP Library › Granted Patent US 12,645,666
Granted Patent B2
US 12,645,666 · App. 17/991,430 · Granted Jun 2, 2026

Cross row consistent data accessing

Inventors: Jiawen Sun (Bellevue, WA); Tuncay Uzun (Seattle, WA); Fengjin Liu (Bellevue, WA)
Assignee: Snap Inc.
G06F16/2379G06F16/2246G06F16/248
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,645,666
App. No.
17/991,430
Granted
Jun 2, 2026
Kind
B2
Abstract

A method and a system include, for each predetermined time period in a plurality of predetermined time periods, writing a plurality of data rows comprising a set of data associated with a plurality of active entities, and updating an index table based on the plurality of data rows in the stats table, wherein the index table comprises an index row. The method further includes receiving from an electronic device via an interface a query corresponding to an entity, retrieving an index value from an index row included an index row, retrieving the current value from the stats table using the index value, generating a response to the query using the index value and the current value, and displaying the response on a display of the electronic device.

Claims (43)

1 . A method comprising:

receiving, from a device, a query corresponding to an entity;

identifying, in a non-relational database, an index row from an index table, the index row including a plurality of index values representing stats values stored in a latest data row in a stats table, the plurality of index values being generated based on an index tree structure that comprises a plurality of root nodes, each root node comprising a version attribute that references one or more lower level nodes, the stats table including a plurality of stats values of a plurality of entities, each index value in the plurality of index values corresponding to a stats value of an entity in the latest data row;

generating a response to the query based on an index value and a stats value that correspond to the entity, the index row maintaining cross-row consistency during data updates in the stats table, the index row comprising index version data and a set of pointer maps for fetching current stats values from the stats table, such that a single atomic read of the index row provides a complete and consistent read of the current stats values stored in different rows of the stats table; and

causing display of the response on a user interface of the device.

2 . The method of claim 1 , further comprising:

identifying, based on the query, the stats table that includes data associated with the entity; and

retrieving, based on the index value, the stats value associated with the entity from the stats table, the stats value corresponding a value associated with the entity in the latest data row.

3 . The method of claim 2 , wherein the stats table is updated at a determined interval of time.

4 . The method of claim 2 , wherein each data row in the stats table comprises a plurality of counters that includes at least one of: a counter of a number of viewings, a counter of amount spent, or a counter of a number of interactions.

5 . The method of claim 2 , wherein a key-value store database comprises the stats table and the index row.

6 . The method of claim 1 , further comprising:

writing one or more data rows that include data associated with a plurality of entities at a determined interval of time; and

updating the index row based on the one or more data rows.

7 . The method of claim 6 , wherein the query is received during the writing of the one or more data rows that include the data associated with the plurality of entities.

8 . The method of claim 1 , wherein the index row comprises a data category, an entity type, and an index root identity.

9 . The method of claim 1 , wherein the query is received via an Application Program Interface (API).

10 . The method of claim 9 , further comprising:

transmitting, via the API, the response to the query to the device.

11 . A system comprising:

one or more processors; and

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

receiving, from a device, a query corresponding to an entity;

identifying, in a non-relational database, an index row from an index table, the index row including a plurality of index values representing stats values stored in a latest data row in a stats table, the plurality of index values being generated based on an index tree structure that comprises a plurality of root nodes, each root node comprising a version attribute that references one or more lower level nodes, the stats table including a plurality of stats values of a plurality of entities, each index value in the plurality of index values corresponding to a stats value of an entity in the latest data row;

generating a response to the query based on an index value and a stats value that correspond to the entity, the index row maintaining cross-row consistency during data updates in the stats table, the index row comprising index version data and a set of pointer maps for fetching current stats values from the stats table, such that a single atomic read of the index row provides a complete and consistent read of the current stats values stored in different rows of the stats table; and

causing display of the response on a user interface of the device.

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

identifying, based on the query, the stats table that includes data associated with the entity; and

retrieving, based on the index value, the stats value associated with the entity from the stats table, the stats value corresponding a value associated with the entity in the latest data row.

13 . The system of claim 12 , wherein the stats table is updated at a determined interval of time.

14 . The system of claim 12 , wherein each data row in the stats table comprises a plurality of counters that includes at least one of: a counter of a number of viewings, a counter of amount spent, or a counter of a number of interactions.

15 . The system of claim 12 , wherein a key-value store database comprises the stats table and the index row.

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

writing one or more data rows that include data associated with a plurality of entities at a determined interval of time; and

updating the index row based on the one or more data rows.

17 . The system of claim 16 , wherein the query is received during the writing of the one or more data rows that include the data associated with the plurality of entities.

18 . The system of claim 11 , wherein the index row comprises a data category, an entity type, and an index root identity.

19 . The system of claim 11 , wherein the query is received via an Application Program Interface (API).

20 . A non-transitory computer-readable medium comprising instructions that, when executed by a hardware processor of a machine, cause the machine to perform operations comprising:

receiving, from a device, a query corresponding to an entity;

identifying, in a non-relational database, an index row from an index table, the index row including a plurality of index values representing stats values stored in a latest data row in a stats table, the plurality of index values being generated based on an index tree structure that comprises a plurality of root nodes, each root node comprising a version attribute that references one or more lower level nodes, the stats table including a plurality of stats values of a plurality of entities, each index value in the plurality of index values corresponding to a stats value of an entity in the latest data row;

generating a response to the query based on an index value and a stats value that correspond to the entity, the index row maintaining cross-row consistency during data updates in the stats table, the index row comprising index version data and a set of pointer maps for fetching current stats values from the stats table, such that a single atomic read of the index row provides a complete and consistent read of the current stats values stored in different rows of the stats table; and

causing display of the response on a user interface of the device.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 21, 2022
From: SUN, JIAWEN; UZUN, TUNCAY; LIU, FENGJIN
To: SNAP INC.
Reel/Frame 061844/0292 →
Continuity (2)
Continuation 16729247 · Dec 27, 2019
Related Publication 20230161755A1 · May 25, 2023
References Cited (24)
US 8073840B2 · Smith et al. · 2011 [cited by applicant]
US 11243956B1 · Papakonstantinou et al. · 2022 [cited by applicant]
US 11256684B1 · Papakonstantinou et al. · 2022 [cited by applicant]
US 20060212264A1 · Barsness · 2006 [cited by examiner]
US 20070130585A1 · Perret · 2007 [cited by examiner]
US 20070185818A1 · Nozawa · 2007 [cited by examiner]
US 20080097933A1 · Awaida · 2008 [cited by examiner]
US 20100005054A1 · Smith · 2010 [cited by examiner]
US 20100191884A1 · Holenstein · 2010 [cited by examiner]
US 20120102040A1 · Battle · 2012 [cited by examiner]
US 20120330988A1 · Christie · 2012 [cited by examiner]
US 20130073330A1 · McCormack · 2013 [cited by examiner]
US 20150032760A1 · Farahat · 2015 [cited by examiner]
US 20160055233A1 · Wang · 2016 [cited by examiner]
US 20160323169A1 · Song · 2016 [cited by examiner]
US 20170255675A1 · Chavan · 2017 [cited by examiner]
US 20190188309A1 · Anderson et al. · 2019 [cited by applicant]
US 20190303405A1 · Kothari et al. · 2019 [cited by applicant]
StackOverflow, “How do I select the rows with the most recent date in SQL?” retrieving from Internet: https://stackoverflow.com/questions/51544592/how-do-i-select-the-rows-with-the-most-recent-date-in-sql, Jul. 26, 2018… [cited by examiner]
U.S. Appl. No. 16/729,247 U.S. Pat. No. 1,520,774, filed Dec. 27, 2019, Cross Row Consistent Data Accessing. [cited by applicant]
“U.S. Appl. No. 16/729,247, Examiner Interview Summary mailed Jun. 13, 2022”, 2 pgs. [cited by applicant]
“U.S. Appl. No. 16/729,247, Non Final Office Action mailed Mar. 10, 2022”, 11 pgs. [cited by applicant]
“U.S. Appl. No. 16/729,247, Notice of Allowance mailed Aug. 5, 2022”, 9 pgs. [cited by applicant]
“U.S. Appl. No. 16/729,247, Response filed Jun. 15, 2022 to Non Final Office Action mailed Mar. 10, 2022”, 9 pgs. [cited by applicant]