|
| 1 | +--- |
| 2 | +title: Reverse ETL |
| 3 | +beta: true |
| 4 | +--- |
| 5 | + |
| 6 | +> info "" |
| 7 | +> Reverse ETL is currently in beta and Segment is actively working on this feature. Segment's [First-Access and Beta terms](https://segment.com/legal/first-access-beta-preview/) govern this feature. If you’d like to join the beta, please reach out to your CSM, AE, or SE to learn more. |
| 8 | +
|
| 9 | +Reverse ETL (Extract, Transform, Load) is a directional version of ETL that extracts data from a data warehouse and loads it into a 3rd party destination. Reverse ETL allows you to connect your data warehouse to the tools that Marketing, Sales, Support, Product, Analytics, and other business teams use. For example, with Reverse ETL, you can sync rows from Snowflake to Salesforce. This enables your warehouse to remain the single source of truth in which all data is collected, operated on, and enriched. |
| 10 | + |
| 11 | +As Segment is actively developing this feature, Segment welcomes your feedback on your experience with Reverse ETL. Click the button below to submit your feedback. |
| 12 | + |
| 13 | +{% include components/button-fill.html modifier="expand" text="Submit feedback" href=" https://airtable.com/shrdu5cW06LsuZvXN" %} |
| 14 | + |
| 15 | +## Use cases |
| 16 | +Use Reverse ETL when you want to: |
| 17 | +* Sync lead scores created in the warehouse to Salesforce |
| 18 | +* Connect Google Sheets to a view in the warehouse for up-to-date reports that can also be downloaded as CSVs. |
| 19 | +* Sync enriched data to Amplitude or Mixpanel for a more complete view than what Segment events provides. |
| 20 | +* Sync audiences and other data built in the warehouse to Braze, Iterable, or Hubspot or Salesforce Marketing Cloud for marketing campaigns. |
| 21 | +* Turn data in the warehouse from sources that can’t be instrumented by Segment back into Segment as events for Personas and other use cases. |
| 22 | +* Pass offline or enriched data to conversion APIs like Facebook, Google Ads, TikTok, Snapchat. |
| 23 | + |
| 24 | +## Getting started |
| 25 | +There are four components to Reverse ETL: Sources, Models, Destinations, and Mappings. |
| 26 | + |
| 27 | +![image from Charmaine to go here] |
| 28 | + |
| 29 | +Follow these 4 steps to set up Reverse ETL and learn what each component is about: |
| 30 | +1. [Add a Source](#step-1-add-a-source) |
| 31 | +2. [Add a Model](#step-2-add-a-model) |
| 32 | +3. [Add a Destination](#step-3-add-a-destination) |
| 33 | +4. [Create Mappings](#step-4-create-mappings) |
| 34 | + |
| 35 | +### Step 1: Add a Source |
| 36 | +A Source is where your data originates from. Traditionally in Segment, a [Source](/docs/connections/sources/#what-is-a-source) is a website, server library, mobile SDK, or cloud application which can send data into Segment. In Reverse ETL, your data warehouse acts as the Source. |
| 37 | + |
| 38 | +> info "" |
| 39 | +> Reverse ETL currently only supports BigQuery and Snowflake as sources. |
| 40 | +
|
| 41 | +To add your warehouse as a source: |
| 42 | + |
| 43 | +> warning "" |
| 44 | +> You need to be a user that has both read and write access to the warehouse. |
| 45 | +
|
| 46 | +1. Navigate to **Reverse ETL** in the Segment app. |
| 47 | +2. Click **Add Source**. |
| 48 | +3. Select the source you want to add. You can choose between **BigQuery** and **Snowflake**. |
| 49 | + * If you choose to use Snowflake, run the queries listed in the [Snowflake setup guide](/docs/reverse-etl/snowflake-setup/) to set up the Segment Snowflake connector. Segment recommends using the `ACCOUNTADMIN` role to execute all the commands. |
| 50 | + * If you choose to use BigQuery, use the permissions outlined in the [BigQuery setup guide](/docs/reverse-etl/bigquery-setup/), to create a Service Account and generate JSON credentials that will then be copied into the Segment UI when creating a Reverse ETL Source. |
| 51 | +4. Add in the account information for your source. |
| 52 | +5. Click **Test Connection** to test to see if the connection works. |
| 53 | +6. Click **Create Source** if the test connection is successful. |
| 54 | + |
| 55 | +After you add your data warehouse as a source, you can [add a model](#step-2-add-a-model) to your source. |
| 56 | + |
| 57 | +### Step 2: Add a Model |
| 58 | +Models are SQL queries that define sets of data you want to synchronize to your Reverse ETL destinations. After you add your source, you can add a model. |
| 59 | + |
| 60 | +To add a model: |
| 61 | +1. Navigate to **Reverse ETL > Sources** and click **Add Model**. |
| 62 | +2. Click **SQL Editor** as your modeling method. (Note: Segment will add more modeling methods in the future) |
| 63 | +3. Enter the SQL query that’ll define your model. Your model is used to map data to your Reverse ETL destinations. |
| 64 | +4. Choose a column to use as the unique identifier for each row in the **Unique Identifier column** field. This column is used to detect new, updated, and deleted rows. |
| 65 | +5. Click **Preview** to see a preview of the results of your SQL query. The data from the preview is extracted from the first 10 rows of your warehouse. |
| 66 | +6. Click **Next**. |
| 67 | +7. Enter your **Model Name**. |
| 68 | +8. Select the Schedule type for the times you want the model’s data to be extracted from your warehouse. You can choose from: |
| 69 | + * **Interval**: Extractions perform based on a selected time cycle. |
| 70 | + * **Day and time**: Extractions perform at specific times on selected days of the week. |
| 71 | +9. Select how often you want the schedule to run in **Schedule configuration**. |
| 72 | + * For an **Interval** schedule type, you can choose from: 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 6 hours, 8 hours, 12 hours, 1 day. |
| 73 | + * 15 minutes is considered real-time for warehouse syncs |
| 74 | + * For a **Day and time** schedule type, you can choose the day(s) you’d like the schedule to run as well as the time. You can only choose to run the extraction at the top of the hour. |
| 75 | +10. Click **Create Model**. |
| 76 | + |
| 77 | +### Step 3: Add a Destination |
| 78 | +Once you’ve added a model, you need to add a destination. In Reverse ETL, destinations are the business tools or apps you use that Segment syncs the data from your warehouse to. |
| 79 | + |
| 80 | +> info "" |
| 81 | +> Reverse ETL only supports [Actions destinations](/docs/connections/destinations/actions/). Depending on the destination, you may need to know certain endpoints and have specific credentials to add the destination. |
| 82 | +
|
| 83 | +To add a destination: |
| 84 | +1. Navigate to **Reverse ETL > Destinations**. |
| 85 | +2. Click **Add Destination**. |
| 86 | +3. Select the destination you want to connect to. |
| 87 | +4. Select the source you want to connect the destination to. |
| 88 | +5. Enter the **Destination name** and click **Create Destination**. |
| 89 | +6. Enter the required information on the **Settings** tab of the destination. |
| 90 | + |
| 91 | +### Step 4: Create Mappings |
| 92 | +After you’ve added a destination, you can create mappings from your warehouse to the destination. Mappings enable you to map the data you extract from your warehouse to the fields in your destination. |
| 93 | + |
| 94 | +To create a mapping: |
| 95 | +1. Go to the **Mappings** tab of the destination and click **Add Mapping**. |
| 96 | +2. Select the model to sync from. |
| 97 | +3. Select the **Action** you want to sync and click **Next**. |
| 98 | + * Actions determine the information sent to the destination. You map the fields that come from your source, to fields that the destination expects to find. Fields on the destination side depend on the type of action selected. |
| 99 | +4. In the **Select record to map and send** section, select which records to send to your destination after Segment completes extracting data based on your model. You can choose from: |
| 100 | + * Added records |
| 101 | + * Updated records |
| 102 | + * Added or updated records |
| 103 | + * Deleted records |
| 104 | +5. Select a test record to preview the fields that you can map to your destination in the **Add test record** field. |
| 105 | +6. Define how to map the record columns from your model to your destination in the **Select Mappings** section. |
| 106 | +7. Click **Create Mapping**. |
| 107 | +8. Select the destination you’d like to enable on the **My Destinations** page under **Reverse ETL > Destinations**. |
| 108 | +9. Turn the toggle on for the **Mapping State** to enable the destination. Events that match the trigger condition in the mapping will be sent to the destination. |
| 109 | + * If you disable the mapping state to the destination, events that match the trigger condition in the mapping won’t be sent to the destination. |
| 110 | + |
| 111 | +## Using Reverse ETL |
| 112 | +After you've followed [all four steps](/docs/reverse-etl/reverse-etl/#getting-started) and set up your source, model, destination, and mappings for Reverse ETL, your data will extract and will sync to your destination(s) right away if you chose an interval schedule. If you set your data to extract at a specific day and time, the extraction will take place then. |
| 113 | + |
| 114 | +### Run statuses |
| 115 | +You can check the status of your data extractions and see details of your runs. |
| 116 | + |
| 117 | +To check the status of your extractions: |
| 118 | +1. Navigate to **Reverse ETL > Destinations**. |
| 119 | +2. Select the destination you want to view. |
| 120 | +3. Select the mapping you want to view. |
| 121 | +4. Click the run you want to view to get details of the run. You can view: |
| 122 | + * The status of the run |
| 123 | + * How long it took for the run to complete |
| 124 | + * The load results - how many successful records were synced as well as how many records were updated, deleted, or are new. |
| 125 | + |
| 126 | + |
| 127 | +### Edit your model |
| 128 | + |
| 129 | +To edit your model: |
| 130 | +1. Navigate to **Reverse ETL > Sources**. |
| 131 | +2. Select the source with the model you want to edit. |
| 132 | +3. On the overview tab, click **Edit** to edit your query. |
| 133 | +4. Click the **Settings** tab to edit the model name or change the schedule settings. |
| 134 | + |
| 135 | +### Edit your mapping |
| 136 | + |
| 137 | +To edit your mapping: |
| 138 | +1. Navigate to **Reverse ETL > Destinations**. |
| 139 | +2. Select the destination with the mapping you want to edit. |
| 140 | +3. Select the **...*** three dots and click **Edit mapping**. If you want to delete your mapping, select **Delete**. |
0 commit comments