Spanner documentation

Spanner is a fully managed, mission-critical database service that brings together relational, graph, key-value, and search. It offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL.

Go to the Spanner product page for more.

Not sure what database option is right for you? Learn more about ourdatabase services.

Start your proof of concept with $300 in free credit

  • Develop with our latest Generative AI models and tools.
  • Get free usage of 20+ popular products, including Compute Engine and AI APIs.
  • No automatic charges, no commitment.

Keep exploring with 20+ always-free products.

Access 20+ free products for common use cases, including AI APIs, VMs, data warehouses, and more.

Documentation resources

Find quickstarts and guides, review key references, and get help with common issues.

Related resources

Explore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services.
Training
Training and tutorials

Google Cloud Fundamentals: Core Infrastructure

These lectures, demos, and hands-on labs give you an overview of Google Cloud products and services so that you can learn the value of Google Cloud and how to incorporate cloud-based solutions into your business strategies.

Training
Training and tutorials

Architecting with Google Cloud: Design and Process

This course features a combination of lectures, design activities, and hands-on labs to show you how to use proven design patterns on Google Cloud to build highly reliable and efficient solutions and operate deployments that are highly available and cost-effective.

Training
Training and tutorials

Spanner with Spring Boot

Learn how to connect to Cloud SQL from Cloud Run

Use case
Use cases

Architecting disaster recovery for locality-restricted workloads

Discusses how to use Google Cloud to architect for disaster recovery (DR) to meet location-specific requirements.

Disaster Recovery

Use case
Use cases

Continuous data replication to Spanner using Striim

Demonstrates migrating a MySQL database to Spanner using Striim.

ReplicationMigration

Use case
Use cases

Database migration: Concepts and principles (Part 1)

Introduces concepts, principles, terminology, and architecture of near-zero downtime database migrations to Google Cloud.

Migration

Use case
Use cases

Creating a change log with JDBC using the commit timestamp feature of Spanner

Shows how to use the commit timestamp feature to track the date and time when changes are made to your database records.

JavaChanges

Use case
Use cases

Best practices for using Spanner as a gaming database

Describes best practices for using Spanner as the primary backend database for game state storage.

ShardsGaming

Code sample
Code Samples

Getting started with Spanner in Python

First steps using Spanner with Python

Code sample
Code Samples

Getting started with Spanner in Node.js

First steps using Spanner with Nde.js

Code sample
Code Samples

Getting started with Spanner in Java

First steps using Spanner with Java

Code sample
Code Samples

Getting started with Spanner in PHP

First steps using Spanner with PHP

Code sample
Code Samples

Getting started with Spanner in C#

First steps using Spanner with C#

Code sample
Code Samples

Getting started with Spanner in Ruby

First steps using Spanner with Ruby

Code sample
Code Samples

Getting started with Spanner in C++

First steps using Spanner with C++

Related videos

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.