IntegrationsDatabasesGoogle Cloud SQL

Google Cloud SQL

Datafly Signal writes first-party events directly to a Google Cloud SQL instance over the native database protocol. Signal connects to Cloud SQL exactly as any application would — via public IP with authorised networks, or via private IP within a VPC.

Variants:

  • google_cloud_sql_postgres — Cloud SQL for PostgreSQL. Uses the PostgreSQL wire protocol.
  • google_cloud_sql_mysql — Cloud SQL for MySQL. Uses the MySQL wire protocol.

For SQL Server on Cloud SQL, use Azure SQL-compatible TDS configuration.

Prerequisites

Before configuring this integration you need a Cloud SQL instance, a target schema/table, a database user, and network connectivity from Signal to the instance.

Create a Cloud SQL Instance

  1. Go to the Cloud SQL console.
  2. Click Create Instance and select a database engine (MySQL or PostgreSQL).
  3. Enter an Instance ID (e.g. datafly-events) and set the root password.
  4. Select a Region and Zone.
  5. Pick a Machine type based on workload.
  6. Under Connections, configure:
    • Public IP — enable if Signal connects from outside GCP. Add authorised networks (Signal’s IP addresses).
    • Private IP — enable if Signal runs within the same VPC.
  7. Click Create Instance.

Note the Public IP address (or private IP, depending on your setup) and Port (5432 PG, 3306 MySQL).

Configure Authorised Networks

If using public IP:

  1. Open the instance, go to Connections > Networking > Authorised networks.
  2. Click Add a network and enter your Signal deployment’s IP addresses.
  3. Click Save.
⚠️

Never authorise 0.0.0.0/0 in production. Restrict access to your Signal infrastructure’s IP addresses or use VPC peering / private IP.

Create a Database, Schema, and Table

Connect to the instance and create the target objects. Use the table definition from the matching engine guide:

Create a Database User for Signal

Example for PostgreSQL:

CREATE USER datafly_signal WITH PASSWORD 'your_secure_password';
GRANT USAGE ON SCHEMA datafly TO datafly_signal;
GRANT INSERT ON TABLE datafly.events TO datafly_signal;

Configuration

FieldTypeRequiredDescription
hoststringYesThe Cloud SQL instance public or private IP address.
portstringYesDatabase port (5432 PG, 3306 MySQL).
databasestringYesThe target database name.
schema_namestringPG onlyThe schema to write to. PostgreSQL only.
table_namestringYesThe target table name.
usernamestringYesDatabase username.
passwordsecretYesDatabase password.
ssl_modeselectNoPostgreSQL SSL mode (require recommended for public IP).
tls_modeselectNoMySQL TLS mode.

Signal Setup

Quick Setup

  1. Navigate to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Google Cloud SQL or filter by Database.
  4. Click Install, select the variant matching your engine (postgres or mysql), and fill in the required fields.
  5. Click Install Integration to create the integration with a ready-to-use default blueprint.

API Setup (PostgreSQL example)

curl -X POST http://localhost:8084/v1/admin/integration-catalog/google_cloud_sql_postgres/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Google Cloud SQL (PostgreSQL)",
    "variant": "postgres",
    "config": {
      "host": "34.123.45.67",
      "port": "5432",
      "database": "datafly_events",
      "schema_name": "datafly",
      "table_name": "events",
      "username": "datafly_signal",
      "password": "your_secure_password",
      "ssl_mode": "require"
    },
    "delivery_mode": "server_side"
  }'

Schema

Signal writes the standard event envelope. Use the same column layout as the underlying engine page:

Cloud SQL is a first-party destination in your own GCP project. The default blueprint forwards all events. Apply consent filtering via pipeline transforms or downstream views on context if your governance requires it.

Testing

  1. Enable the integration in Signal and trigger a test event on your website.

  2. Connect to the instance and query the target table:

    SELECT * FROM datafly.events ORDER BY timestamp DESC LIMIT 10;
  3. Verify that event rows are appearing with correct data.

  4. In Signal, check the Live Events view to confirm delivery status shows as successful.

Troubleshooting

ProblemSolution
Connection refused / timeoutCheck authorised networks (public IP) or VPC peering (private IP).
Authentication failureVerify the database username and password.
permission deniedThe user lacks INSERT on the table (or USAGE on the schema for PostgreSQL). Grant the required permissions.
SSL connection errorsCloud SQL uses SSL by default — set ssl_mode=require (PostgreSQL) or tls_mode=required (MySQL).
Relation does not existVerify the database, schema, and table names.
Slow insertsCheck the instance machine type and disk performance.

Visit Google Cloud SQL documentation for full API reference, connection methods, and backup configuration.

See also