Skip to main content

Option 1: Direct Read Access

Grant Aampe direct read access to your Spanner instance for real-time data synchronization.

Requirements

  • Google Cloud project with Spanner instance
  • Admin access to your GCP project
  • Spanner instance ID and database name

Setup Steps

1. Create a Service Account for Aampe

2. Grant Spanner Access

3. Create and Download Service Account Key

4. Provide Information to Aampe

Share the following with your Aampe representative:
  • Service account key file (aampe-spanner-key.json)
  • Project ID
  • Spanner instance ID
  • Database name
  • List of tables to sync
If you prefer not to grant direct Spanner access, you can set up BigQuery federation and grant access to BigQuery instead.

Prerequisites

  • BigQuery API enabled in your project
  • Existing Spanner instance with data

Setup Steps

1. Create External Connection in BigQuery

2. Create Views for Aampe Access

3. Grant BigQuery Access to Aampe

4. Share Connection Details

Provide Aampe with:
  • Project ID
  • Dataset name (aampe_views)
  • List of available views

Option 3: Cross-Project Access for Dataflow

If Aampe will be running Dataflow jobs to extract your data, grant the necessary permissions for cross-project access.

Prerequisites

  • Aampe will provide you with a service account email that will run the Dataflow jobs

Setup Steps

1. Enable Required APIs

2. Grant Spanner Access

Grant Aampe’s service account permission to read your Spanner data:

3. Network Configuration (if using VPC)

If your Spanner instance is in a VPC-enabled configuration:
Example ingress.yaml:
Share the following details:
  • Project ID
  • Spanner instance ID
  • Database name
  • List of tables to sync
  • Any network restrictions or VPC configurations

Option 4: Real-time Streams

For real-time event streaming, set up Spanner change streams to publish to a Pub/Sub topic that Aampe can subscribe to / you can push to Aampe endpoints.

Prerequisites

  • Pub/Sub API enabled
  • Spanner database with change streams support

Setup Steps

1. Create Change Streams

2. Create Pub/Sub Topic

3. Set Up Change Stream Export

Use the Dataflow template to export changes:

4. Configure Dead Letter Queue (Optional)

Performance Considerations

  • Ensure indexes exist on frequently queried columns (customer_id, created_at)
  • Consider partitioning large tables by date
  • Monitor Spanner CPU utilization during sync operations

Next Steps

Once configuration is complete:
  • Notify your Aampe representative
  • We’ll verify the connection and begin initial data sync
  • Monitor the first sync for any performance impacts
  • Set up alerts for failed syncs (if using change streams)