# Google Datastream

**Google Datastream** 是 Google Cloud 提供的一项无服务器变更数据捕获（CDC）与复制服务，能以极低延迟在异构数据库、存储系统和应用程序之间同步数据。它读取每个数据库的变更日志，生成插入、更新和删除事件流，并将这些事件投递到 BigQuery、Cloud Storage 和 [Apache Iceberg](https://www.edgepedia.org/zh/apache-iceberg) 表等 Google Cloud 目标端，用户无需自行配置或管理基础设施。

| 关键事实 | 详情 |
|---|---|
| 发布 | 2021 年 5 月 26 日在 Google Cloud 的 Data Cloud Summit 上以预览版发布，初始源为 Oracle 和 MySQL<sup>[1](https://cloud.google.com/blog/products/databases/new-cloud-based-cdc-replication-across-databases)</sup><sup> • </sup><sup>[5](https://www.googlecloudpresscorner.com/2021-05-26-Google-Cloud-Launches-Three-New-Services-to-Empower-Customers-with-Unified-Data-Cloud-Strategy)</sup> |
| 正式可用 | 2021 年 12 月 1 日宣布正式可用；发布说明将全区域正式可用上线日期定为 2021 年 11 月 30 日<sup>[2](https://cloud.google.com/blog/products/data-analytics/serverless-change-data-capture-and-replication)</sup><sup> • </sup><sup>[3](https://docs.cloud.google.com/datastream/docs/release-notes?hl=en)</sup> |
| 数据库源 | MySQL、Oracle、PostgreSQL、AlloyDB for PostgreSQL、SQL Server、MongoDB 和 Spanner，包括云托管和自管理部署<sup>[4](https://docs.cloud.google.com/datastream/docs/overview)</sup><sup> • </sup><sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup> |
| 目标端 | BigQuery、Apache Iceberg 表（BigLake）和 Cloud Storage；Dataflow 模板可将投递扩展至 Cloud SQL 和 Spanner<sup>[4](https://docs.cloud.google.com/datastream/docs/overview)</sup><sup> • </sup><sup>[6](https://docs.cloud.google.com/datastream/docs/behavior-overview)</sup> |
| 投递语义 | 至少一次事件投递；不保证事件顺序，但元数据支持排序和去重<sup>[6](https://docs.cloud.google.com/datastream/docs/behavior-overview)</sup> |
| 事件大小限制 | BigQuery 目标端每个事件 20 MB，Cloud Storage 目标端每个事件 100 MB<sup>[6](https://docs.cloud.google.com/datastream/docs/behavior-overview)</sup><sup> • </sup><sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup> |
| 定价 | 按处理的吉比字节（GiB）计费，阶梯价格从 2.00 美元/GiB（每月前 2,500 GiB）降至 10,000 GiB 以上的 0.80 美元/GiB；空闲流不收费<sup>[8](https://cloud.google.com/datastream/pricing)</sup> |

## 用途与使用场景

Datastream 从运营数据库中捕获持续发生的变更，并近实时地投递到 Google Cloud。Google 的文档列出了三大主要场景：数据集成，即数据库和 SaaS 流为加载到 BigQuery 的近实时管道提供数据；流式分析，即将数据库变更摄取到 Dataflow 管道中，用于欺诈检测、安全事件处理和异常检测；以及为机器学习、客户流失预防和营销活动等应用提供近实时的数据变更可用性。<sup>[6](https://docs.cloud.google.com/datastream/docs/behavior-overview)</sup> 其他已说明的用途包括低停机数据库迁移，以及源和目标位于不同托管环境的混合云配置。<sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup>

发布之初，Google 将该服务定位于实时分析、数据库复制和事件驱动架构，早期客户包括[美国职业棒球大联盟](https://www.edgepedia.org/zh/major-league-baseball)和 Schnuck Markets, Inc.；这家连锁杂货店使用 Datastream 将本地 Oracle 数据复制到 BigQuery 和 Cloud SQL，消除了其分析中数小时的延迟。<sup>[5](https://www.googlecloudpresscorner.com/2021-05-26-Google-Cloud-Launches-Three-New-Services-to-Empower-Customers-with-Unified-Data-Cloud-Strategy)</sup><sup> • </sup><sup>[9](https://www.techtarget.com/data-technologies/news/252501528/Google-Datastream-advances-change-data-capture-in-the-cloud)</sup>

## 工作原理

**基于日志的提取。** Datastream 使用 Google 所称的 Google 原生、无代理、高规模日志读取器技术，从数据库的 CDC 日志生成变更流，同时尽量减少对源端的性能影响。<sup>[1](https://cloud.google.com/blog/products/databases/new-cloud-based-cdc-replication-across-databases)</sup> 提取机制因引擎而异：对于 MySQL，Datastream 处理 MySQL 二进制日志；对于 Oracle，它使用 LogMiner 和补充日志设置来读取 Oracle 的重做日志；对于 [PostgreSQL](https://www.edgepedia.org/zh/postgresql) 和 AlloyDB for PostgreSQL，它依赖 PostgreSQL 的逻辑解码功能；对于 SQL Server，它使用事务日志跟踪 DML 变更。<sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup> Datastream 不复制整个日志文件；它直接从数据库服务器查询日志文件，仅复制指定表的变更。<sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup>

**流、配置文件和连接性。** Datastream 的设置包含三个主要元素：私有连接配置，使服务能够通过 VPC 对等连接经由私有网络访问数据源（在 Google Cloud 内部，或通过 VPN 或 Interconnect 访问外部源）；连接配置文件，保存源端和目标端的连接信息；以及流，使用这些配置文件将 CDC 和回填数据从源端传输到目标端。<sup>[4](https://docs.cloud.google.com/datastream/docs/overview)</sup>

**回填与 CDC 同时进行。** 数据源中存有流连接之前就已存在的数据，因此 Datastream 既从历史数据（回填）生成事件，也从实时发生的变更生成事件，两者同时复制。事件元数据指示事件来自回填还是 CDC。<sup>[6](https://docs.cloud.google.com/datastream/docs/behavior-overview)</sup>

## 源与目标端

支持的数据库源为 MySQL、Oracle、PostgreSQL（包括 AlloyDB for PostgreSQL 和 AlloyDB Omni）、SQL Server、MongoDB 和 Spanner；[Salesforce](https://www.edgepedia.org/zh/salesforce) 作为应用程序源受支持，[Salesforce Marketing Cloud](https://www.edgepedia.org/zh/salesforce-marketing-cloud)、ServiceNow、Microsoft Dataverse 和 Workday 处于预览阶段。<sup>[4](https://docs.cloud.google.com/datastream/docs/overview)</sup> 目标端支持涵盖 BigQuery、Apache Iceberg 表（通过 [BigLake](https://www.edgepedia.org/zh/biglake) 添加，自 2025 年 6 月起在控制台和 API 中可用）和 Cloud Storage。<sup>[4](https://docs.cloud.google.com/datastream/docs/overview)</sup><sup> • </sup><sup>[3](https://docs.cloud.google.com/datastream/docs/release-notes?hl=en)</sup> 与 Pub/Sub 和 Dataflow 模板的集成可将投递扩展至 Cloud SQL 和 Spanner 等目标端，Datastream 还与 Knowledge Catalog 集成，实现集中式元数据和血缘管理。<sup>[4](https://docs.cloud.google.com/datastream/docs/overview)</sup>

存在通用限制：复制期间不支持某些 DDL 操作，各源特定的限制页面规定一个流最多可包含 10,000 张表。<sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup>

## 可靠性与运维

Datastream 是一项区域服务，在每个区域的多个可用区中运行，因此单个可用区的故障不会影响其他可用区的可用性。在区域中断期间，该区域内的流在中断持续期间不可用；中断解决后，Datastream 从停止处恢复，并从源端重新获取未写入的数据，这可能在目标端留下重复数据。<sup>[6](https://docs.cloud.google.com/datastream/docs/behavior-overview)</sup> 此行为与至少一次投递保证相配合：元数据允许在目标端删除重复数据。<sup>[6](https://docs.cloud.google.com/datastream/docs/behavior-overview)</sup>

关于延迟，Google 指出 Datastream 在事件吞吐量上升时会自动扩展，但会限制其打开的并发连接和进程数，以保护源数据库和服务本身；吞吐量大幅增加后的临时延迟峰值预计会随着积压的处理而降低。<sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup>

## 定价

Datastream 按从源端到目标端处理的数据量计费，以字节为增量；空闲流不产生费用，已读取但未写入目标端的事件不计入。<sup>[7](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)</sup><sup> • </sup><sup>[8](https://cloud.google.com/datastream/pricing)</sup> CDC 定价按每个结算账号每月阶梯计费：前 2,500 GiB 为 2.00 美元/GiB，2,500 至 5,000 GiB 为 1.50 美元/GiB，5,000 至 10,000 GiB 为 1.20 美元/GiB，10,000 GiB 以上为 0.80 美元/GiB，超过 10 TB 需联系销售。<sup>[8](https://cloud.google.com/datastream/pricing)</sup> 回填在每月前 500 GiB 免费之后采用 0.40 美元/GiB 的固定费率。<sup>[8](https://cloud.google.com/datastream/pricing)</sup> Google 提醒，“处理的字节”是源数据的内部表示，在大多数用例中可能比实际数据大 2 到 5 倍。<sup>[8](https://cloud.google.com/datastream/pricing)</sup>

Google 公布的示例计算——在爱荷华州向 BigQuery 回填 600 GiB 加上每月 3,000 GiB 的 CDC——总计 5,790.00 美元：40.00 美元回填加上 5,750.00 美元 CDC。与 Datastream 配合使用的 BigQuery、BigQuery CDC、Cloud Storage、Dataflow 和网络资源按这些服务各自的定价单独计费。<sup>[8](https://cloud.google.com/datastream/pricing)</sup> 2026 年 6 月的一个版本为第一方源（目前是 AlloyDB 和 Spanner 流入 BigQuery 的流）增加了每月每结算账号 100 GiB CDC 数据的永久免费额度。<sup>[3](https://docs.cloud.google.com/datastream/docs/release-notes?hl=en)</sup><sup> • </sup><sup>[8](https://cloud.google.com/datastream/pricing)</sup>

## 历史与发展

Datastream 于 2021 年 5 月 26 日在 Google Cloud 首届 Data Cloud Summit 上作为三个预览版之一（与 Dataplex 和 Analytics Hub 一同）发布，是 Google 统一数据云战略的一部分。<sup>[1](https://cloud.google.com/blog/products/databases/new-cloud-based-cdc-replication-across-databases)</sup><sup> • </sup><sup>[5](https://www.googlecloudpresscorner.com/2021-05-26-Google-Cloud-Launches-Three-New-Services-to-Empower-Customers-with-Unified-Data-Cloud-Strategy)</sup> 它于 2021 年 12 月 1 日达到正式可用。<sup>[2](https://cloud.google.com/blog/products/data-analytics/serverless-change-data-capture-and-replication)</sup>

后续版本大幅扩展了产品。2022 年，Google 增加了客户管理加密密钥（2021 年 12 月）、BigQuery 作为目标端和 PostgreSQL 作为源（2022 年 9 月）、HIPAA 合规（2022 年 6 月），以及回填超过 1 亿行的 Oracle 表（2022 年 5 月）。<sup>[3](https://docs.cloud.google.com/datastream/docs/release-notes?hl=en)</sup> 后来的里程碑包括 Salesforce 于 2025 年 9 月正式可用、MongoDB 作为源于 2025 年 9 月正式可用、Spanner 作为源（2026 年 1 月）、Knowledge Catalog 集成（2026 年 4 月）、用于管理流的 LLM 代理的 Datastream 远程 MCP 服务器预览版（2026 年 4 月），以及从 Cloud SQL、AlloyDB 和 Spanner 实例页面自动创建流的流程。<sup>[3](https://docs.cloud.google.com/datastream/docs/release-notes?hl=en)</sup>

## 在 CDC 工具中的定位

变更数据捕获工具的独立比较将 Datastream 与 [AWS Database Migration Service](https://www.edgepedia.org/zh/aws-database-migration-service) 和 [Azure Data Factory](https://www.edgepedia.org/zh/azure-data-factory) 一同归入云原生 CDC 服务，区别于 [Debezium](https://www.edgepedia.org/zh/debezium)、Fivetran、Airbyte 和 Estuary 等开源和商业工具。<sup>[10](https://dataworkers.io/resources/cdc-tools-comparison/)</sup> 一份已发布的成本模型分析将 Datastream 按吉比字节（GiB）阶梯计费与 AWS DMS 按复制实例小时计费进行对比，指出 Datastream 对空闲流不收费，而 DMS 无论变更量多少都持续对实例计费。<sup>[11](https://papers.ssrn.com/sol3/Delivery.cfm/7547221.pdf?abstractid=7547221&mirid=1)</sup>

Google 的产品页面称 Datastream 每月处理超过五千亿个事件。<sup>[12](https://cloud.google.com/datastream)</sup> G2 上的用户评论普遍将无缝跨数据库集成和无服务器设置列为优势，同时指出该服务位于 Google Cloud 环境内，这使得对已标准化使用 AWS 或 Azure 的组织而言采用不太方便。<sup>[13](https://www.g2.com/products/google-datastream/reviews)</sup>

## References

1. [Unlock the power of change data capture and replication with new, serverless Datastream (May 26, 2021), Google Cloud Blog](https://cloud.google.com/blog/products/databases/new-cloud-based-cdc-replication-across-databases)
2. [Unlock the power of change data capture and replication with new, serverless Datastream, now GA (December 1, 2021), Google Cloud Blog](https://cloud.google.com/blog/products/data-analytics/serverless-change-data-capture-and-replication)
3. [Datastream release notes, Google Cloud Documentation](https://docs.cloud.google.com/datastream/docs/release-notes?hl=en)
4. [Datastream overview, Google Cloud Documentation](https://docs.cloud.google.com/datastream/docs/overview)
5. [Google Cloud Launches Three New Services to Empower Customers with Unified Data Cloud Strategy (May 26, 2021), Google Cloud Press Corner](https://www.googlecloudpresscorner.com/2021-05-26-Google-Cloud-Launches-Three-New-Services-to-Empower-Customers-with-Unified-Data-Cloud-Strategy)
6. [Key concepts and features, Datastream, Google Cloud Documentation](https://docs.cloud.google.com/datastream/docs/behavior-overview)
7. [FAQ, Datastream, Google Cloud Documentation](https://docs.cloud.google.cn/datastream/docs/faq?hl=en)
8. [Datastream pricing, Google Cloud](https://cloud.google.com/datastream/pricing)
9. [Google Datastream advances change data capture in the cloud (May 27, 2021), TechTarget](https://www.techtarget.com/data-technologies/news/252501528/Google-Datastream-advances-change-data-capture-in-the-cloud)
10. [CDC Tools Comparison: Debezium, Fivetran, Airbyte, Estuary, Data Workers](https://dataworkers.io/resources/cdc-tools-comparison/)
11. [FNU Aditya Ranjan, Change Data Capture Cost Models: Log-Based vs. Query-Based CDC Across Cloud Platforms, SSRN](https://papers.ssrn.com/sol3/Delivery.cfm/7547221.pdf?abstractid=7547221&mirid=1)
12. [Change Data Capture (Datastream product page), Google Cloud](https://cloud.google.com/datastream)
13. [Google Datastream Reviews, G2](https://www.g2.com/products/google-datastream/reviews)

---
*Initially written Oct 26, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Databases and data systems › Data mining, warehousing, and big data › Big data industry, companies, and products

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/google-datastream

English original: https://www.edgepedia.org/google-datastream
