Spanner 是全代管的關鍵任務資料庫服務,結合了關聯式、圖形、鍵/值和搜尋功能。這項服務可提供全球規模的交易一致性、自動同步複製功能,以提高可用性,並支援兩種 SQL 方言:GoogleSQL (ANSI 2011 延伸) 和 PostgreSQL。
不確定哪種資料庫選項適合您嗎?請進一步瞭解我們的資料庫服務。
使用價值 $300 美元的免費抵免額,開始進行概念驗證
-
取得 Gemini 2.0 Flash Thinking 的存取權
-
每月免費使用 AI API 和 BigQuery 等熱門產品
-
不會自動收費,也不會要求您一定要購買特定方案
繼續探索超過 20 項一律免費的產品
使用超過 20 項實用的免費產品,包括 AI API、VM 和 data warehouse 等。
訓練
訓練與教學課程
Google Cloud 基礎知識:核心基礎架構
透過這些講座、示範和實作實驗室,您可以瞭解 Google Cloud 產品與服務,進而瞭解 Google Cloud 的價值,以及如何將雲端式解決方案納入業務策略中。
訓練
訓練與教學課程
設定 Google Cloud 架構:設計和流程
本課程內容包含講座、設計活動和實作研究室,說明如何在 Google Cloud 中運用經過實證的設計模式,打造極度可靠、效率卓越的解決方案,並以可用性高且符合成本效益的方式執行部署作業。
訓練
訓練與教學課程
搭配 Spring Boot 使用 Spanner
瞭解如何從 Cloud Run 連線至 Cloud SQL
用途
用途
為位置受限的工作負載建立災難復原架構
說明如何透過 Google Cloud 建立災難復原 (DR) 架構,以便滿足位置專屬規定。
災難復原
用途
用途
使用 Striim 持續將資料複製到 Spanner
示範如何使用 Striim 將 MySQL 資料庫遷移至 Spanner。
複製
遷移
用途
用途
資料庫遷移:概念和原則 (第 1 部分)
介紹近乎零停機時間資料庫遷移至 Google Cloud 的概念、原則、術語和架構。
遷移
用途
用途
使用 Spanner 的修訂時間戳記功能,透過 JDBC 建立變更記錄
說明如何使用修訂時間戳記功能,追蹤資料庫記錄的變更日期和時間。
Java
變更
用途
用途
使用 Spanner 做為遊戲資料庫的最佳做法
說明將 Spanner 當做主要後端資料庫來儲存遊戲狀態的最佳做法。
晴天
遊戲
程式碼範例
程式碼範例
開始使用 Python 版 Spanner
使用 Python 搭配 Spanner 的最初步驟
程式碼範例
程式碼範例
開始使用 Node.js 版 Spanner
使用 Node.js 搭配 Spanner 的最初步驟
程式碼範例
程式碼範例
開始使用 Java 版 Spanner
使用 Java 進行 Spanner 的第一步
程式碼範例
程式碼範例
開始使用 PHP 中的 Spanner
使用 PHP 搭配 Spanner 的第一步
程式碼範例
程式碼範例
開始使用 C# 版 Spanner
使用 C# 搭配 Spanner 的最初步驟
程式碼範例
程式碼範例
開始使用 Ruby 版 Spanner
使用 Ruby 搭配 Spanner 的最初步驟
程式碼範例
程式碼範例
開始使用 C++ 版 Spanner
使用 C++ 搭配 Spanner 的最初步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-11 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-11 (世界標準時間)。"],[],[],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--------------"]]