# Snowflake Streaming Loader
> Load Snowplow events to Snowflake with sub-minute latency from Kinesis, Pub/Sub, or Kafka using Snowpipe Streaming.
> Source: https://docs.snowplow.io/docs/api-reference/loaders-storage-targets/snowflake-streaming-loader/
> Documentation index: https://docs.snowplow.io/llms.txt

The Snowflake Streaming Loader is an application that loads Snowplow events to Snowflake.

> **Tip: Streaming Loader or RDB Loader?**
>
> Both [Snowflake Streaming Loader](/docs/api-reference/loaders-storage-targets/snowflake-streaming-loader/) and [RDB Loader](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/) can load data into Snowflake.
>
> Snowflake Streaming Loader is newer and has two advantages:
>
> - Much lower latency — you can get data in Snowflake in seconds, as opposed to minutes with RDB Loader
> - Much lower cost — unlike with RDB Loader, there is no need for EMR and extensive Snowflake compute to load batch files
>
> We recommend the Streaming Loader over the RDB Loader. If you already use RDB Loader, see the [migration guide](/docs/api-reference/loaders-storage-targets/snowflake-streaming-loader/migrating/) for more information.

**AWS:**

On AWS, the Snowflake Streaming Loader continually pulls events from Kinesis and writes to Snowflake using the [Snowpipe Streaming API](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview).

```mermaid
flowchart LR
stream[["<b>Enriched Events</b>
(Kinesis stream)"]]
loader{{"<b>Snowflake Streaming Loader</b>"}}
subgraph snowflake [Snowflake]
  table[("<b>Events table</b>")]
end
stream-->loader-->|Snowpipe Streaming API|snowflake
```

The Snowflake Streaming Loader is published as a Docker image which you can run on any AWS VM. You do not need a Spark cluster to run this loader.

```bash
docker pull snowplow/snowflake-loader-kinesis:0.6.2
```

To run the loader, mount your config file into the docker image, and then provide the file path on the command line. We recommend setting the `SNOWFLAKE_PRIVATE_KEY` environment variable so that you can refer to it in the config file.

```bash
docker run \
--mount=type=bind,source=/path/to/myconfig,destination=/myconfig \
--env SNOWFLAKE_PRIVATE_KEY="${SNOWFLAKE_PRIVATE_KEY}" \
snowplow/snowflake-loader-kinesis:0.6.2 \
--config=/myconfig/loader.hocon
```

**GCP:**

On GCP, the Snowflake Streaming Loader continually pulls events from Pub/Sub and writes to Snowflake using the [Snowpipe Streaming API](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview).

```mermaid
flowchart LR
stream[["<b>Enriched Events</b>
(Pub/Sub stream)"]]
loader{{"<b>Snowflake Streaming Loader</b>"}}
subgraph snowflake [Snowflake]
  table[("<b>Events table</b>")]
end
stream-->loader-->|Snowpipe Streaming API|snowflake
```

The Snowflake Streaming Loader is published as a Docker image which you can run on any GCP VM. You do not need a Spark cluster to run this loader.

```bash
docker pull snowplow/snowflake-loader-pubsub:0.6.2
```

To run the loader, mount your config file into the docker image, and then provide the file path on the command line. We recommend setting the `SNOWFLAKE_PRIVATE_KEY` environment variable so that you can refer to it in the config file.

```bash
docker run \
--mount=type=bind,source=/path/to/myconfig,destination=/myconfig \
--env SNOWFLAKE_PRIVATE_KEY="${SNOWFLAKE_PRIVATE_KEY}" \
snowplow/snowflake-loader-pubsub:0.6.2 \
--config=/myconfig/loader.hocon
```

**Azure:**

On Azure, the Snowflake Streaming Loader continually pulls events from Kafka and writes to Snowflake using the [Snowpipe Streaming API](https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview).

```mermaid
flowchart LR
stream[["<b>Enriched Events</b>
(Kafka stream)"]]
loader{{"<b>Snowflake Streaming Loader</b>"}}
subgraph snowflake [Snowflake]
  table[("<b>Events table</b>")]
end
stream-->loader-->|Snowpipe Streaming API|snowflake
```

The Snowflake Streaming Loader is published as a Docker image which you can run on any Azure VM. You do not need a Spark cluster to run this loader.

```bash
docker pull snowplow/snowflake-loader-kafka:0.6.2
```

To run the loader, mount your config file into the docker image, and then provide the file path on the command line. We recommend setting the `SNOWFLAKE_PRIVATE_KEY` environment variable so that you can refer to it in the config file.

```bash
docker run \
--mount=type=bind,source=/path/to/myconfig,destination=/myconfig \
--env SNOWFLAKE_PRIVATE_KEY="${SNOWFLAKE_PRIVATE_KEY}" \
snowplow/snowflake-loader-kafka:0.6.2 \
--config=/myconfig/loader.hocon
```

***

## Configuring the loader

The loader config file is in HOCON format, and it allows configuring many different properties of how the loader runs.

The simplest possible config file just needs a description of your pipeline inputs and outputs:

**AWS:**

```hocon
loading...
```

[View on GitHub](<https://github.com/snowplow-incubator/snowplow-snowflake-loader/blob/main/config/config.kinesis.minimal.hocon&#xA;>)

**GCP:**

```hocon
loading...
```

[View on GitHub](<https://github.com/snowplow-incubator/snowplow-snowflake-loader/blob/main/config/config.pubsub.minimal.hocon&#xA;>)

**Azure:**

```hocon
loading...
```

[View on GitHub](<https://github.com/snowplow-incubator/snowplow-snowflake-loader/blob/main/config/config.azure.minimal.hocon&#xA;>)

***

See the [configuration reference](/docs/api-reference/loaders-storage-targets/snowflake-streaming-loader/configuration-reference/) for all possible configuration parameters.
