# Understanding Loading Behavior

Learn about the methods Stitch uses to load data into your destination and what the impact will be on your destination tables.

In this guide, we’ll cover:

* [The loading behavior types Stitch supports](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#loading-behavior-types)

* [How loading behavior is determined](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#loading-behavior-determined)

* [Examples of each loading behavior type](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#examples)

* [References lists for destinations, integrations, and loading behavior](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#reference)

## Loading behavior types

When data is loaded into your destination, Stitch will use one of the following loading behavior types:

* [Upsert](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#loading-behavior-types--upsert)

* [Append-Only](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#loading-behavior-types--append-only)

### Upsert

When data is loaded using the Upsert behavior, existing rows are updated in tables with defined Primary Keys. Stitch will de-dupe records based on Primary Keys before loading them, meaning that only one version of a record will exist in the table at any given time.

### Append-Only

When data is loaded using the Append-Only behavior, records are appended to the end of the table as new rows. Existing rows in the table aren’t updated even if the source has defined Primary Keys. Multiple versions of a row can exist in a table, creating a log of how a record has changed over time.

## Determining loading behavior

At a high level, loading behavior is determined by the following:

* The destination’s support for Upsert loading
* The presence of Primary Keys in the source data and destination
* The integration or table has pre-configured loading behavior

### Upsert loading

Upsert loading is used when **all** of the following conditions are met:

1. The destination supports or is configured to use Upsert loading, **and**
2. The data has defined Primary Keys in the source **and** destination, **and**
3. The integration or table is not pre-configured to use Append-Only loading

**Note**: This is applicable to all [Replication Methods](https://help.qlik.com/en-US/stitch/replication/replication-methods).

### Append-Only loading

Append-Only loading is used when **any** of the following conditions are met:

* The destination only supports or is configured to use Append-Only loading, **or**
* The data doesn’t have defined Primary Keys in the source **or** destination, **or**
* The integration or table is pre-configured to use Append-Only loading

## Examples

* [Upsert loading example](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#example--upsert-loading)

* [Append-Only example](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#example--append-only-loading)

* [Append-Only loading, no defined source Primary keys](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#example--append-only--no-primary-keys)

### Upsert loading example

In this example:

1. The destination supports **or** is configured to use Upsert loading, and
2. The data has defined Primary Keys in the source and destination, and
3. The integration or table being loaded is not pre-configured to use Append-Only loading

[![Click to enlarge: Upsert loading example](https://help.qlik.com/en-US/stitch/images/replication/upsert-loading-example.png)Click to enlarge: Upsert loading exampleClick to enlarge: Upsert loading example](https://help.qlik.com/en-US/stitch/images/replication/upsert-loading-example.png)![Click to enlarge: Upsert loading example](https://help.qlik.com/en-US/stitch/images/replication/upsert-loading-example.png)Click to enlarge: Upsert loading exampleClick to enlarge: Upsert loading exampleClick to enlarge: Upsert loading example

### Append-Only example

This example is applicable **any** of the following are true:

* The destination only supports **or** is configured to use Append-Only loading, **or**
* The integration or table being loaded is pre-configured to use Append-Only loading, **or**
* The source data has defined Primary Keys, but the table in the destination doesn’t. For example: Primary Key table comments are removed from a table in Amazon Redshift.

[![Click to enlarge: Append-Only loading example](https://help.qlik.com/en-US/stitch/images/replication/append-only-loading.png)Click to enlarge: Append-Only loading exampleClick to enlarge: Append-Only loading example](https://help.qlik.com/en-US/stitch/images/replication/append-only-loading.png)![Click to enlarge: Append-Only loading example](https://help.qlik.com/en-US/stitch/images/replication/append-only-loading.png)Click to enlarge: Append-Only loading exampleClick to enlarge: Append-Only loading exampleClick to enlarge: Append-Only loading example

### Append-Only loading, no defined source Primary keys

This example is applicable when the source data doesn’t have a defined Primary Key.

When source data that doesn’t have a Primary Key is replicated, Stitch appends an `__sdc_primary_key` to the data to function as a Primary Key. Data will be loaded using Append-Only loading, regardless of what loading behavior the destination supports or is configured to use.

[![Click to enlarge: Append-Only loading as a result of no defined Primary Keys](https://help.qlik.com/en-US/stitch/images/replication/append-only-no-primary-key.png)Click to enlarge: Append-Only loading as a result of no defined Primary KeysClick to enlarge: Append-Only loading as a result of no defined Primary Keys](https://help.qlik.com/en-US/stitch/images/replication/append-only-no-primary-key.png)![Click to enlarge: Append-Only loading as a result of no defined Primary Keys](https://help.qlik.com/en-US/stitch/images/replication/append-only-no-primary-key.png)Click to enlarge: Append-Only loading as a result of no defined Primary KeysClick to enlarge: Append-Only loading as a result of no defined Primary KeysClick to enlarge: Append-Only loading as a result of no defined Primary Keys

## Reference

* [Destinations and default loading behavior](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#reference--destinations-loading-behavior)

* [Append-Only integrations and tables](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#reference--append-only-integrations)

### Destinations and default loading behavior

**Note**: If a destination supports and is configured to use Upsert loading, Stitch will attempt to use Upsert loading before Append-Only. All [other conditions for Upsert loading](https://help.qlik.com/en-US/stitch/replication/loading/understanding-loading-behavior#upsert-loading-conditions) must also be met.

| **Destination** | **Version** | **Default loading behavior** | **Loading behavior is configurable?** |
| --- | --- | --- | --- |
| Amazon Redshift | v2 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| Amazon S3 | v1 | Append-Only | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| data.world | v1 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| Databricks Delta Lake (AWS) | v1 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| Google BigQuery | v1 | Append-Only | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| Google BigQuery | v2 | Selected by you | the Success icon<br><br>Loading behavior is configurable for this destination and version. |
| Microsoft Azure Synapse Analytics | v1 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| Microsoft SQL Server | v1 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| MySQL | v1 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| Panoply | v2 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| PostgreSQL | v1 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |
| Snowflake | v1 | Upsert | the Remove icon<br><br>Loading behavior is not configurable for this destination and version. |

### Append-Only integrations and tables

The integrations listed below are pre-configured to use Append-Only loading for all or some tables.

| **Integration** | **Version** | **Notes** |
| --- | --- | --- |
| Amazon S3 CSV | v1 | Unless Primary Keys are defined for the table, Append-Only loading will be used. |
| Campaign Manager | v1 | All tables use Append-Only loading |
| Google Ads | v2 | All Report tables |
| Google Ads (AdWords) | v1 | All Report tables |
| Microsoft Advertising | v2 | All Report tables |
| SFTP | v1 | Unless Primary Keys are defined for the table, Append-Only loading will be used. |