# US 2023/0065823 A1 · Updating records in a real-time storage system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0065823 A1
- Document ID: US20230065823A1
- Status: Published application
- Kind: A1
- Application number: 17/410,515
- Filed: 2021-08-24
- Published: 2023-03-02
- Earliest claimed: 2021-08-24
- Assignees: Twitter, Inc.
- Applicants: Twitter, Inc.
- Inventors: Rakesh Iyer
- Web page: https://patentgrep.com/patent/US20230065823A1

## CPC

- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 16/2386: {Bulk updating operations (data conversion details G06F16/258)}
- G06F 16/2322: {using timestamps}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 16/2372: {Updates performed during offline database operations}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

According to an aspect, a method includes storing messages exchanged on a messaging platform in a non-relational database, obtaining a database snapshot of the non-relational database, executing a database task on the database snapshot, and generating, in response to the database task, an update log, where the update log identifies a first record to be changed or deleted in the non-relational database. The method includes determining whether or not the first record identified in the update log has been updated in the non-relational database after a time instance associated with the database task and applying the change or deletion of the first record in the non-relational database in response to the first record being determined as not updated after the time instance associated with the database task.

## Claims

### Claim 1

A method comprising:
storing messages exchanged on a messaging platform in a non-relational database;
obtaining a database snapshot of the non-relational database;
executing a database task on the database snapshot;
generating, in response to the database task, an update log, the update log identifying a first record to be changed or deleted in the non-relational database;
determining whether or not the first record identified in the update log has been updated in the non-relational database after a time instance associated with the database task; and
applying the change or deletion of the first record in the non-relational database in response to the first record being determined as not updated after the time instance associated with the database task.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
not applying the change or deletion of the first record in the non-relational database in response to the first record being determined as updated after the time instance associated with the database task.

### Claim 3 (depends on 1)

The method of claim 1, the method comprising:
comparing a first timestamp associated with the first record in the non-relational database and a second timestamp associated with the first record in the database snapshot,
wherein the change or deletion of the first record in the non-relational database is applied in response to a time of the first timestamp being before a time of the second timestamp.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
comparing a content of the first record in the database snapshot with a content of the first record in the non-relational database,
wherein the change or deletion of the first record in the non-relational database is applied in response to the content of the first record in the non-relational database being determined as the same as the content of the first record in the database snapshot.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
obtaining a sequence of database snapshots over time, the sequence of database snapshots including a first database snapshot obtained during a first period of time, and a second database snapshot obtained during a second period of time.

### Claim 6 (depends on 1)

The method of claim 1, wherein the database snapshot is a first database snapshot, the method further comprising:
obtaining a second database snapshot of the non-relational database, the second database snapshot being obtained after the first database snapshot;
re-generating, in response to a subsequent database task, the update log, the re-generated update log identifying the first record;
determining whether or not the first record identified in the re-generated update log has been updated in the non-relational database after a time instance associated with the subsequent database task; and
applying the change or deletion of the first record in the non-relational database in response to the first record being determined as not changed after the time instance associated with the subsequent database task.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
storing the database snapshot in an offline storage system, the offline storage system being separate from the non-relational database.

### Claim 8 (depends on 1)

The method of claim 1, wherein the database task is a deletion event configured to delete records in the non-relational database associated with a plurality of user accounts of the messaging platform.

### Claim 9 (depends on 8)

The method of claim 8, wherein the first record includes a message exchanged on the messaging platform from a user account of the plurality of user accounts, the message having a message identifier, the database task configured to cause deletion of any records associated with the message identifier from the non-relational database.

### Claim 10

A messaging system comprising:
a non-relational database configured to store messages exchanged on a messaging platform in a non-relational database;
a database manager configured to obtain, over time, a sequence of database snapshots of the non-relational database, the sequence of database snapshots including a first database snapshot;
a task manager configured to execute a database task on the first database snapshot to generate an update log, the update log identifying a plurality of records to be changed or deleted in the non-relational database; and
a change applier configured to determine, for each of the plurality of records identified in the update log, whether or not a record has been updated in the non-relational database after a time instance associated with the database task,
the change applier configured to apply the change or deletion of the record in the non-relational database in response to the record being determined as not updated after the time instance associated with the database task.

### Claim 11 (depends on 10)

The messaging system of claim 10, wherein the non-relational database is an unstructured database, the unstructured database not including an index.

### Claim 12 (depends on 10)

The messaging system of claim 10, wherein the change applier is configured to not apply the change or deletion of the record in the non-relational database in response to the record being determined as updated after the time instance associated with the database task.

### Claim 13 (depends on 10)

The messaging system of claim 10, wherein the change applier is configured to compare a first timestamp associated with the record in the first database snapshot with a second timestamp associated with the record stored in the non-relational database, the change applier configured to not change or delete the record in the non-relational database in response to a time of the second timestamp being after a time of the first timestamp.

### Claim 14 (depends on 10)

The messaging system of claim 10, wherein the change applier is configured to compare a content of the first record in the first database snapshot with a content of the first record in the non-relational database, the change applier configured to not change or delete the record in the non-relational database in response to the content of the first record in the non-relational database being different from the content of the first record in the first database snapshot.

### Claim 15 (depends on 10)

The messaging system of claim 10, wherein the sequence of database snapshots includes a second database snapshot, the task manager configured to re-generate, in response to a subsequent database task, the update log using the second database snapshot.

### Claim 16

A non-transitory computer-readable medium storing executable instructions that when executed by at least one processor cause the at least one processor to:
store messages exchanged on a messaging platform in a non-relational database;
obtain, over time, a sequence of database snapshots of the non-relational database, the sequence of database snapshots including a first database snapshot and a second database snapshot;
execute a database task on the first database snapshot to generate an update log, the update log identifying a plurality of records to be changed or deleted in the non-relational database;
determine, for each of the plurality of records identified in the update log, whether or not a record has been updated in the non-relational database after a time instance associated with the database task;
not apply the change or deletion of the record in the non-relational database in response to the record being determined as updated after the time instance associated with the database task; and
attempt to apply the change or deletion of the record in the non-relational database using the second database snapshot.

### Claim 17 (depends on 16)

The non-transitory computer-readable medium of claim 16, wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
compare a first timestamp associated with the record in the first database snapshot with a second timestamp associated with the record stored in the non-relational database; and
not change or delete the record in the non-relational database in response to a time of the second timestamp being after a time of the first timestamp.

### Claim 18 (depends on 16)

The non-transitory computer-readable medium of claim 16, wherein the executable instructions include instructions that when executed by the at least one processor cause the at least one processor to:
compare a content of the first record in the first database snapshot with a content of the first record in the non-relational database using one or more compare-and-swap (CAS) operations; and
not change or delete the record in the non-relational database in response to the content of the first record in the non-relational database being different from the content of the first record in the first database snapshot.

### Claim 19 (depends on 16)

The non-transitory computer-readable medium of claim 16, wherein the database task is a deletion event configured to delete records in the non-relational database associated with a plurality of user accounts that are unsubscribed from the messaging platform.

### Claim 20 (depends on 19)

The non-transitory computer-readable medium of claim 19, wherein the non-relational database includes a main dataset and at least one derived dataset, wherein the plurality of records include messages exchanged on the messaging platform from the plurality of user accounts, the database task configured to cause deletion of any records associated with the plurality of user accounts from the main dataset and the at least one derived dataset.
