Organizations on a paid event-based plan receive Warehouse Connector as a free add-on when they update or renew their plan. Learn more on our pricing page.
To set up Warehouse Connectors, you must have an admin or owner project role. Learn more about Roles and Permissions.
Connect Redshift
- Navigate to Project Settings, then select Warehouse Sources.
-
Click on
+ Add Connectionand select Redshift. -
You should see a new page to create your Redshift connector. In the first view, fill out the following fields before clicking
Next:- AWS Account ID - This is the AWS account ID that can be found in the dropdown in the AWS Redshift Console.
- Cluster ID - This is the name of the Redshift cluster.
-
In the second view, you will need to add the following.
- AWS Region - The region code in which your Redshift cluster resides.
- S3 Staging Bucket - This is the name of S3 staging bucket you need to create. We’ll use it to extract data from your Redshift tables before importing the data into Mixpanel.
- Copy the command generated below in the AWS CLI to create the S3 Staging Bucket with the name you specified.
- Database Name - Input the name of the Database where the tables you want to import are stored.
- (Optional) Policy Name - This is an optional name for the policy, which contains role permissions that you need to grant the Mixpanel Service Account. After inputting a policy name, you can either copy-paste the JSON in the AWS UI or copy-paste the inline command line version that we generate and run in the AWS CLI.
- Role Name - Input the name of the role. After inputting a role name, you can either copy-paste the JSON in the AWS UI or copy-paste the inline command line version that we generate and run in the AWS CLI. Running this command grants the Mixpanel Service Account the necessary permissions to read and export data from your Redshift tables.
- Finally, attach the policy you created to the role you created by copy-pasting the command in the AWS CLI.
- Then, click
Create Source.
-
In the third view, you should see a confirmation that your source was created. To establish the source connection, we need to ping your Redshift instance to actually create the service account user.
- Grant Access to Schema - Enter the name of the schema you want to grant Mixpanel access to.
- Copy the command generated and run it in your Redshift worksheet. Once that command is run successfully, the connection will be established, and you will be able to send data from Redshift tables to Mixpanel.
IP Allowlist
If you are using AWS PrivateLink to restrict access to your instance, you might need to add the following IP addresses to the allowed list. USMirror Mode
Mirror syncs work by having Redshift compute which rows have been inserted, modified, or deleted and sending this list of changes to Mixpanel. Mirror takes Redshift table snapshots and runs queries to compute the change stream between two snapshots using the computed MD5 hash value for each row. Snapshots are stored in a staging schema created during Connect Redshift.- If two rows in the Redshift table are identical across all columns, the md5 hash value Mirror computes for each row will be the same, and Mixpanel will consider them the same row, causing only one copy to appear in Mixpanel. We recommend ensuring that one of your columns is a unique row ID to avoid this.
- The table snapshots managed by Mixpanel are automatically cleaned up. Under normal conditions, Mirror maintains only one snapshot per sync and removes the older run’s snapshot as soon as it has been used by the subsequent sync run. These snapshots will incur some additional storage cost.
Trailing NULL values are excluded from the checksum to ensure that adding new columns does not change the checksum of existing rows. For example, if a new column is added to the example table:
Until values are written to the new column:
Handling schema changes when using Mirror with Redshift:
Adding new, default-NULL columns to Mirror-tracked tables/views is fully supported as described in the previous section.
Considerations when using Mirror with Redshift:
- Currently, only the add-column schema update is supported.
- Geography, Geometry, Varbyte, and hllsketch are not supported currently. If you have a use case that requires support for any of these columns, please contact us for a feature request.
- Any new tables created after the permissions are granted are not automatically accessible by Mixpanel. Please re-grant the necessary permissions to be able to set up Mirror on the tables.
_mp_row_hashand_mp_change_typeare reserved column names used for tracking the computed hash value for each row, and updating the type of the row. Please ensure that this doesn’t conflict with the column names of the table.