Design and Manage Google Cloud Spanner Databases Visually with DbSchema

DbSchema lets you design, manage, and document Google Cloud Spanner databases. Create ER diagrams, define tables and columns, and generate SQL scripts - with or without a live database connection.

Use Git to share the design, compare it with the Google Cloud Spanner database, and deploy changes. DbSchema also includes a data editor, query builder, and HTML5 documentation - everything you need in one tool.

DbSchema Database Designer

Download DbSchema Download Google Cloud Spanner JDBC Driver

Google Cloud Spanner is a globally distributed, horizontally scalable relational database with external consistency and up to 99.999% availability. Its schema model includes interleaved tables — a parent-child structure that co-locates related rows for locality — alongside secondary indexes and foreign keys. Understanding this hierarchy is essential when designing for Spanner's distributed storage, and DbSchema renders the entire structure visually so architects can reason about table relationships without reading raw DDL.

Visualizing Spanner's Interleaved Table Hierarchy

Spanner's interleaved tables create physical co-location between a parent table and its children. DbSchema reads the information schema and renders parent-child relationships as explicit diagram edges, making it straightforward to audit whether interleaving is applied correctly and to document the intended data model for distributed system architects.

Visualizing Google Cloud Spanner interleaved table relationships in DbSchema

Query Builder for Spanner SQL

Cloud Spanner supports a SQL dialect closely aligned with ANSI SQL. DbSchema's query builder constructs SELECT statements visually — selecting columns, defining join conditions, and applying filters — then executes them directly against your Spanner instance. This is particularly useful for exploring large distributed datasets without writing raw SQL.

Building a query against Google Cloud Spanner using DbSchema's query builder

Auto-Generated Schema Documentation

DbSchema generates HTML schema documentation from the live Spanner information schema, including ER diagrams, table descriptions, column types, and index definitions. For globally distributed databases shared across multiple engineering teams, this documentation becomes a reliable reference for understanding the data model without direct database access.

Auto-generated schema documentation for a Google Cloud Spanner database in DbSchema

Connecting DbSchema to Google Cloud Spanner

Use the Cloud Spanner JDBC driver (google-cloud-spanner-jdbc), which DbSchema can load via its driver manager. The JDBC URL format is jdbc:cloudspanner:/projects/project/instances/instance/databases/database. Authentication uses Application Default Credentials: either set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account JSON key file, or run gcloud auth application-default login to use your user credentials. Spanner has no traditional port — all traffic goes through the Cloud Spanner gRPC API on port 443.

Why Teams Use DbSchema with Cloud Spanner

  • Interleaved table visualization — see parent-child co-location relationships as explicit diagram edges, not just raw DDL.
  • Schema documentation — generate HTML docs with ER diagrams for distributed teams who need schema visibility without database access.
  • Offline schema design — model new tables and interleaving strategies in DbSchema before applying them to a running Spanner instance.
  • Visual query exploration — build and run Spanner SQL queries visually against your production or staging instance.
  • Schema comparison — diff Spanner schemas between development and production instances and review proposed DDL changes.