Files
nexus/sreweekly/markdown/60/10-cloud-spanner.md
2026-09-12 17:23:01 +08:00

445 lines
25 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Cloud Spanner
- **期号**: SRE Weekly Issue #60(2017-02-20)
- **作者**: —
- **链接**: https://cloud.google.com/spanner/
## 简介
Okay, apparently I do link to product announcements often. Google unveiled a new beta product this week for their Cloud Platform: Cloud Spanner. Based on their Spanner paper from 2012, they have some big claims.
> Cloud Spanner is the first and only relational database service that is both strongly consistent and horizontally scalable. […] With automatic scaling, synchronous data replication, and node redundancy, Cloud Spanner delivers up to 99.999% (five 9s) of availability for your mission critical applications.
## 正文
Build intelligent, mission-critical apps on a single database that unifies relational, graph, key-value, and search. Run anywhere with [Spanner Omni](https://cloud.google.com/products/spanner/omni).
Get started with a [90 day free trial instance](https://console.cloud.google.com/spanner/instances/landing-page).
Start small and scale without limits or re-architecture
Built-in graph processing, full-text search and vector search
Develop apps with the familiar PostgreSQL interface on Spanner
What is Spanner? 5-minute video explainer ![Spanner product overview video thumbnail](https://www.gstatic.com/bricks/image/bd7064ec-74b0-4541-8c2e-502188f481c9.png)
Features
Spanner's multi-model capabilities empower you to build intelligent, AI-enabled applications on top of your operational relational and NoSQL data by leveraging native integration with Gemini Enterprise Agent Platform, [Spanner Graph](https://cloud.google.com/products/spanner/graph) for querying complex relationships, [vector search](https://youtu.be/TmlC3FejwvU) for semantic search, built-in [full-text search](https://services.google.com/fh/files/misc/building_applications_with_spanner_full_text_search.pdf), —all with "true ZeroETL" interoperability. This unified approach eliminates data silos, saves costs, reduces operational and security touchpoints, and ensures data consistency across all models.
Enterprise-scale AI, search, graph, and analytics
43:41
Seamlessly [integrate with Gemini Enterprise Agent Platform](https://docs.cloud.google.com/spanner/docs/ml) to harness the latest Gemini models. Maximize AI developer productivity to build autonomous agents that reason over real-time operational state using [Agent Development Kit (ADK)](https://google.github.io/adk-docs/integrations/spanner/). Have natural language conversations with your data in Spanner with vibe coding platforms such as [Gemini CLI](https://github.com/gemini-cli-extensions/spanner) using [remote MCP servers](https://docs.cloud.google.com/spanner/docs/use-spanner-mcp). Leverage [AI functions](https://docs.cloud.google.com/spanner/docs/reference/standard-sql/ml-functions) in Spanner allowing you to perform complex semantic operations directly in SQL bringing intelligence closer to your data. Chat with agents about your database data using natural language with [conversational analytics for Spanner](https://docs.cloud.google.com/gemini/data-agents/conversational-analytics/spanner). The [Data Agent Kit](https://docs.cloud.google.com/data-cloud-extension) streamlines your workflows by bundling secure [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro) tools, native IDE plugins, and pre-codified data engineering, data science, and data app developer skills into a single, open-source package.
How Palo Alto Networks Is Securing AI at Scale with Spanner
3:09
[Spanner Omni](https://cloud.google.com/products/spanner/omni) is a downloadable version of Spanner, Google Cloud’s globally distributed, multi-model database. It extends Spanner's industry-leading scale, high availability, and strong global consistency to your infrastructure— on-premises, across clouds, or on your laptop. Spanner Omni is the ideal solution where you need cross-cloud resilience or a scale-out database that operates outside Google Cloud to power your agentic AI applications.
To infinity & beyond: Spanner Omni for deployments beyond Google Cloud
40:03
Break down the silos between operational and analytical data. Spanner’s built-in [columnar engine](https://docs.cloud.google.com/spanner/docs/columnar-engine) allows you to perform high-performance, ad hoc analytics on live data without impacting transactional throughput. For deeper analysis, Spanner integrates seamlessly with data lakehouses like BigQuery leveraging [federated queries](https://docs.cloud.google.com/bigquery/docs/spanner-external-datasets) to analyze data across Spanner and BigQuery in real-time, or utilizing one-click [reverse ETL](https://docs.cloud.google.com/bigquery/docs/export-to-spanner) to flow insights from your lakehouse back into Spanner.
What is Spanner Data Boost?
5:52
Dream big, start small, and scale effortlessly as your needs grow. Spanner seamlessly handles growing datasets and demanding workloads with its horizontal read and "write" scalability. Automatic database sharding ensures optimal data distribution, while geo-partitioning brings data closer to your users for lower latency. Experience consistently high performance with workload-isolated query processing with [Spanner Data Boost](https://youtu.be/0iK76JCGsHM), even during peak demand.
VIDEO
How Spanner Transactions Work at Planet Scale
8:17
Ensure your applications are always on, ready to serve your users. Spanner delivers up to 99.999% availability with automated maintenance and flexible deployment options. Choose from single-region, dual-region, or multi-region configurations to match your specific availability and fault-tolerance requirements.
How Cloud Spanner delivers high availability at scale
6:43
Say goodbye to data inconsistencies and the complexities of managing them. Spanner guarantees strong transactional consistency, meaning every read reflects the most recent updates, regardless of the size or distribution of your data. Build with confidence, knowing your applications always have a consistent view of your data.
Strong consistency at scale with Spanner
7:20
Trust your data to a secure and compliant platform with Spanner. Enjoy centralized administration and control with [Database Center](https://cloud.google.com/database-center/docs/overview), simplifying your cloud database management. Spanner offers enterprise-grade security and controls, including data encryption at rest and in transit, granular access management through [Identity and Access Management (IAM)](https://cloud.google.com/spanner/docs/iam), and compliance with industry standards. Protect your data further with robust [backup](https://cloud.google.com/spanner/docs/backup) and restore capabilities, including [point-in-time recovery](https://cloud.google.com/spanner/docs/pitr) for operational peace of mind.
Database comparison
| Database attribute | Other Relational DB | Other Non-relational DB | Spanner |
|---|---|---|---|
| **Schema** | Static | Dynamic | Dynamic |
| **SQL** | Yes | No | Yes ([PostgreSQL](https://youtu.be/W7R6db_sa0M) , Google SQL) |
| **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 |
**Gartner®** ranked Spanner #1 for Lightweight Transaction Use Case. Get the [full report](https://cloud.google.com/resources/content/critical-capabilities-dbms).
**Schema**
Other Relational DB
Static
Other Non-relational DB
Dynamic
Spanner
**Transactions**
ACID
(atomicity, consistency, isolation, durability)
Eventual
Strong-ACID
with TrueTime ordering
**Scalability**
Vertical
(use a bigger machine)
Horizontal
(add more machines)
**Availability**
Failover (downtime)
High
High 99.999% SLA
**Replication**
Configurable
Automatic
How It Works
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.
Common Uses
Streamline MySQL and Cassandra modernization
Modernize your sharded MySQL and Cassandra workloads to superpower your development teams and scale for the next phase of growth. Take advantage of open-source [Spanner migration tool](https://github.com/GoogleCloudPlatform/spanner-migration-tool) and a network of qualified services and technology partners that can streamline your migration.
Ensure business continuity across diverse environments
Build truly resilient, high-availability architectures that extend beyond the boundaries of a single cloud provider. By deploying [Spanner Omni](https://cloud.google.com/products/spanner/omni) in a secondary cloud or on-premises data center as a "hot/cold" failover site for your primary Spanner managed service in Google Cloud, you create a critical safety net. This "primary/secondary" architecture reduces vulnerability to service disruptions and helps meet strict "stressed exit" regulatory requirements for financial services.
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.
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 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.
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.
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.
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.
Reveal hidden relationships and connections in your data
With [Spanner Graph](https://cloud.google.com/products/spanner/graph), you can develop knowledge graphs that capture the complex connections between entities, represented as nodes, and their relationships, represented as edges. These connections provide rich context, making knowledge graphs invaluable for developing knowledge base systems and recommendation engines. With integrated search capabilities, you can seamlessly blend semantic understanding, keyword-based retrieval, and graph for comprehensive results.
Generate a solution
What problem are you trying to solve?
What you'll get:
This service was built with [Gemini Enterprise Agent Platform](https://cloud.google.com/products/gemini-enterprise-agent-platform). You must be 18 or older to use it. Do not enter sensitive, confidential, or personal info.
Pricing
| How Spanner pricing works | Spanner pricing is based on compute capacity, Spanner Data Boost, database storage, backup storage, replication, and network usage. Compute pricing varies depending on the edition and configuration selected. Committed use discounts can further reduce the compute price. | |
|---|---|---|
| Service | Description | Price (USD) |
| Compute | **Standard edition** Packed with a comprehensive suite of established capabilities for regional (single-region) configurations Compute capacity is provisioned as processing units or nodes (1 node = 1000 processing units). | Starting at $0.030 per 100 processing units per hour per replica |
| | **Enterprise edition** Provide additional multi-model and advanced search capabilities with enhanced operational simplicity and efficiency Compute capacity is provisioned as processing units or nodes (1 node = 1000 processing units). | Starting at $0.041 per 100 processing units per hour per replica |
| | **Enterprise Plus edition** Support the most demanding workloads with the highest levels of availability, performance, compliance, and governance Compute capacity is provisioned as processing units or nodes (1 node = 1000 processing units). | Starting at $0.057 per 100 processing units per hour per replica |
| **Data Boost** | On-demand, isolated compute resources, including CPU, memory, and local data transfer | Starting at $0.00117 per serverless processing unit per hour |
| **Database storage** | Price is based on the amount of data stored in the database and includes the cost of storage in read-write replicas and read-only replicas; witness replicas are free of charge. **SSD storage** Use SSD storage when you require low latency and high throughput for your operational data. | Starting at $0.10 per GB per month per replica for SSD |
| | **HDD storage** Use HDD storage for data that needs to be accessed less frequently and can tolerate higher read latencies and lower throughput. You can also configure tiering policies to move data from SSD to HDD after expiration of a specified time window. | Starting at $0.02 per GB per month per replica for HDD |
| **Backup storage** | **Regional configuration** Pricing is based on the amount of backup storage and includes the cost of storage in all replicas. | Starting at $0.10 per GB per month (incl. all replicas) |
| | **Dual-region and multi-regional configuration** Pricing is based on the amount of backup storage and includes the cost of storage in all replicas. | Starting at $0.30 per GB per month (incl. all replicas) |
| **Replication** | Intra-region replication | Free |
| | Inter-region replication | Starting at $0.04 per GB |
| **Network** | Ingress | Free |
| | Intra-region egress | Free |
| | Inter-region egress | Starting at $0.01 per GB |
Learn more about Spanner [pricing](https://cloud.google.com/spanner/pricing) and [committed use discounts](https://cloud.google.com/spanner/docs/cuds#pricing).
How Spanner pricing works
Compute
Description
**Standard edition**
Price (USD)
Starting at
$0.030
per 100 processing units per hour per replica
**Enterprise edition**
$0.041
**Enterprise Plus edition**
$0.057
**Data Boost**
$0.00117
per serverless processing unit per hour
**Database storage**
**SSD storage**
$0.10
per GB per month per replica for SSD
**HDD storage**
$0.02
per GB per month per replica for HDD
**Backup storage**
**Regional configuration**
per GB per month (incl. all replicas)
**Dual-region and multi-regional configuration**
$0.30
Intra-region replication
Free
Inter-region replication
$0.04
per GB
**Network**
Ingress
Intra-region egress
Inter-region egress
$0.01
Start your proof of concept
Business Case
Explore how other businesses built innovative apps to deliver great customer experiences, cut costs, and increase ROI with Spanner.
- **Forrester's Total Economic Impact™ study** shows Spanner delivers a 132% ROI, 9-month payback period and multi-million dollar benefits for a representative composite organization.[**Download the full study**](https://cloud.google.com/resources/content/forrester-spanner-tei-study) to learn more.
- **Gartner®** identifies 13 Critical Capabilities for operational databases, and ranks Spanner #1 in the Lightweight Transactions Use Case. Get the[**full report**](https://cloud.google.com/resources/content/critical-capabilities-dbms) .
How does Uber scale to millions of concurrent requests?
Explore how Uber redesigned its fulfillment platform leveraging Spanner.
How Wayfair is modernizing, one database at a time ![Wayfair logo](https://www.gstatic.com/bricks/image/XxJ90qBFli-ztz2jKtWJsCfK7U-KJCwPIaI8JdXqG3_RwE1bGylW0XSc_jL-3elaIINYICQn_R9_.png)
Learn how Gmail migrated billions of users, trillions of emails, and exabytes of data to Spanner ![Gmail logo](https://www.gstatic.com/bricks/image/6b711ee5-4822-472d-8db1-ce4834e80f20.png)
Dojo is a payments powerhouse, delivering 60% faster transactions with Spanner ![DOJO in black text](https://www.gstatic.com/bricks/image/7cde965d-32f6-4ef5-80fc-4acc410317fa.png)
Featured benefits and customers
Grow your business with innovative applications that scale limitlessly to meet any demand.
Lower TCO and free your developers from cumbersome operations to dream big and build faster.
Get superior price-performance and pay for what you use, starting at as low as $40 per month.
Partners & Integration
[Spanner partners](https://cloud.google.com/blog/products/databases/unlocking-the-power-of-spanner) help you modernize applications and migrate to the cloud seamlessly. Find your ideal partner or third-party integration in [our directory](https://cloud.google.com/find-a-partner/?search=relational%20databases).
Frequently asked questions
Other resources and support
Spanner simplifies your data architecture by bringing together relational, key-value, graph, and vector search workloads—all on the same database. It is a highly scalable database that combines unlimited scalability with relational semantics, such as secondary indexes, strong consistency, schemas, and SQL providing 99.999% availability in one easy solution. Hence, it’s suitable for both relational and non-relational workloads.
Spanner Omni is a downloadable version of Spanner delivering the same core capabilities with the added flexibility for customers to deploy it anywhere. To learn more, visit [https://cloud.google.com/products/spanner/omni](https://cloud.google.com/products/spanner/omni)
Spanner provides two ANSI-based SQL dialects over the same rich set of capabilities: [GoogleSQL](https://cloud.google.com/spanner/docs/reference/standard-sql/lexical) and PostgreSQL. GoogleSQL shares syntax with BigQuery for teams standardizing their data management workflows. The PostgreSQL interface provides familiarity for teams who already know PostgreSQL and portability of schemas and queries to other PostgreSQL environments. For more information about the Spanner PostgreSQL interface, see our [documentation](https://cloud.google.com/spanner/docs/postgresql-interface).
Migrating existing workloads to Spanner ensures a foundation for future growth, without having to compromise on reliability or price-performance. Spanner‘s multi-model interface is used today by innovative organizations across industries with operational workloads coming from relational databases, like MySQL and SQL Server, key-value stores, such as Cassandra or DynamoDB, along with graph, search, and document tools. The specific approach for a migration will depend on requirements around data volume, performance SLOs, and availability. [Spanner migration tool](https://github.com/GoogleCloudPlatform/spanner-migration-tool) provides end-to-end assessment, schema and data migration, and low-downtime cutover for sharded [MySQL](https://cloud.google.com/spanner/docs/migrating-mysql-to-spanner) and [Cassandra](https://cloud.google.com/spanner/docs/non-relational/spanner-for-cassandra-users) databases as well as assessment and migration for PostgreSQL. A qualified network of [technology and services partners](https://cloud.google.com/blog/products/databases/unlocking-the-power-of-spanner) can accelerate migrations from just about any source.
Spanner is a fully managed database so it automatically provides comprehensive infrastructure management features, but there are some application-specific management actions that may be required depending on your workload. You will need to make sure that you have set up proper alerting and monitoring and that you are watching those closely to ensure production is always running smoothly. You need to understand what actions to take when traffic grows organically over time, or if there is peak traffic expected, or how to handle data corruption due to application bugs, and last but not least, how to troubleshoot performance issues and understand what components are responsible for increased latencies.
- Accelerate your digital transformation
- Whether your business is early in its journey or well on its way to digital transformation, Google Cloud can help solve your toughest challenges.
- Key benefits
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/retail.svg)
![](https://www.gstatic.com/cloud/images/navigation/cpg.svg)
![](https://www.gstatic.com/cloud/images/navigation/finance.svg)
![](https://www.gstatic.com/cloud/images/navigation/hcls.svg)
![](https://www.gstatic.com/cloud/images/navigation/media.svg)
![](https://www.gstatic.com/cloud/images/navigation/telecommunications.svg)
![](https://www.gstatic.com/cloud/images/navigation/gaming.svg)
![](https://www.gstatic.com/cloud/images/navigation/manufacturing.svg)
![](https://www.gstatic.com/cloud/images/navigation/supply-chain.svg)
![](https://www.gstatic.com/cloud/images/navigation/government.svg)
![](https://www.gstatic.com/cloud/images/navigation/icon-sprite.svg#education)
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Featured Products
![](https://www.gstatic.com/images/branding/productlogos/gemini_2025/v1/web-24dp/logo_gemini_2025_color_2x_web_24dp.png)
![](https://www.gstatic.com/images/branding/productlogos/gemini_2025/v1/web-24dp/logo_gemini_2025_color_2x_web_24dp.png)
![](https://www.gstatic.com/cloud/images/navigation/compute-engine.png)
![](https://www.gstatic.com/cloud/images/navigation/cloud-storage.png)
![](https://www.gstatic.com/cloud/images/navigation/bigquery.png)
![](https://www.gstatic.com/cloud/images/navigation/cloud-run.png)
![](https://www.gstatic.com/cloud/images/navigation/kubernetes-engine.png)
![](https://www.gstatic.com/cloud/images/navigation/looker.png)
![](https://www.gstatic.com/cloud/images/navigation/apigee.png)
![](https://www.gstatic.com/cloud/images/navigation/cloud-sql.png)
![](https://www.gstatic.com/cloud/images/navigation/networking.png)
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Not seeing what you're looking for?
- Business Intelligence
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Not seeing what you're looking for?
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
![](https://www.gstatic.com/cloud/images/navigation/forward.svg)
- Save money with our transparent approach to pricing
- Google Cloud's pay-as-you-go pricing offers automatic savings based on monthly usage and discounted rates for prepaid resources. Contact us today to get a quote.
- Pricing overview and tools