BigQuery 和 Bigtable 之间有什么区别?

What's the difference between BigQuery and Bigtable?

有人会使用 Bigtable 而不是 BigQuery 的原因是什么?两者似乎都支持读取和写入操作,后者还提供高级 'Query' 操作。

我需要开发一个附属网络(因此我需要跟踪点击次数和 'sales')所以我对其中的差异感到很困惑,因为 BigQuery 似乎只是具有更好 API 的 Bigtable .

区别基本上是这样的:

BigQuery 是一种查询引擎,适用于变化不大或通过追加进行更改的数据集。当您的查询需要 "table scan" 或需要查看整个数据库时,这是一个很好的选择。考虑总和、平均值、计数、分组。 BigQuery 是您收集大量数据时使用的工具,需要对此提出问题。

BigTable 是一个数据库。它旨在成为大型可扩展应用程序的基础。当您制作任何类型的需要读取和写入数据的应用程序时使用 BigTable,并且规模是一个潜在的问题。

这可能有助于在 Google 云提供的不同数据存储解决方案之间做出决定(免责声明!从 Google 云页面复制)

如果您的需求是实时数据库,那么 BigTable 就是您所需要的(虽然不是真正的 OLTP 系统)。如果它更像是一种分析目的,那么 BigQuery 就是您所需要的!

想想 OLTPOLAP;或者如果你熟悉 Cassandra vs Hadoop,BigTable 大致等同于 Cassandra,BigQuery 大致等同于 Hadoop(同意,这不是一个公平的比较,但你明白了)

https://cloud.google.com/images/storage-options/flowchart.svg

备注

请记住 Bigtable 不是关系数据库,它不支持 SQL 查询或 JOINs,也不支持 multi-row 交易。此外,对于少量数据,它也不是一个好的解决方案。如果你想要一个 RDBMS OLTP,你可能需要看看 cloudSQL (mysql/ postgres) 或 spanner.

成本角度

。此处引用相关部分。

The overall cost boils down to how often you will 'query' the data. If it's a backup and you don't replay events too often, it'll be dirt cheap. However, if you need to replay it daily once, you will start triggering the 5$/TB scanned very easily. We were surprised too how cheap inserts and storage were, but this is ofc because Google expects you to run expensive queries at some point in time on them. You'll have to design around a few things though. E.g. AFAIK streaming inserts have no guarantees of being written to the table and you have to poll frequently on tail of list to see if it was really written. Tailing can be done efficiently with time range table decorator, though (not paying for scanning whole dataset).

If you don't care about order, you can even list a table for free. No need to run a 'query' then.

编辑 1

云扳手比较年轻,但实力雄厚,前途无量。至少,google 营销声称它的功能是两全其美(传统 RDBMS 和非 SQL)

BigQuery 和 Cloud Bigtable 不一样。 Bigtable 是基于 Hadoop 的 NoSQL 数据库,而 BigQuery 是基于 SQL 的数据仓库。他们有特定的使用场景。

非常简短;

  • 如果您不需要支持 ACID 事务或者您的数据不是高度结构化的,请考虑 Cloud Bigtable。
  • 如果您需要在联机分析处理 (OLAP) 系统中进行交互式查询,请考虑使用 BigQuery。