Azure Cosmos DB 是多模型是什么意思? [英] What does it mean that Azure Cosmos DB is multi-model?

查看:14
本文介绍了Azure Cosmos DB 是多模型是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看着新的 Azure cosmos 数据库,我对它的多模型性质有点困惑.具体是指:

Looking at the new Azure cosmos database, I'm a bit confused about the multi-model nature of it. Specifically, does it mean:

a) 可以同时以多种方式查询同一个底层数据库/存储,以便我可以同时使用 gremlin 图形查询和 mongodb api 来处理相同的集合.

a) That the same underlying database/store can be queried multiple ways concurrently so that I can use both gremlin graph queries and mongodb api against the same collections.

  • 或 -

b) 这是否意味着您可以在配置 Cosmos DB 时选择不同的模型(图形、键值、列、文档),这就是从那时起存储数据的方式.

b) Does it mean that you can choose a different model (graph, key value, column, document) at the time of provisioning your Cosmos DB and that is how the data will be stored from then on.

小册子听起来像 a),但使用 Azure 仪表板创建 cosmos 实例看起来像 b),因为您必须在创建时选择模型类型.

The brochure makes it sound like a), but using the Azure dashboard to create a cosmos instance it makes it seem like b) since you have to choose a model type at creation.

此外,文献中提到了柱状数据,但我在创建时没有看到它的选项.

Additionally, the literature makes reference to columnar data, but I don't see the option for it at create time.

推荐答案

接受的答案遗漏了一些要点.

The accepted answer misses out on some points.

Cosmos DB 是一个 NoSQL 数据库,但它是高度分布式的,我们它的存储格式是 Atom-Record-Sequence.

Cosmos DB is a NoSQL database, but it is highly distributed and we its storage format is Atom-Record-Sequence.

为什么这很重要?我们知道它接受 JSON 作为输入和输出格式,这并不意味着 Cosmos 将其数据存储为 JSON,它实际上可以是任何格式.这有助于我们推断 Cosmos 的多模型性:当您根据某个模型执行查询时,您得到的可能是您的数据的投影或视图.

Why does that matter? We know that it accepts JSON as in- and output formats, that does not mean Cosmos stores its data as JSON, it could be any format actually. This helps us to reason about the multi-modelness of Cosmos: what you get when you execute a query according to a certain model is probably a projection or view of your data.

@JesseCarter 已经解释过我们可以互换使用 Document API 和 Graph API.上周 Table API 被公开宣布,可能这个 API 也没有太大的不同.

@JesseCarter already explained we can interchangeably use Document API and Graph API. Last week Table API got publicly announced and probably this API is not too different as well.

Spectologic 的人写了一篇关于 Cosmos 的跨 API 使用的不错的博文,并且还指出多模型更多的是装饰而不是内部,唯一真正的例外是 Mongo.此处的切换门户体验"一章中指出了有趣的部分:https://blog.spectologic.com/2017/06/30/digging-into-cosmosdb-storage/

The guys over at Spectologic have written a nice blogpost about the Cross-API usage of Cosmos and have also pointed out that the multi-modelness is more cosmetics than internals, the only real exception seems Mongo. The interesting part gets pointed out in the chapter 'Switching the portal experience' here: https://blog.spectologic.com/2017/06/30/digging-into-cosmosdb-storage/

所以也许最终归结为 GlobalDocumentDbMongoDb

So maybe in the end it boils down to GlobalDocumentDb vs. MongoDb

这篇关于Azure Cosmos DB 是多模型是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆