# US 12,222,828 B2 · Share-based 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,828 B2
- Document ID: US12222828B2
- Status: Granted
- Kind: B2
- Application number: 18/329,348
- Filed: 2023-06-05
- Published: 2024-05-30
- Granted: 2025-02-11
- Earliest claimed: 2022-11-30
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Loc Duc Bui; Hitesh Madan; Nithin Mahesh; Subramanian Muralidhar; Sahaj Saini; Di Wu
- Web page: https://patentgrep.com/patent/US12222828B2

## CPC

- G06F 11/203: {using migration}
- 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 16/256: {in federated or virtual databases}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The subject technology determines a set of share objects in a replication group. The subject technology, for each object from the set of share objects, determines a set of permissions for a set of objects of databases that has been granted to each share object from the replication group. The subject technology, for each permission from the set of permissions, determines a set of dependencies, the set of dependencies comprising a second set of objects. The subject technology generates a graph structure based at least in part on the set of share objects, the set of permissions, and the set of dependencies. The subject technology traverses at least a portion of the graph structure to determine a final set of dependencies for replication. The subject technology performs a replication process based at least in part on the final set of dependencies.

## Claims

### Claim 1

A system comprising:
at least one hardware processor; and
a memory storing instructions that cause the at least one hardware processor to perform operations comprising:
determining a set of share objects in a replication group;
for each object from the set of share objects, determining a set of permissions for a set of objects of databases that has been granted to each share object from the replication group;
for each permission from the set of permissions, determining a set of dependencies, the set of dependencies comprising a second set of objects;
generating a graph structure based at least in part on the set of share objects, the set of permissions, and the set of dependencies,
the graph structure comprising a set of nodes corresponding to the set of share objects and the set of objects of the databases;
traversing at least a portion of the graph structure to determine a final set of dependencies for replication; and
performing a replication process based at least in part on the final set of dependencies.

### Claim 2 (depends on 1)

The system of claim 1, wherein the operations further comprise:
for each object in the second set of objects, determining a second set of dependencies, wherein generating the graph structure is further based on the second set of dependencies.

### Claim 3 (depends on 1)

The system of claim 1, wherein the set of share objects comprises a first share object and a second share object.

### Claim 4 (depends on 3)

The system of claim 3, wherein the operations further comprise:
determining that the first share object has a usage grant on a first database and a select grant of a first view of the first database.

### Claim 5 (depends on 4)

The system of claim 4, wherein the operations further comprise:
skipping a traversal of a set of child nodes of a parent node corresponding to the usage grant on the first database.

### Claim 6 (depends on 4)

The system of claim 4, wherein the operations further comprise:
determining a particular first set of dependencies based at least in part on the select grant of the first view of the first database, the particular first set of dependencies comprising a second view of the first database associated with a second schema and a second table of the first database associated with the first share object;
determining a second particular set of dependencies of the second table of the first database associated with the first share object, the second particular set of dependencies comprising a column of the second table, and a first schema of the first database;
traversing from a particular parent node associated with the second table of the first database to a particular child node associated with the first schema of the first database;
skipping a traversal from second particular parent node of the first view of the first database to the particular child node associated with the first schema of the first database; and
determining that the particular child node associated with the first schema of the first database is a particular leaf node of a final graph structure corresponding to the final set of dependencies.

### Claim 7 (depends on 6)

The system of claim 6, wherein the operations further comprise:
determining a third particular set of dependencies of the column of the second table, the third particular set of dependencies comprising a constraint of the column of second table;
traversing from a third particular parent node of the column of the second table to a second particular child node of the constraint of the column of second table; and
determining that the second particular child node of the constraint of the column of the second table is a second particular leaf node of the final graph structure based on the constraint of the column of the second table having no dependencies.

### Claim 8 (depends on 3)

The system of claim 3, wherein the operations further comprise:
determining that the second share object has a usage grant on a first database and a second usage grant of a user defined function (UDF) of the first database.

### Claim 9 (depends on 8)

The system of claim 8, wherein the operations further comprise:
determining a particular first set of dependencies based at least in part on the second usage grant of the UDF of the first database, the particular first set of dependencies comprising a second schema of the first database; and
traversing from a particular parent node of the second usage grant of the UDF of the first database to a particular child node of the second schema of the first database.

### Claim 10 (depends on 9)

The system of claim 9, wherein the operations further comprise:
skipping a traversal of a second particular child node of the second schema of the first database; and
determining that the particular child node of the second schema of the first database is a particular leaf node of a final graph structure corresponding to the final set of dependencies.

### Claim 11

A method comprising:
determining a set of share objects in a replication group;
for each object from the set of share objects, determining a set of permissions for a set of objects of databases that has been granted to each share object from the replication group;
for each permission from the set of permissions, determining a set of dependencies, the set of dependencies comprising a second set of objects;
generating a graph structure based at least in part on the set of share objects, the set of permissions, and the set of dependencies,
the graph structure comprising a set of nodes corresponding to the set of share objects and the set of objects of the databases;
traversing at least a portion of the graph structure to determine a final set of dependencies for replication; and
performing a replication process based at least in part on the final set of dependencies.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
for each object in the second set of objects, determining a second set of dependencies, wherein generating the graph structure is further based on the second set of dependencies.

### Claim 13 (depends on 11)

The method of claim 11, wherein the set of share objects comprises a first share object and a second share object.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
determining that the first share object has a usage grant on a first database and a select grant of a first view of the first database.

### Claim 15 (depends on 14)

The method of claim 14, further comprising:
skipping a traversal of a set of child nodes of a parent node corresponding to the usage grant on the first database.

### Claim 16 (depends on 14)

The method of claim 14, further comprising:
determining a particular first set of dependencies based at least in part on the select grant of the first view of the first database, the particular first set of dependencies comprising a second view of the first database associated with a second schema and a second table of the first database associated with the first share object;
determining a second particular set of dependencies of the second table of the first database associated with the first share object, the second particular set of dependencies comprising a column of the second table, and a first schema of the first database;
traversing from a particular parent node associated with the second table of the first database to a particular child node associated with the first schema of the first database;
skipping a traversal from second particular parent node of the first view of the first database to the particular child node associated with the first schema of the first database; and
determining that the particular child node associated with the first schema of the first database is a particular leaf node of a final graph structure corresponding to the final set of dependencies.

### Claim 17 (depends on 16)

The method of claim 16, further comprising:
determining a third particular set of dependencies of the column of the second table, the third particular set of dependencies comprising a constraint of the column of second table;
traversing from a third particular parent node of the column of the second table to a second particular child node of the constraint of the column of second table; and
determining that the second particular child node of the constraint of the column of the second table is a second particular leaf node of the final graph structure based on the constraint of the column of the second table having no dependencies.

### Claim 18 (depends on 13)

The method of claim 13, further comprising:
determining that the second share object has a usage grant on a first database and a second usage grant of a user defined function (UDF) of the first database.

### Claim 19 (depends on 18)

The method of claim 18, further comprising:
determining a particular first set of dependencies based at least in part on the second usage grant of the UDF of the first database, the particular first set of dependencies comprising a second schema of the first database; and
traversing from a particular parent node of the second usage grant of the UDF of the first database to a particular child node of the second schema of the first database.

### Claim 20 (depends on 19)

The method of claim 19, further comprising:
skipping a traversal of a second particular child node of the second schema of the first database; and
determining that the particular child node of the second schema of the first database is a particular leaf node of a final graph structure corresponding to the final set of dependencies.

### Claim 21

A non-transitory computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:
determining a set of share objects in a replication group;
for each object from the set of share objects, determining a set of permissions for a set of objects of databases that has been granted to each share object from the replication group;
for each permission from the set of permissions, determining a set of dependencies, the set of dependencies comprising a second set of objects;
generating a graph structure based at least in part on the set of share objects, the set of permissions, and the set of dependencies,
the graph structure comprising a set of nodes corresponding to the set of share objects and the set of objects of the databases;
traversing at least a portion of the graph structure to determine a final set of dependencies for replication; and
performing a replication process based at least in part on the final set of dependencies.

### Claim 22 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein the operations further comprise:
for each object in the second set of objects, determining a second set of dependencies, wherein generating the graph structure is further based on the second set of dependencies.

### Claim 23 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein the set of share objects comprises a first share object and a second share object.

### Claim 24 (depends on 23)

The non-transitory computer-storage medium of claim 23, wherein the operations further comprise:
determining that the first share object has a usage grant on a first database and a select grant of a first view of the first database.

### Claim 25 (depends on 24)

The non-transitory computer-storage medium of claim 24, wherein the operations further comprise:
skipping a traversal of a set of child nodes of a parent node corresponding to the usage grant on the first database.

### Claim 26 (depends on 24)

The non-transitory computer-storage medium of claim 24, wherein the operations further comprise:
determining a particular first set of dependencies based at least in part on the select grant of the first view of the first database, the particular first set of dependencies comprising a second view of the first database associated with a second schema and a second table of the first database associated with the first share object;
determining a second particular set of dependencies of the second table of the first database associated with the first share object, the second particular set of dependencies comprising a column of the second table, and a first schema of the first database;
traversing from a particular parent node associated with the second table of the first database to a particular child node associated with the first schema of the first database;
skipping a traversal from second particular parent node of the first view of the first database to the particular child node associated with the first schema of the first database; and
determining that the particular child node associated with the first schema of the first database is a particular leaf node of a final graph structure corresponding to the final set of dependencies.

### Claim 27 (depends on 26)

The non-transitory computer-storage medium of claim 26, wherein the operations further comprise:
determining a third particular set of dependencies of the column of the second table, the third particular set of dependencies comprising a constraint of the column of second table;
traversing from a third particular parent node of the column of the second table to a second particular child node of the constraint of the column of second table; and
determining that the second particular child node of the constraint of the column of the second table is a second particular leaf node of the final graph structure based on the constraint of the column of the second table having no dependencies.

### Claim 28 (depends on 23)

The non-transitory computer-storage medium of claim 23, wherein the operations further comprise:
determining that the second share object has a usage grant on a first database and a second usage grant of a user defined function (UDF) of the first database.

### Claim 29 (depends on 28)

The non-transitory computer-storage medium of claim 28, wherein the operations further comprise:
determining a particular first set of dependencies based at least in part on the second usage grant of the UDF of the first database, the particular first set of dependencies comprising a second schema of the first database; and
traversing from a particular parent node of the second usage grant of the UDF of the first database to a particular child node of the second schema of the first database.

### Claim 30 (depends on 29)

The non-transitory computer-storage medium of claim 29, wherein the operations further comprise:
skipping a traversal of a second particular child node of the second schema of the first database; and
determining that the particular child node of the second schema of the first database is a particular leaf node of a final graph structure corresponding to the final set of dependencies.
