# What is deployed in the Self-Hosted Quick Start?
> Overview of Snowplow pipeline infrastructure components deployed by Terraform including collector, enrichment, and loader modules.
> Source: https://docs.snowplow.io/docs/get-started/self-hosted/what-is-deployed/
> Documentation index: https://docs.snowplow.io/llms.txt

Let’s take a look at what is deployed when you follow the quick start guide.

> **Tip:** You can very easily edit the script or run each of the Terraform modules independently, giving you the flexibility to design the topology of your pipeline according to your needs.

## Overview

**AWS:**

**Redshift:**

#### The main components of the pipeline

```mermaid
flowchart LR
collect{{"<b>Collector</b>
<i>stream-collector app</i>
(EC2)"}}
enrich{{"<b>Enrich</b>
<i>enrich-kinesis app</i>
(EC2)"}}
iglu{{"<b>Iglu Server</b>
(EC2)"}}
igludb[("<b>Iglu Database</b>
(RDS)")]
bad[["<b>Bad Stream</b>
(Kinesis)"]]
loader("<b>Redshift Loader</b>
<i>(see below)</i>")
atomic[("<b>Events</b>
(Redshift)")]
collect---iglu
%% above line is an invisible link for alignment
enrich-.-oiglu<-.->igludb
collect-->|"<b>Raw Stream</b><br/>(Kinesis)"| enrich
enrich-->|"<b>Enriched Stream</b><br/>(Kinesis)"| loader-->atomic
collect & enrich -.->|<i>events that<br/>fail validation</i>| bad
loader -.->|<i>events that<br/>fail loading</i>| bad
linkStyle 0 stroke:none,fill:none
```

#### Archival and failed events

```mermaid
flowchart LR
      good[["<b>Enriched Stream</b>
(Kinesis)"]]
        blobloadergood{{"<b>S3 Loader Good</b>
(EC2)"}}
        blobgood[("<b>Enriched Events</b>
(S3)")]
        good-->blobloadergood-->blobgood
        bad[["<b>Bad Stream</b>
(Kinesis)"]]
        blobloaderbad{{"<b>S3 Loader Bad</b>
(EC2)"}}
        blobbad[("<b>Failed Events</b>
(S3)")]
        bad-->blobloaderbad-->blobbad
```

#### Redshift Loader

For more information about the Redshift Loader, see the [loader documentation](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/?warehouse=redshift).

**Snowflake:**

#### The main components of the pipeline

```mermaid
flowchart LR
collect{{"<b>Collector</b>
<i>stream-collector app</i>
(EC2)"}}
enrich{{"<b>Enrich</b>
<i>enrich-kinesis app</i>
(EC2)"}}
iglu{{"<b>Iglu Server</b>
(EC2)"}}
igludb[("<b>Iglu Database</b>
(RDS)")]
bad[["<b>Bad Stream</b>
(Kinesis)"]]
loader("<b>Snowflake Loader</b>
<i>(see below)</i>")
atomic[("<b>Events</b>
(Snowflake)")]
collect---iglu
%% above line is an invisible link for alignment
enrich-.-oiglu<-.->igludb
collect-->|"<b>Raw Stream</b><br/>(Kinesis)"| enrich
enrich-->|"<b>Enriched Stream</b><br/>(Kinesis)"| loader-->atomic
collect & enrich -.->|<i>events that<br/>fail validation</i>| bad
loader -.->|<i>events that<br/>fail loading</i>| bad
linkStyle 0 stroke:none,fill:none
```

#### Archival and failed events

```mermaid
flowchart LR
      good[["<b>Enriched Stream</b>
(Kinesis)"]]
        blobloadergood{{"<b>S3 Loader Good</b>
(EC2)"}}
        blobgood[("<b>Enriched Events</b>
(S3)")]
        good-->blobloadergood-->blobgood
        bad[["<b>Bad Stream</b>
(Kinesis)"]]
        blobloaderbad{{"<b>S3 Loader Bad</b>
(EC2)"}}
        blobbad[("<b>Failed Events</b>
(S3)")]
        bad-->blobloaderbad-->blobbad
```

#### Snowflake Loader

For more information about the Snowflake Loader, see the [loader documentation](/docs/api-reference/loaders-storage-targets/snowflake-streaming-loader/).

**Databricks:**

#### The main components of the pipeline

```mermaid
flowchart LR
collect{{"<b>Collector</b>
<i>stream-collector app</i>
(EC2)"}}
enrich{{"<b>Enrich</b>
<i>enrich-kinesis app</i>
(EC2)"}}
iglu{{"<b>Iglu Server</b>
(EC2)"}}
igludb[("<b>Iglu Database</b>
(RDS)")]
bad[["<b>Bad Stream</b>
(Kinesis)"]]
loader("<b>Databricks Loader</b>
<i>(see below)</i>")
atomic[("<b>Events</b>
(Databricks)")]
collect---iglu
%% above line is an invisible link for alignment
enrich-.-oiglu<-.->igludb
collect-->|"<b>Raw Stream</b><br/>(Kinesis)"| enrich
enrich-->|"<b>Enriched Stream</b><br/>(Kinesis)"| loader-->atomic
collect & enrich -.->|<i>events that<br/>fail validation</i>| bad
loader -.->|<i>events that<br/>fail loading</i>| bad
linkStyle 0 stroke:none,fill:none
```

#### Archival and failed events

```mermaid
flowchart LR
      good[["<b>Enriched Stream</b>
(Kinesis)"]]
        blobloadergood{{"<b>S3 Loader Good</b>
(EC2)"}}
        blobgood[("<b>Enriched Events</b>
(S3)")]
        good-->blobloadergood-->blobgood
        bad[["<b>Bad Stream</b>
(Kinesis)"]]
        blobloaderbad{{"<b>S3 Loader Bad</b>
(EC2)"}}
        blobbad[("<b>Failed Events</b>
(S3)")]
        bad-->blobloaderbad-->blobbad
```

#### Databricks Loader

For more information about the Databricks Loader, see the [loader documentation](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/?warehouse=databricks).

***

**GCP:**

**BigQuery:**

#### The main components of the pipeline

```mermaid
flowchart LR
collect{{"<b>Collector</b>
<i>stream-collector app</i>
(CE)"}}
enrich{{"<b>Enrich</b>
<i>enrich-pub/sub app</i>
(CE)"}}
iglu{{"<b>Iglu Server</b>
(CE)"}}
igludb[("<b>Iglu Database</b>
(CloudSQL)")]
bad[["<b>Bad Stream</b>
(Pub/Sub)"]]
loader("<b>BigQuery Loader</b>
<i>(see below)</i>")
atomic[("<b>Events</b>
(BigQuery)")]
collect---iglu
%% above line is an invisible link for alignment
enrich-.-oiglu<-.->igludb
collect-->|"<b>Raw Stream</b><br/>(Pub/Sub)"| enrich
enrich-->|"<b>Enriched Stream</b><br/>(Pub/Sub)"| loader-->atomic
collect & enrich -.->|<i>events that<br/>fail validation</i>| bad
loader -.->|<i>events that<br/>fail loading</i>| bad
linkStyle 0 stroke:none,fill:none
```

#### BigQuery Loader

For more information about the BigQuery Loader, see the [loader documentation](/docs/api-reference/loaders-storage-targets/bigquery-loader/).

***

**Azure:**

**Databricks:**

#### The main components of the pipeline

```mermaid
flowchart LR
collect{{"<b>Collector</b>
<i>stream-collector app</i>
(VMSS)"}}
enrich{{"<b>Enrich</b>
<i>enrich-kafka app</i>
(VMSS)"}}
iglu{{"<b>Iglu Server</b>
(VMSS)"}}
igludb[("<b>Iglu Database</b>
(Postgres)")]
bad[["<b>Bad Stream</b>
(Kafka)"]]
loader{{"<b>Data Lake Loader</b>
(VMSS)"}}
atomic[("<b>Events</b>
(ADLS Gen2)")]
collect---iglu
%% above line is an invisible link for alignment
enrich-.-oiglu<-.->igludb
collect-->|"<b>Raw Stream</b><br/>(Kafka)"| enrich
enrich-->|"<b>Enriched Stream</b><br/>(Kafka)"| loader-->atomic
collect & enrich -.->|<i>events that<br/>fail validation</i>| bad
loader -.->|<i>events that<br/>fail loading</i>| bad
linkStyle 0 stroke:none,fill:none
```

#### Data Lake Loader

For more information about the Data Lake Loader, see the [loader documentation](/docs/api-reference/loaders-storage-targets/lake-loader/).

**Synapse Analytics:**

#### The main components of the pipeline

```mermaid
flowchart LR
collect{{"<b>Collector</b>
<i>stream-collector app</i>
(VMSS)"}}
enrich{{"<b>Enrich</b>
<i>enrich-kafka app</i>
(VMSS)"}}
iglu{{"<b>Iglu Server</b>
(VMSS)"}}
igludb[("<b>Iglu Database</b>
(Postgres)")]
bad[["<b>Bad Stream</b>
(Kafka)"]]
loader{{"<b>Data Lake Loader</b>
(VMSS)"}}
atomic[("<b>Events</b>
(ADLS Gen2)")]
collect---iglu
%% above line is an invisible link for alignment
enrich-.-oiglu<-.->igludb
collect-->|"<b>Raw Stream</b><br/>(Kafka)"| enrich
enrich-->|"<b>Enriched Stream</b><br/>(Kafka)"| loader-->atomic
collect & enrich -.->|<i>events that<br/>fail validation</i>| bad
loader -.->|<i>events that<br/>fail loading</i>| bad
linkStyle 0 stroke:none,fill:none
```

#### Data Lake Loader

For more information about the Data Lake Loader, see the [loader documentation](/docs/api-reference/loaders-storage-targets/lake-loader/).

***

***

## Collector load balancer

This is an application load balancer for your inbound HTTP(S) traffic. Traffic is routed from the load balancer to the Collector instances.

For further details on the resources, default and required input variables, and outputs, see the Terraform module ([AWS](https://registry.terraform.io/modules/snowplow-devops/alb/aws/latest), [GCP](https://registry.terraform.io/modules/snowplow-devops/lb/google/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/lb/azurerm/latest)).

## Collector

This is an application that receives raw Snowplow events over HTTP(S), serializes them, and then writes them to Kinesis (on AWS), Pub/Sub (on GCP) or Kafka / Event Hubs (on Azure). More details can be found [here](/docs/api-reference/stream-collector/).

For further details on the resources, default and required input variables, and outputs, see the Terraform module ([AWS](https://registry.terraform.io/modules/snowplow-devops/collector-kinesis-ec2/aws/latest), [GCP](https://registry.terraform.io/modules/snowplow-devops/collector-pubsub-ce/google/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/collector-event-hub-vmss/azurerm/latest)).

## Enrich

This is an application that reads the raw Snowplow events, validates them (including validation against [schemas](/docs/fundamentals/schemas/)), [enriches](/docs/pipeline/enrichments/) them and writes the enriched events to another stream. More details can be found [here](/docs/api-reference/enrichment-components/).

For further details on the resources, default and required input variables, and outputs, see the Terraform module ([AWS](https://registry.terraform.io/modules/snowplow-devops/enrich-kinesis-ec2/aws/latest), [GCP](https://registry.terraform.io/modules/snowplow-devops/enrich-pubsub-ce/google/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/enrich-event-hub-vmss/azurerm/latest)).

## Iglu

The Iglu stack allows you to manage [schemas](/docs/fundamentals/schemas/).

### Iglu load balancer

This load balances the inbound traffic and routes traffic to the Iglu Server.

For further details on the resources, default and required input variables, and outputs, see the Terraform module ([AWS](https://registry.terraform.io/modules/snowplow-devops/alb/aws/latest), [GCP](https://registry.terraform.io/modules/snowplow-devops/lb/google/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/lb/azurerm/latest)).

### Iglu Server

The [Iglu Server](/docs/api-reference/iglu/iglu-repositories/iglu-server/) serves requests for Iglu schemas stored in your schema registry.

For further details on the resources, default and required input variables, and outputs, see the Terraform module ([AWS](https://registry.terraform.io/modules/snowplow-devops/iglu-server-ec2/aws/latest), [GCP](https://registry.terraform.io/modules/snowplow-devops/iglu-server-ce/google/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/iglu-server-vmss/azurerm/latest)).

### Iglu database

This is the Iglu Server database (RDS on AWS, CloudSQL on GCP and PostgreSQL on Azure) where the Iglu [schemas](/docs/fundamentals/schemas/) themselves are stored.

For further details on the resources, default and required input variables, and outputs, see the Terraform module ([AWS](https://registry.terraform.io/modules/snowplow-devops/rds/aws/latest), [GCP](https://registry.terraform.io/modules/snowplow-devops/cloud-sql/google/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/postgresql-server/azurerm/latest)).

## Streams

The various streams (Kinesis on AWS, Pub/Sub on GCP and Kafka / Event Hubs on Azure) are a key component of ensuring a non-lossy pipeline, providing crucial back-up, as well as serving as a mechanism to drive real time use cases from the enriched stream.

For further details on the resources, default and required input variables, and outputs, see the Terraform module ([AWS](https://registry.terraform.io/modules/snowplow-devops/kinesis-stream/aws/latest), [GCP](https://registry.terraform.io/modules/snowplow-devops/pubsub-topic/google/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/event-hub-namespace/azurerm/latest)).

**AWS only — DynamoDB**

On the first run of each of the applications consuming from Kinesis (e.g. Enrich), the Kinesis Connectors Library creates a DynamoDB table to keep track of what they have consumed from the stream so far. Each Kinesis consumer maintains its own checkpoint information.

The DynamoDB autoscaling module enables autoscaling for a target DynamoDB table. Note that there is a `kcl_write_max_capacity` variable which can be set to your expected RPS, but setting it high will of course incur more cost.

You can find further details in the [DynamoDB Terraform module](https://registry.terraform.io/modules/snowplow-devops/dynamodb-autoscaling/aws/latest).

### Raw stream

Collector payloads are written to the raw stream, before being picked up by the Enrich application.

### Enriched stream

Events that have been validated and enriched by the Enrich application are written to the enriched stream. Depending on your cloud and destination, different loaders pick up the data from this stream, as shown on the diagram [above](#overview).

> **Note: AWS only**
>
> The S3 loader (enriched) also reads from this enriched stream and writes to the enriched folder on S3.

### Bad 1 stream

This bad stream is for [failed events](/docs/fundamentals/failed-events/), which get created when the Collector, Enrich or various loader applications fail to process the data.

### Other streams

**AWS:**

The _Bad 2 stream_ is for failed events generated by the S3 loader as it tries to write from the Bad 1 stream to the bad folder on S3.

If you selected Redshift, Snowflake or Databricks as your destination, the loader will use an extra SQS stream internally as explained in the [reference documentation](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/?cloud=aws).

**GCP:**

If you selected BigQuery as your destination, the _Bad Rows_ stream will contain events that could not be inserted into BigQuery by the loader. This includes data that is not valid against its schema or that is somehow corrupted in a way that the loader cannot handle. In addition, the loader users a few streams internally, as explained in the [reference documentation](/docs/api-reference/loaders-storage-targets/bigquery-loader/previous-versions/bigquery-loader-1.x/).

**Azure:**

No other streams.

***

## Archival and failed events

**AWS:**

Aside from your main destination, the data is written to S3 by the S3 Loader applications for archival and to deal with [failed events](/docs/fundamentals/failed-events/).

See the [S3 Loader](https://registry.terraform.io/modules/snowplow-devops/s3-loader-kinesis-ec2/aws/latest) and [S3](https://registry.terraform.io/modules/snowplow-devops/s3-bucket/aws/latest) Terraform modules for further details on the resources, default and required input variables, and outputs.

The following loaders and folders are available:

- Enriched loader, `enriched/`: enriched events, in GZipped blobs of [enriched TSV](/docs/destinations/custom-streaming/enriched-tsv-format/). Historically, this has been used as the staging ground for loading into data warehouses via the [Batch transformer](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/transforming-enriched-data/spark-transformer/) application. However, it’s no longer used in the quick start examples.
- Bad loader, `bad/`: [failed events](/docs/fundamentals/failed-events/). You can [query them using Athena](/docs/monitoring/exploring-failed-events/file-storage/).

**GCP:**

To store all failed events, you will need to manually deploy the [GCS Loader](/docs/api-reference/loaders-storage-targets/google-cloud-storage-loader/) application.

**Azure:**

Currently, [failed events](/docs/fundamentals/failed-events/) are only available in the `bad` Kafka / Event Hubs topic.

***

## Loaders

**Redshift:**

[RDB Loader](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/) is a set of applications that loads enriched events into Redshift.

See the following Terraform modules for further details on the resources, default and required input variables, and outputs:

- [Transformer Kinesis](https://registry.terraform.io/modules/snowplow-devops/transformer-kinesis-ec2/aws/latest)
- [Redshift Loader](https://registry.terraform.io/modules/snowplow-devops/redshift-loader-ec2/aws/latest)

**BigQuery:**

The [BigQuery Loader](/docs/api-reference/loaders-storage-targets/bigquery-loader/) is a set of applications that loads enriched events into BigQuery.

See the [Terraform module](https://registry.terraform.io/modules/snowplow-devops/bigquery-loader-pubsub-ce/google/latest) for further details on the resources, default and required input variables, and outputs.

There will be a new dataset available in BigQuery with the suffix `_snowplow_db`. Within this dataset, there will be a table called `events` — all of your collected events will be available here generally within a few seconds after they are sent into the pipeline.

**Snowflake:**

[Snowflake Streaming Loader](/docs/api-reference/loaders-storage-targets/snowflake-streaming-loader/) is an application that loads data into Snowflake.

See the following Terraform module for further details on the resources, default and required input variables, and outputs:

- Snowflake Streaming Loader ([AWS](https://registry.terraform.io/modules/snowplow-devops/snowflake-streaming-loader-ec2/aws/latest))

**Databricks (direct):**

[RDB Loader](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/) is a set of applications that loads enriched events into Databricks.

See the following Terraform modules for further details on the resources, default and required input variables, and outputs:

- [Transformer Kinesis](https://registry.terraform.io/modules/snowplow-devops/transformer-kinesis-ec2/aws/latest)
- [Databricks Loader](https://registry.terraform.io/modules/snowplow-devops/databricks-loader-ec2/aws/latest)

**Databricks (via lake):**

[Lake Loader](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/) is an application that loads enriched events into a data lake so that they can be queried via Databricks (or other means).

See the Lake Loader [Terraform module](https://registry.terraform.io/modules/snowplow-devops/lake-loader-vmss/azurerm/latest) for further details on the resources, default and required input variables, and outputs.

The Terraform stack for the pipeline will deploy a storage account and a storage container where the loader will write the data.

**Synapse Analytics:**

[Lake Loader](/docs/api-reference/loaders-storage-targets/snowplow-rdb-loader/) is an application that loads enriched events into a data lake so that they can be queried via Synapse Analytics (or Fabric, OneLake, etc).

See the Lake Loader [Terraform module](https://registry.terraform.io/modules/snowplow-devops/lake-loader-vmss/azurerm/latest) for further details on the resources, default and required input variables, and outputs.

The Terraform stack for the pipeline will deploy a storage account and a storage container where the loader will write the data.

***
