Skip to main content
Connect your Google Cloud Spanner database to Basedash to visualize and analyze your application data.

Prerequisites

  • A Google Cloud project with Cloud Spanner enabled
  • Service account with Spanner access
  • Service account key file (JSON)
  • Instance and database information

Connection methods

Direct connection

  1. Open the Data page and click Add data source
  2. Select Spanner
  3. Enter your connection details:
    • Instance ID
    • Database name
    • JSON key: upload your service account key file. Basedash reads the project ID from the key.
  4. Click Connect. Basedash checks the connection, then opens the new data source and starts syncing its schema.
The Spanner connection form in Basedash with an instance ID and database name filled in and a service account JSON key uploaded

Required permissions

Your service account needs the following IAM roles:
  • roles/spanner.databaseReader - to read data
  • roles/spanner.viewer - to view instance and database information

Best practices

  • Create a dedicated service account for Basedash
  • Grant minimum required permissions
  • Regularly rotate service account keys
  • Monitor query performance and costs
  • Use appropriate instance configurations

Performance optimization

  • Design efficient schemas
  • Use appropriate indexes
  • Monitor query patterns
  • Set up proper backup policies
  • Configure appropriate resource limits

Troubleshooting

For what each connection error means and how to fix it, see Connection settings.
  • Verify service account permissions
  • Check instance and database status
  • Monitor quota usage
  • Review Spanner audit logs
  • Validate network connectivity