Search documentation...

K

AlloyDB

AlloyDB combines the best of Google with one of the most popular open-source database engines, PostgreSQL, for superior performance, scale, and availability

Setup

Networking

AlloyDB supports network connectivity through private, internal IP addresses configured for private services access. To connect to AlloyDB from Hightouch, configure an SSH connection tunnel to go through a bastion host in your VPC. Read about more options here: https://cloud.google.com/alloydb/docs/connection-overview

Required permissions

The user credentials must have one of the following IAM roles in the Cloud project you are using. If you don't have any of these roles, contact your Organization Administrator to request access.

  • roles/alloydb.admin (the AlloyDB Admin predefined IAM role)
  • roles/owner (the Owner basic IAM role)
  • roles/editor (the Editor basic IAM role)

To create private services access configuration, you also must have these IAM permissions:

  • compute.networks.list
  • compute.addresses.create
  • compute.addresses.list
  • servicenetworking.services.addPeering

To ensure your credentials are correct, click Test connection. This confirms if Hightouch is able to properly connect to your database by running a simple SELECT query.

Syncing

Hightouch supports Upsert mode, with the option to delete removed rows, and Insert mode using the COPY FROM statement.

Record matching

Hightouch requires a unique identifier in the table you are syncing to in order to add, remove, and update rows. The main identifier column in your sync configuration must match on a UNIQUE or PRIMARY KEY column within your database.

You should see those columns as available options under the records matching section. If there are no fields in the dropdown, you need to add a unique column type to your table.

Column types

Hightouch works out of the box with all standard column types, including:

  • BIGINT
  • INT
  • TEXT
  • VARCHAR
  • TIMESTAMPTZ
  • BOOLEAN
  • DECIMAL

If you see type errors, it may be because your SQL query is producing the wrong format.

Hightouch doesn't support arrays of USER-DEFINED types that are JSON objects. We do support arrays of regular JSON objects (JSON or JSONB). right now.

Batch size

You can tune the number of rows that Hightouch upserts or inserts per query based on your needs and database threshold. The default is 1k rows per batch.

If you want to improve the sync's speed performance, you can increase the batch size to a higher number like 10k. However, keep in mind that AlloyDB will fail the entire batch of rows if it detects any erroneous row. If you suspect that you will have many bad rows, you should not have a high batch size. Also make sure you account for your database's capacity when increasing the batch size to avoid any locks.

Insert mode

Hightouch supports insert mode through the COPY FROM STDIN AlloyDB statement. This will load the queried rows into your table. However, AlloyDB will throw an error and reject the entire batch if any row already exists or the row contains a primary key or unique value that already exists.

The COPY FROM statement should be faster than the regular statement we use for Upsert mode so we recommend selecting Insert mode if you are only inserting rows and want to sync your data faster.

The COPY FROM STDIN statement should support the same column types as Upsert mode, but the array of JSONB type (jsonb[]) column. Instead, you will need to use a JSONB column type, which supports an array format.

Ready to get started?

Jump right in or a book a demo. Your first destination is always free.

Book a demoSign upBook a demo

Need help?

Our team is relentlessly focused on your success. Don't hesitate to reach out!

Feature requests?

We'd love to hear your suggestions for integrations and other features.

On this page

SetupNetworkingRequired permissionsSyncingRecord matchingColumn typesBatch sizeInsert mode

Was this page helpful?