Logo for Cloud Spanner

Cloud Spanner

Future-proof your applications with a no-compromise database

No more relational vs. non-relational. Get high performance and availability at virtually unlimited scale. Remove stress from managing databases with zero-touch maintenance.

Get started with a 90-day Spanner free trial instance.

In addition, new Google Cloud customers get $300 in free credits.

Features

Write and read scalability with no limits

Spanner decouples compute resources from data storage, which makes it possible to transparently scale in and out processing resources. Each additional compute capacity can process both reads and writes, providing effortless horizontal scalability. Spanner optimizes performance by automatically handling the sharding, replication, and transaction processing.

Automated maintenance

Reduce operational costs and improve reliability for any size database. Synchronous replication and maintenance are automatic and built in. 100% online schema changes and maintenance while serving traffic with zero downtime.

PostgreSQL interface

Combine the scalability and reliability of Spanner with the familiarity and portability of a PostgreSQL interface. Use the skills and tools that your teams already know, future-proofing your investment for peace of mind. 

Automatic database sharding

Never worry about manually resharding your database again. Built-in sharding automatically distributes data to optimize for performance and availability. Scale up and scale down without interruption.

High-performance, workload-isolated query processing

Cloud Spanner Data Boost enables users to run analytical queries, batch processing jobs, or data export operations faster without affecting the existing transactional workload. Fully managed by Google Cloud, Data Boost does not require capacity planning or management. It is always hot, ready to process user queries directly on data stored in Spanner's distributed storage system, Colossus. This on-demand, independent compute resource lets users easily handle mixed workloads and worry-free data sharing. 

Strong transactional consistency

Rely on industry-leading external consistency without compromising on scalability or availability.

Single-region and multi-region configurations

No matter where your users may be, apps backed by Spanner can read and write up-to-date strongly consistent data globally. Additionally, when running a multi-region instance, your database is protected against a regional failure and offers industry-leading 99.999% availability.

Real-time change data capture and replication

Use Datastream to deliver change data from Oracle and MySQL databases into Spanner for up-to-date information. Use Spanner change streams to capture change data from Spanner databases and integrate it with other systems for analytics, event triggering, and compliance. 

Granular instance sizing

Start with Spanner with a granular instance for only $65/month and scale it based on your needs without downtime and with no need for re-architecting. 

Relational interface

Everything you would expect from a relational database—schemas, SQL queries, and ACID transactions—at any scale. Use Google Standard SQL or a PostgreSQL interface.

AI-powered code assistance

Duet AI in Cloud Spanner helps developers write SQL queries faster. It provides code suggestions to structure, modify, or query your data based on natural language prompts. 

Rich application and tool support

Meet development teams where they are with native client libraries for Java/JDBC, Go, Python, C#, Node.js, PHP, Ruby, and C++ as well as the most popular ORMs, including Hibernate and Entity Framework.

Observability

Monitor performance of Spanner databases with metrics and stats. Analyze usage patterns in Spanner databases with Key Visualizer, an interactive monitoring tool. Use query insights for troubleshooting query performance issues and quickly diagnose lock contention issues with lock insights and transaction insights.

Enterprise-grade security and controls

Customer-managed encryption keys (CMEK), data-layer encryption, IAM integration for access and controls, and comprehensive audit logging. Support for VPC-SC, Access Transparency, and Access Approval. Fine-grained access control lets you authorize access to Spanner data at the table and column level. 

Backup and restore, point-in-time recovery (PITR)

Backup your database to store a consistent copy of data and restore on demand. PITR provides continuous data protection with the ability to recover your past data to a microsecond granularity.

Database comparison

Database attributeOther Relational DBOther Non-relational DBCloud Spanner

Schema

Static

Dynamic

Dynamic

SQL

Yes

No

Yes

Transactions

ACID

(atomicity, consistency, isolation, durability)

Eventual

Strong-ACID

with TrueTime ordering

Scalability

Vertical 

(use a bigger machine)

Horizontal

(add more machines)

Horizontal

Availability 

Failover (downtime)

High

High 99.999% SLA

Replication

Configurable

Configurable

Automatic

Schema

Static

Dynamic

Dynamic

SQL

Yes

No

Yes

Transactions

ACID

(atomicity, consistency, isolation, durability)

Eventual

Strong-ACID

with TrueTime ordering

Scalability

Vertical 

(use a bigger machine)

Horizontal

(add more machines)

Horizontal

Availability 

Failover (downtime)

High

High 99.999% SLA

Replication

Configurable

Configurable

Automatic

How It Works

Cloud Spanner instances provide compute and storage in one or more regions. A distributed clock called TrueTime guarantees transactions are strongly consistent even across regions. Data is automatically "split" for scalability and replicated using a synchronous, Paxos-based scheme for availability.

Spanner diagram

Common Uses

User profile and entitlements

Manage critical user data securely at any scale

User profile management is a critical function that requires Spanner's scalability, availability, and global consistency. It is the entry point for players across games, platforms, and regions. Similarly financial services companies manage customer information and product offerings using Spanner.
User Profile and Entitlements architecture diagram

Manage critical user data securely at any scale

User profile management is a critical function that requires Spanner's scalability, availability, and global consistency. It is the entry point for players across games, platforms, and regions. Similarly financial services companies manage customer information and product offerings using Spanner.
User Profile and Entitlements architecture diagram

Financial ledger

Gain up-to-date, consistent view of global transactions

Unify financial transactions, trades, settlements, and positions across the globe into a consolidated trade ledger built on Cloud Spanner that guarantees external consistency and scalability. Consolidation of data helps in quickly adapting to changing market conditions and regulatory requirements. Similarly retail/ecommerce businesses use Spanner for inventory ledger.
Financial Ledger architecture diagram

Gain up-to-date, consistent view of global transactions

Unify financial transactions, trades, settlements, and positions across the globe into a consolidated trade ledger built on Cloud Spanner that guarantees external consistency and scalability. Consolidation of data helps in quickly adapting to changing market conditions and regulatory requirements. Similarly retail/ecommerce businesses use Spanner for inventory ledger.
Financial Ledger architecture diagram

Online banking

Deliver always-on interactivity for digital experiences

Consumers expect access to their critical financial data on their devices outside of regular banking hours. Allow your developers to focus on new experiences rather than operational overhead, such as manual sharding or eventual consistency. Reduce risk and downtime with 99.999% availability and zero maintenance.
Online Banking architecture diagram

Deliver always-on interactivity for digital experiences

Consumers expect access to their critical financial data on their devices outside of regular banking hours. Allow your developers to focus on new experiences rather than operational overhead, such as manual sharding or eventual consistency. Reduce risk and downtime with 99.999% availability and zero maintenance.
Online Banking architecture diagram

Loyalty programs and promotions

Personalize experiences with real-time updates

Track customer participation and preferences in a loyalty program to analyze trends and improve customer satisfaction. Similarly, game companies use Spanner for building personalized leaderboards in games.
Loyalty programs and promotions architecture diagram

Personalize experiences with real-time updates

Track customer participation and preferences in a loyalty program to analyze trends and improve customer satisfaction. Similarly, game companies use Spanner for building personalized leaderboards in games.
Loyalty programs and promotions architecture diagram

Omni-channel inventory management

Provide a consistent view across multiple channels and apps

Spanner provides a high performance, single source of truth for retail inventory and orders across online, in-store, distribution centers, and shipping to match inventory with demand, improving customer experience and profitability. Game companies similarly use Spanner to store in-game inventory data.
Omni-channel inventory management architecture diagram

Provide a consistent view across multiple channels and apps

Spanner provides a high performance, single source of truth for retail inventory and orders across online, in-store, distribution centers, and shipping to match inventory with demand, improving customer experience and profitability. Game companies similarly use Spanner to store in-game inventory data.
Omni-channel inventory management architecture diagram

Pricing

How Spanner pricing worksSpanner pricing is based on compute capacity, database storage, backup storage, and network usage. Committed use discounts reduce the price further.
ServiceDescription