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
- Go to the Cloud SQL console.
- Click Create Instance and select a database engine (MySQL or PostgreSQL).
- Enter an Instance ID (e.g.
datafly-events) and set the root password. - Select a Region and Zone.
- Pick a Machine type based on workload.
- 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.
- 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:
- Open the instance, go to Connections > Networking > Authorised networks.
- Click Add a network and enter your Signal deployment’s IP addresses.
- 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
| Field | Type | Required | Description |
|---|---|---|---|
host | string | Yes | The Cloud SQL instance public or private IP address. |
port | string | Yes | Database port (5432 PG, 3306 MySQL). |
database | string | Yes | The target database name. |
schema_name | string | PG only | The schema to write to. PostgreSQL only. |
table_name | string | Yes | The target table name. |
username | string | Yes | Database username. |
password | secret | Yes | Database password. |
ssl_mode | select | No | PostgreSQL SSL mode (require recommended for public IP). |
tls_mode | select | No | MySQL TLS mode. |
Signal Setup
Quick Setup
- Navigate to Integrations in the sidebar.
- Open the Integration Library tab.
- Find Google Cloud SQL or filter by Database.
- Click Install, select the variant matching your engine (
postgresormysql), and fill in the required fields. - 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:
Consent
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
-
Enable the integration in Signal and trigger a test event on your website.
-
Connect to the instance and query the target table:
SELECT * FROM datafly.events ORDER BY timestamp DESC LIMIT 10; -
Verify that event rows are appearing with correct data.
-
In Signal, check the Live Events view to confirm delivery status shows as successful.
Troubleshooting
| Problem | Solution |
|---|---|
| Connection refused / timeout | Check authorised networks (public IP) or VPC peering (private IP). |
| Authentication failure | Verify the database username and password. |
permission denied | The user lacks INSERT on the table (or USAGE on the schema for PostgreSQL). Grant the required permissions. |
| SSL connection errors | Cloud SQL uses SSL by default — set ssl_mode=require (PostgreSQL) or tls_mode=required (MySQL). |
Relation does not exist | Verify the database, schema, and table names. |
| Slow inserts | Check the instance machine type and disk performance. |
Visit Google Cloud SQL documentation for full API reference, connection methods, and backup configuration.