# US 12,222,958 B2 · Selective table replication to enable stream replication

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

- Number: US 12,222,958 B2
- Document ID: US12222958B2
- Status: Granted
- Kind: B2
- Application number: 18/345,949
- Filed: 2023-06-30
- Published: 2023-10-26
- Granted: 2025-02-11
- Earliest claimed: 2022-03-23
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Istvan Cseri; Tyler Jones; Daniel E. Sotolongo; Boyuan Zhang
- Web page: https://patentgrep.com/patent/US12222958B2

## CPC

- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 16/273: {Asynchronous replication or reconciliation}
- G06F 11/2094: {Redundant storage or storage space (G06F11/2056 takes precedence)}
- G06F 11/2097: {maintaining the standby controller/processing unit updated (initialisation or re-synchronisation thereof G06F11/1658 and subgroups)}
- G06F 2201/80: Database-specific techniques
- G06F 2201/84: Using snapshots, i.e. a logical point-in-time copy of the data
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques described herein can enable stream replication. A first deployment can store a table including one or more streams. The techniques described herein can be used to replicate the table at a second deployment while replicating the one or more streams associated with the table. Select prior table versions and partitions in the table are copied to the second deployment to enable stream replication.

## Claims

### Claim 1

A method comprising:
generating, by a first deployment in a network-based database system, an inventory including status information of a replicated copy of a table in response to a refresh request, the table being stored in a second deployment and the table including a stream tracking change data capture information related to the table;
transmitting, by the first deployment, the inventory to the second deployment;
receiving, by the first deployment, an update snapshot from the second deployment, the update snapshot including information indicating changes on the table stored at the second deployment since a last refresh and including information regarding at least one select table version and at least one select partition for enabling replication of the stream, the at least one select partition being deleted in the table prior to current table version; and
generating, by the first deployment, a refreshed replicated copy of the table at the second deployment based on the update snapshot, the refreshed replicated copy including a replicated copy of the stream using replicated copies of the at least one select table version and the at least one select partition, the stream being append-only stream recording row inserts into the table and not recording update and delete operations on the table.

### Claim 2 (depends on 1)

The method of claim 1, wherein the at least one select table version is related to an offset of the stream.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
detecting a failover event at the second deployment, wherein in response to detecting the failover event, the first deployment taking over as primary database for the table.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
receiving, by the first deployment, a query referencing the table; and
executing the query using the refreshed replicated copy of the table at the first deployment.

### Claim 5 (depends on 4)

The method of claim 4, wherein executing the query is based on the stream stored in the refreshed replicated copy of the table.

### Claim 6 (depends on 1)

The method of claim 1, wherein the stream is a first stream and the table includes a second stream.

### Claim 7 (depends on 6)

The method of claim 6, wherein the second stream is a delta type stream, and wherein the delta stream is replicated in the refreshed replicated copy of the table.

### Claim 8

A machine-storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:
generating, by a first deployment in a network-based database system, an inventory including status information of a replicated copy of a table in response to a refresh request, the table being stored in a second deployment and the table including a stream tracking change data capture information related to the table;
transmitting, by the first deployment, the inventory to the second deployment;
receiving, by the first deployment, an update snapshot from the second deployment, the update snapshot including information indicating changes on the table stored at the second deployment since a last refresh and including information regarding at least one select table version and at least one select partition for enabling replication of the stream, the at least one select partition being deleted in the table prior to current table version; and
generating, by the first deployment, a refreshed replicated copy of the table at the second deployment based on the update snapshot, the refreshed replicated copy including a replicated copy of the stream using replicated copies of the at least one select table version and the at least one select partition, the stream being append-only stream recording row inserts into the table and not recording update and delete operations on the table.

### Claim 9 (depends on 8)

The machine-storage medium of claim 8, wherein the at least one select table version is related to an offset of the stream.

### Claim 10 (depends on 8)

The machine-storage medium of claim 8, further comprising:
detecting a failover event at the second deployment, wherein in response to detecting the failover event, the first deployment taking over as primary database for the table.

### Claim 11 (depends on 10)

The machine-storage medium of claim 10, further comprising:
receiving, by the first deployment, a query referencing the table; and
executing the query using the refreshed replicated copy of the table at the first deployment.

### Claim 12 (depends on 11)

The machine-storage medium of claim 11, wherein executing the query is based on the stream stored in the refreshed replicated copy of the table.

### Claim 13 (depends on 8)

The machine-storage medium of claim 8, wherein the stream is a first stream and the table includes a second stream.

### Claim 14 (depends on 13)

The machine-storage medium of claim 13, wherein the second stream is a delta type stream, and wherein the delta stream is replicated in the refreshed replicated copy of the table.

### Claim 15

A system comprising:
at least one hardware processor; and
at least one memory storing instructions that, when executed by the at least one hardware processor, cause the at least one hardware processor to perform operations comprising:
generating, by a first deployment in a network-based database system, an inventory including status information of a replicated copy of a table in response to a refresh request, the table being stored in a second deployment and the table including a stream tracking change data capture information related to the table;
transmitting, by the first deployment, the inventory to the second deployment;
receiving, by the first deployment, an update snapshot from the second deployment, the update snapshot including information indicating changes on the table stored at the second deployment since a last refresh and including information regarding at least one select table version and at least one select partition for enabling replication of the stream, the at least one select partition being deleted in the table prior to current table version; and
generating, by the first deployment, a refreshed replicated copy of the table at the second deployment based on the update snapshot, the refreshed replicated copy including a replicated copy of the stream using replicated copies of the at least one select table version and the at least one select partition, the stream being append-only stream recording row inserts into the table and not recording update and delete operations on the table.

### Claim 16 (depends on 15)

The system of claim 15, wherein the at least one select table version is related to an offset of the stream.

### Claim 17 (depends on 15)

The system of claim 15, the operations further comprising:
detecting a failover event at the second deployment, wherein in response to detecting the failover event, the first deployment taking over as primary database for the table.

### Claim 18 (depends on 17)

The system of claim 17, the operations further comprising:
receiving, by the first deployment, a query referencing the table; and
executing the query using the refreshed replicated copy of the table at the first deployment.

### Claim 19 (depends on 18)

The system of claim 18, wherein executing the query is based on the stream stored in the refreshed replicated copy of the table.

### Claim 20 (depends on 15)

The system of claim 15, wherein the stream is a first stream and the table includes a second stream.

### Claim 21 (depends on 20)

The system of claim 20, wherein the second stream is a delta type stream, and wherein the delta stream is replicated in the refreshed replicated copy of the table.
