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.
Not sure what database option is right for you? Learn more about our
database services.
Start your proof of concept with $300 in free credit
-
Get access to Gemini 2.0 Flash Thinking
-
Free monthly usage of popular products, including AI APIs and BigQuery
-
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.
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.
Replication
Migration
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.
Java
Changes
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.
Shards
Gaming
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++
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Spanner documentation\n=====================\n\n[Read product documentation](/spanner/docs/getting-started/set-up)\nSpanner is a fully managed, mission-critical database\nservice that brings together relational, graph, key-value, and search. It offers transactional\nconsistency at global scale, automatic, synchronous replication for high availability, and support\nfor two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL.\n\n\nNot sure what database option is right for you? Learn more about our\n[database services](/products/databases).\n[Get started for free](https://console.cloud.google.com/freetrial) \n\n#### Start your proof of concept with $300 in free credit\n\n- Get access to Gemini 2.0 Flash Thinking\n- Free monthly usage of popular products, including AI APIs and BigQuery\n- No automatic charges, no commitment \n[View free product offers](/free/docs/free-cloud-features#free-tier) \n\n#### Keep exploring with 20+ always-free products\n\n\nAccess 20+ free products for common use cases, including AI APIs, VMs, data warehouses,\nand more.\n\nDocumentation resources\n-----------------------\n\nFind quickstarts and guides, review key references, and get help with common issues. \nformat_list_numbered\n\n### Guides\n\n-\n\n [Quickstart: Create and query a database by using the Google Cloud console](/spanner/docs/create-query-database-console)\n\n-\n\n [Create and manage instances](/spanner/docs/create-manage-instances)\n\n-\n\n [Choose GoogleSQL or PostgreSQL Google Cloud console](/spanner/docs/choose-googlesql-or-postgres)\n\n-\n\n [Import and export data in CSV format](/spanner/docs/import-export-csv)\n\n-\n\n [Create and manage foreign key relationships](/spanner/docs/foreign-keys/how-to)\n\n-\n\n [Insert, update, and delete data using Data Manipulation Language (DML)](/spanner/docs/dml-tasks)\n\n-\n\n [Insert, update, and delete data using mutations](/spanner/docs/modify-mutation-api)\n\n-\n\n [Use the Dataflow connector](/spanner/docs/dataflow-connector)\n\n-\n\n [Set up and query Spanner Graph using the Google Cloud console](/spanner/docs/graph/set-up)\n\n-\n\n [Monitor instances with Cloud Monitoring](/spanner/docs/monitoring-cloud)\n\n-\n\n [Emulate Spanner locally](/spanner/docs/emulator)\n\n-\n\n [Troubleshoot performance regressions](/spanner/docs/troubleshooting-performance-regressions)\n\nfind_in_page\n\n### Reference\n\n-\n\n [Client libraries and drivers](/spanner/docs/reference/libraries)\n\n-\n\n [REST API](/spanner/docs/reference/rest)\n\n-\n\n [RPC API](/spanner/docs/reference/rpc)\n\n-\n\n [GoogleSQL](/spanner/docs/reference/standard-sql/lexical)\n\n-\n\n [PostgreSQL](/spanner/docs/reference/postgresql/overview)\n\n-\n\n [Graph Query Language](/spanner/docs/reference/standard-sql/graph-intro)\n\n-\n\n [Information schema](/spanner/docs/information-schema)\n\n-\n\n [Query execution operators](/spanner/docs/query-execution-operators)\n\n-\n\n [gcloud command-line tool](/sdk/gcloud/reference/spanner)\n\ninfo\n\n### Resources\n\n-\n\n [Pricing](/spanner/pricing)\n\n-\n\n [Quotas and limits](/spanner/quotas)\n\n-\n\n [Release notes](/spanner/docs/release-notes)\n\n-\n\n [Get support](/spanner/docs/getting-support)\n\nRelated resources\n-----------------\n\nTraining and tutorials \nUse cases \nCode samples \nExplore self-paced training, use cases, reference architectures, and code samples with examples of how to use and connect Google Cloud services. Training \nTraining and tutorials\n\n### Google Cloud Fundamentals: Core Infrastructure\n\n\nThese 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.\n\n\n[Learn more](/training/course/core-infrastructure) \nTraining \nTraining and tutorials\n\n### Architecting with Google Cloud: Design and Process\n\n\nThis 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.\n\n\n[Learn more](/training/course/architecting-design-process) \nTraining \nTraining and tutorials\n\n### Spanner with Spring Boot\n\n\nLearn how to connect to Cloud SQL from Cloud Run\n\n\n[Learn more\narrow_forward](https://codelabs.developers.google.com/codelabs/cloud-spring-spanner) \nUse case \nUse cases\n\n### Architecting disaster recovery for locality-restricted workloads\n\n\nDiscusses how to use Google Cloud to architect for disaster recovery (DR) to meet location-specific requirements.\n\nDisaster Recovery\n\n\u003cbr /\u003e\n\n[Learn more](/solutions/architecting-disaster-recovery-for-locality-restricted-workloads) \nUse case \nUse cases\n\n### Continuous data replication to Spanner using Striim\n\n\nDemonstrates migrating a MySQL database to Spanner using Striim.\n\nReplication Migration\n\n\u003cbr /\u003e\n\n[Learn more](/solutions/partners/continuous-data-replication-cloud-spanner-striim) \nUse case \nUse cases\n\n### Database migration: Concepts and principles (Part 1)\n\n\nIntroduces concepts, principles, terminology, and architecture of near-zero downtime database migrations to Google Cloud.\n\nMigration\n\n\u003cbr /\u003e\n\n[Learn more](/solutions/database-migration-concepts-principles-part-1) \nUse case \nUse cases\n\n### Creating a change log with JDBC using the commit timestamp feature of Spanner\n\n\nShows how to use the commit timestamp feature to track the date and time when changes are made to your database records.\n\nJava Changes\n\n\u003cbr /\u003e\n\n[Learn more](/solutions/using-spanner-commit-timestamp) \nUse case \nUse cases\n\n### Best practices for using Spanner as a gaming database\n\n\nDescribes best practices for using Spanner as the primary backend database for game state storage.\n\nShards Gaming\n\n\u003cbr /\u003e\n\n[Learn more](/solutions/best-practices-cloud-spanner-gaming-database) \nCode sample \nCode Samples\n\n### Getting started with Spanner in Python\n\n\nFirst steps using Spanner with Python\n\n\n[Get started](/spanner/docs/getting-started/python) \nCode sample \nCode Samples\n\n### Getting started with Spanner in Node.js\n\n\nFirst steps using Spanner with Nde.js\n\n\n[Get started](/spanner/docs/getting-started/nodejs) \nCode sample \nCode Samples\n\n### Getting started with Spanner in Java\n\n\nFirst steps using Spanner with Java\n\n\n[Get started](/spanner/docs/getting-started/java) \nCode sample \nCode Samples\n\n### Getting started with Spanner in PHP\n\n\nFirst steps using Spanner with PHP\n\n\n[Get started](/spanner/docs/getting-started/php) \nCode sample \nCode Samples\n\n### Getting started with Spanner in C#\n\n\nFirst steps using Spanner with C#\n\n\n[Get started](/spanner/docs/getting-started/csharp) \nCode sample \nCode Samples\n\n### Getting started with Spanner in Ruby\n\n\nFirst steps using Spanner with Ruby\n\n\n[Get started](/spanner/docs/getting-started/ruby) \nCode sample \nCode Samples\n\n### Getting started with Spanner in C++\n\n\nFirst steps using Spanner with C++\n\n\n[Get started](/spanner/docs/getting-started/cpp)\n\nRelated videos\n--------------"]]