Google Cloud Bigtable和Google Cloud Datastore / App Engine数据存储区有什么区别,主要的实际优点/缺点是什么? AFAIK Cloud Datastore构建于Bigtable之上。
根据Datastore的经验和阅读Bigtable docs,主要区别是:
Cloud Bigtable专为大型公司和企业而设计,这些公司和企业通常具有较大的数据需求和复杂的后端工作负载。
Bigtable和Datastore非常不同。是的,数据存储区建立在Bigtable之上,但这并不像它那样。这有点像说汽车是在车轮顶部建造的,因此汽车与车轮没什么不同。
Bigtable和Datastore提供了截然不同的数据模型,并且在数据更改方式上有着截然不同的语义。
主要区别在于数据存储区在称为实体组的数据子集上提供类似SQL数据库的ACID事务(尽管查询语言GQL比SQL更具限制性)。 Bigtable严格来说是NoSQL,并且提供了更少的保证。
我将尝试总结以上所有答案以及Coursea Google Cloud Platform Big Data and Machine Learning Fundamentals中给出的内容
+---------------------+------------------------------------------------------------------+------------------------------------------+--+
| Category | BigTable | Datastore | |
+---------------------+------------------------------------------------------------------+------------------------------------------+--+
| Technology | Based on HBase(uses HBase API) | Uses BigTable itself | |
| ---------------- | | | |
| Access Mataphor | Key/Value (column-families) like Hbase | Persistent hashmap | |
| ---------------- | | | |
| Read | Scan Rows | Filter Objects on property | |
| ---------------- | | | |
| Write | Put Row | Put Object | |
| ---------------- | | | |
| Update Granularity | can't update row ( you should write a new row, can't update one) | can update attribute | |
| ---------------- | | | |
| Capacity | Petabytes | Terbytes | |
| ---------------- | | | |
| Index | Index key only (you should properly design the key) | You can index any property of the object | |
| Usage and use cases | High throughput, scalable flatten data | Structured data for Google App Engine | |
+---------------------+------------------------------------------------------------------+------------------------------------------+--+
一个相对较小的一点需要考虑,截至2016年11月,bigtable python客户端library 仍处于Alpha状态,这意味着未来的变化可能不会向后兼容。此外,bigtable python库与App Engine的标准环境不兼容。你必须使用灵活的。
我刚刚在Datastore文档(强调我的)中发现了这个有用的类比,它隐藏在length page about eventual consistency中:
一种做法是结合使用Cloud Datastore和BigQuery来满足不同的业务需求。使用Cloud Datastore进行核心应用程序逻辑所需的联机事务处理(OLTP),并将BigQuery用于后端操作的联机分析处理(OLAP)。可能需要实施从Cloud Datastore到BigQuery的连续数据导出流,以移动这些查询所需的数据。