# US 2021/0279209 A1 · Readable and writable streams on external data sources

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

- Number: US 2021/0279209 A1
- Document ID: US20210279209A1
- Status: Published application
- Kind: A1
- Application number: 16/813,048
- Filed: 2020-03-09
- Published: 2021-09-09
- Earliest claimed: 2020-03-09
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Istvan Cseri; Tyler Jones
- Web page: https://patentgrep.com/patent/US20210279209A1

## CPC

- G06F 16/1734: {Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs}
- G06F 16/24568: {Data stream processing; Continuous queries}
- G06F 11/1471: involving logging of persistent data for recovery
- G06F 16/144: {Query formulation}
- G06F 16/1824: {implemented using Network-attached Storage [NAS] architecture (distributed or networked storage systems G06F3/067; protocols for distributed storage of data in a network H04L67/1097)}
- G06F 16/1858: {Parallel file systems, i.e. file systems supporting multiple processors}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/25: Integrating or interfacing systems involving database management systems
- G06F 2201/80: Database-specific techniques
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The subject technology receives an operation to perform on an external data source accessible via a network, the external data source being hosted by an external system separate from a network-based database system. The subject technology determines a set of shards corresponding to the external data source. The subject technology determines a set of offsets of each shard of the set of shards. The subject technology, based on the set of shards and the set of offsets, performs the operation on the external data source. The subject technology provides an indication that the operation is complete.

## Claims

### Claim 1

A network-based database system comprising:
at least one hardware processor; and
a memory storing instructions that cause the at least one hardware processor to perform operations comprising:
receiving an operation to perform on an external data source accessible via a network, the external data source being hosted by an external system separate from the network-based database system, the operation comprising a query statement on the external data source, the query statement comprising a write operation;
initializing a connection to the external data source using an external integration to establish the connection to the external data source, the external integration including security and configuration information, the security and configuration information comprising a retry timeout;
determining, using the connection to the external data source, a set of shards stored in the external data source;
determining a set of offsets of each shard of the set of shards;
based on the set of shards and the set of offsets, performing the operation on the external data source by performing, using the connection to the external data source established via the external integration, the write operation from the query statement on the external data source, the external data source being different than a storage platform associated with the network-based database system;
receiving an indication from the external data source that the write operation was successful; and
storing a second indication that the write operation is completed on the storage platform associated with the network-based database system.

### Claim 2 (depends on 1)

The network-based database system of claim 1, wherein:
performing the write operation is based on executing a statement, the statement comprising a stream name, the stream name associated with the external data source different than the storage platform associated with the network-based database system,
the security and configuration information further comprises at least one of a maximum number of offsets to process, a topic name, a shard number, or a request timeout,
and wherein the operations further comprise:
generating a query plan indicating a degree of parallelism based at least in part on a size of the set of offsets, the set of offsets comprising a number of partitions and offsets associated with each of the partitions, the query plan including a serialized stream and a security integration object, the security integration object generating access tokens to access the network-based database system.

### Claim 3 (depends on 2)

The network-based database system of claim 2, wherein performing the operation on the external data source further comprises:
assigning an execution node, from a set of execution nodes, to each shard from the set of shards; and
performing, by the execution node, a read operation on the external data source, wherein the read operation is performed in parallel with at least another execution node from the set of execution nodes.

### Claim 4 (depends on 3)

The network-based database system of claim 3, wherein the operations further comprise:
receiving, by the execution node, data from the external data source; and
storing a set of new offsets on a storage platform.

### Claim 5 (depends on 2)

The network-based database system of claim 2, wherein performing the operation on the external data source further comprises:
assigning an execution node, from a set of execution nodes, to each shard from the set of shards; and
performing, by the execution node, the write operation on the external data source, wherein the write operation is performed in parallel with at least another execution node from the set of execution nodes.

### Claim 6

(canceled)

### Claim 7 (depends on 5)

The network-based database system of claim 5, wherein the operations further comprise:
receiving, by the execution node, an indication from the external data source that the write operation was not successful; and
performing a rollback of the write operation, wherein the rollback avoids committing the write operation to a storage platform associated with the network-based database system.

### Claim 8 (depends on 5)

The network-based database system of claim 5, wherein each execution node from the set of execution nodes includes a processor.

### Claim 9 (depends on 5)

The network-based database system of claim 5, wherein each execution node from the set of execution nodes is assigned to a same user.

### Claim 10 (depends on 1)

The network-based database system of claim 1, wherein determining a set of offsets comprises:
identifying offsets from a previous time that an external stream was accessed during a prior transaction and the offsets from the previous time were previously stored upon completion of the prior transaction.

### Claim 11 (depends on 1)

The network-based database system of claim 1, wherein the external data source comprises an external data stream platform.

### Claim 12

A method comprising:
receiving, using at least one hardware processor, an operation to perform on an external data source accessible via a network, the external data source being hosted by an external system separate from a network-based database system, the operation comprising a query statement on the external data source, the query statement comprising a write operation;
initializing, using the at least one hardware processor, a connection to the external data source using an external integration to establish the connection to the external data source, the external integration including security and configuration information, the security and configuration information comprising a retry timeout;
determining, using the at least one hardware processor and the connection to the external data source, a set of shards stored in the external data source;
determining, using the at least one hardware processor, a set of offsets of each shard of the set of shards;
based on the set of shards and the set of offsets, performing, using the connection to the external data source established via the external integration, the operation on the external data source by performing the write operation from the query statement on the external data source, the external data source being different than a storage platform associated with the network-based database system;
receiving an indication from the external data source that the write operation was successful; and
storing a second indication that the write operation is completed on the storage platform associated with the network-based database system.

### Claim 13 (depends on 12)

The method of claim 12, wherein:
the security and configuration information further comprises at least one of a maximum number of offsets to process, a topic name, a shard number, or a request timeout.

### Claim 14 (depends on 13)

The method of claim 13, wherein performing the operation on the external data source further comprises:
assigning an execution node, from a set of execution nodes, to each shard from the set of shards; and
performing, by the execution node, a read operation on the external data source, wherein the read operation is performed in parallel with at least another execution node from the set of execution nodes.

### Claim 15 (depends on 14)

The method of claim 14, further comprising:
receiving, by the execution node, data from the external data source; and
storing a set of new offsets on a storage platform.

### Claim 16 (depends on 13)

The method of claim 13, wherein performing the operation on the external data source further comprises:
assigning an execution node, from a set of execution nodes, to each shard from the set of shards; and
performing, by the execution node, the write operation on the external data source, wherein the write operation is performed in parallel with at least another execution node from the set of execution nodes.

### Claim 17

(canceled)

### Claim 18 (depends on 16)

The method of claim 16, further comprising:
receiving, by the execution node, an indication from the external data source that the write operation was not successful; and
performing a rollback of the write operation, wherein the rollback avoids committing the write operation to a storage platform associated with the method.

### Claim 19 (depends on 16)

The method of claim 16, wherein each execution node from the set of execution nodes is assigned to a same user.

### Claim 20 (depends on 12)

The method of claim 12, wherein the external data source comprises an external data stream platform.

### Claim 21

A non-transitory computer-storage medium comprising instructions that, when executed by a processing device, configure the processing device to perform operations comprising:
receiving an operation to perform on an external data source accessible via a network, the external data source being hosted by an external system separate from a network-based database system, the operation comprising a query statement on the external data source, the query statement comprising a write operation;
initializing a connection to the external data source using an external integration to establish the connection to the external data source, the external integration including security and configuration information, the security and configuration information comprising a retry timeout;
determining, using the connection to the external data source, a set of shards stored in the external data source;
determining a set of offsets of each shard of the set of shards;
based on the set of shards and the set of offsets, performing the operation on the external data source by performing, using the connection to the external data source established via the external integration, the write operation from the query statement on the external data source, the external data source being different than a storage platform associated with the network-based database system;
receiving an indication from the external data source that the write operation was successful; and
storing a second indication that the write operation is completed on the storage platform associated with the network-based database system.

### Claim 22 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein the security and configuration information further comprises at least one of a maximum number of offsets to process, a topic name, a shard number, or a request timeout.

### Claim 23 (depends on 22)

The non-transitory computer-storage medium of claim 22, wherein performing the operation on the external data source further comprises:
assigning an execution node, from a set of execution nodes, to each shard from the set of shards; and
performing, by the execution node, a read operation on the external data source, wherein the read operation is performed in parallel with at least another execution node from the set of execution nodes.

### Claim 24 (depends on 23)

The non-transitory computer-storage medium of claim 23, wherein the operations further comprise:
receiving, by the execution node, data from the external data source; and
storing a set of new offsets on a storage platform.

### Claim 25 (depends on 22)

The non-transitory computer-storage medium of claim 22, wherein the operations further comprise:
assigning an execution node, from a set of execution nodes, to each shard from the set of shards; and
performing, by the execution node, the write operation on the external data source, wherein the write operation is performed in parallel with at least another execution node from the set of execution nodes.

### Claim 26

(canceled)

### Claim 27 (depends on 25)

The non-transitory computer-storage medium of claim 25, wherein the operations further comprise:
receiving, by the execution node, an indication from the external data source that the write operation was not successful; and
performing a rollback of the write operation, wherein the rollback avoids committing the write operation to a storage platform associated with the non-transitory computer-storage medium.

### Claim 28 (depends on 25)

The non-transitory computer-storage medium of claim 25, wherein each execution node from the set of execution nodes includes a processor.

### Claim 29 (depends on 25)

The non-transitory computer-storage medium of claim 25, wherein each execution node from the set of execution nodes is assigned to a same user.

### Claim 30 (depends on 21)

The non-transitory computer-storage medium of claim 21, wherein the external data source comprises an external data stream platform.
