Azure CosmosDB (10) Azure Cosmos DB体系结构
《Windows Azure Platform 系列文章目录》
Azure Cosmos DB的体系结构分为以下几个部分:

1.Database Accounts
Database Account就是1个可以访问的namespace命名空间
2.Database
Database就是CosmosDB Container的集合
3.Database Container
Azure Cosmos Container是可缩放性预配的吞吐量和存储单元
下表描述了Azure Cosmos Database和特定API Entiry的对应关系
| Azure Cosmos Entity | SQL API | Cassandra API | Azure Cosmos DB's API for MongoDB | Gremlin API | Table API |
| Azure Cosmos database | database | Keyspace | databsae | database | NA |
Azure Cosmos Container
Azure Cosmos Container是可缩放性预配的吞吐量和存储单元。Container通过Partition Key(分区键)进行水平分区,并且支持在多个Azure数据中心进行复制。
当我们创建Azure Cosmos Container的时候,支持以下两种吞吐量模式:
1.独享模式
1个Container的吞吐量是独享的,不与其他Container共享Request Unit (RU)的吞吐量
2.共享模式
在同一个Database下的多个Azure container,互相共享Request Unit (RU)的吞吐量
无论采用独享模式,或者共享模式创建Container,Azure Cosmos Container都可以支持横向扩展
Azure Cosmos Container是与架构无关的,Container里的数据可以是任意架构。
举个例子,一个描述人的数据,与一个描述汽车的数据,都可以保存在同一个Container里
Azure Cosmos Container与特定API Entiry的对应关系
| Azure Cosmos Entity | SQL API | Cassandra API | Azure Cosmos DB's API for MongoDB | Gremlin API | Table API |
| Azure Cosmos Container | Collection | Table | Collection | Graph | Table |
也就是说,Azure Cosmos Container 在 Azure Cosmos DB API for MongoDB里,指的是Collection,也就是传统关系型数据库的Table数据表
Azure Cosmos Container中的属性:
Azure Cosmos 容器包含一组系统自定义属性。 根据所选的 API,其中一些属性可能不会直接公开。 下表描述了系统定义的属性的列表:
| Defined property | System generated or user-configurable | Purpose | SQL API | Cassandra API | Azure Cosmos DB's API for MongoDB | Gremlin API | Table API |
|---|---|---|---|---|---|---|---|
| _rid | System generated | Unique identifier of container | Yes | No | No | No | No |
| _etag | System generated | Entity tag used for optimistic concurrency control | Yes | No | No | No | No |
| _ts | System generated | Last updated timestamp of the container | Yes | No | No | No | No |
| _self | System generated | Addressable URI of the container | Yes | No | No | No | No |
| id | User configurable | User-defined unique name of the container | Yes | Yes | Yes | Yes | Yes |
| indexingPolicy | User configurable | Provides the ability to change the index path, index type and index mode. | Yes | No | No | No | Yes |
| TimeToLive | User configurable | Provides the ability to delete items automatically from a container after a certain time period. For more details, see the Time To Livearticle. | Yes | No | No | No | Yes |
| changeFeedPolicy | User configurable | Used to read changes made to items in a container. For more details, see the Change Feed article. | Yes | No | No | No | Yes |
| uniqueKeyPolicy | User configurable | Used to ensure the uniqueness of one or more values within a logical partition. For more information, see the Unique Key constraintsarticle. | Yes | No | No | No | Yes |
Azure Cosmos数据
根据选择不同的API,Azure Cosmos 数据可以表示一个文件,数据表中的一行,或者Graph API的一个节点。
下表表示Azure Cosmos数据与API实体之间的对应关系
| Azure Cosmos Entity | SQL API | Cassandra API | Azure Cosmos DB's API for MongoDB | Gremlin API | Table API |
| Azure Cosmos Item | Document | Row | Document | Node or Edge | Item |
Azure Cosmos数据的属性
Azure Cosmos数据有系统自定义的属性。根据所选的 API,其中一些属性可能不会直接公开。
| System defined property | System generated or user-configurable | Purpose | SQL API | Cassandra API | Azure Cosmos DB's API for MongoDB | Gremlin API | Table API |
|---|---|---|---|---|---|---|---|
| _id | System generated | Unique identifier of item | Yes | No | No | No | No |
| _etag | System generated | Entity tag used for optimistic concurrency control | Yes | No | No | No | No |
| _ts | System generated | The timestamp of the last update of the item | Yes | No | No | No | No |
| _self | System generated | Addressable URI of the item | Yes | No | No | No | No |
| id | Either | User-defined unique name within a logical partition. If the user doesn’t specify the id, the system will automatically generate one. | Yes | Yes | Yes | Yes | Yes |
| Arbitrary user-defined properties | User-defined | User-defined properties represented in API-native representation (JSON, BSON, CQL, etc.) | Yes | Yes | Yes | Yes | Yes |
Azure CosmosDB (10) Azure Cosmos DB体系结构的更多相关文章
- Azure CosmosDB (12) 创建Cosmos DB并执行查询语句
<Windows Azure Platform 系列文章目录> The SQL API supports the following aggregate functions. SUM an ...
- Azure Cosmos DB 使用费用参考
之前在学习Cosmos DB 中SQL API(DocumentDB) 的时候,也就是之前做的一些笔记,看到有使用费用的一些介绍,就有兴趣的去了解了下,做了一下简单的总结. 想了解更多或是购买使用的还 ...
- Azure Cosmos DB (二) SQL API 操作
一,引言 还记得国庆期间,我们学习了一下关于Azure Cosmos DB 的一些基础知识以及Azure Cosmos DB 的几种支持数据库类型.今天就开始分享一些实战操作,如何通过Azure Po ...
- Azure Cosmos DB (三) EF Core 操作CURD
一,引言 接着上一篇使用 EF Core 操作 Azure CosmosDB 生成种子数据,今天我们完成通过 EF Core 实现CRUD一系列功能.EF Core 3.0 提供了CosmosDB 数 ...
- Azure Cosmos DB (五) .Net Core 控制台应用
一,引言 之前在讲Azure CosmosDB Core(SQL)核心的时候,使用了EF Core 的方式,引用了 "Microsoft.EntityFrameworkCore.Cosmos ...
- Azure Cosmos DB介绍及演示
Azure Cosmos DB 是 Microsoft 提供的全球分布式多模型数据库服务.Cosmos DB是一种NoSql数据库,但是它兼容多种API.它支持SQL, MongoDB.Cassand ...
- Azure Cosmos DB (四) 使用EF的SQL API 异地冗余
一,引言 上一篇文章中,我们介绍到使用了EF Core 与Cosmos DB SQL API 进行结合开发.同时,大家在开发过程中一定要记得EF Core 不支持Cosmos DB 的迁移.今天我们启 ...
- NCF 的Azure Cosmos DB 演示案例
简介 NCF想必看过我之前发的NCF的文章的同学们都已经很熟悉了 今天我们要来聊一聊的是NCF遇到Azure Cosmos DB后会碰撞出什么样的火花,让我们一起往下看 我们先来说说什么是Azure ...
- Azure Cosmos DB (一) 入门介绍
一,引言 今天是国庆.中秋双节房价的第三天,今天抽时间分享一篇关于使用Azure 提供的一项NoSql 服务-----Azure Cosmos DB.就有人问了,我听说过 MongoDB.Redis ...
随机推荐
- 第一次玩博客,今天被安利了一个很方便JDBC的基于Spring框架的一个叫SimpleInsert的类,现在就来简单介绍一下
首先先对这段代码的简单介绍,我之前在需要操作JDBC的时候总是会因为经常要重新写SQL语句感到很麻烦.所以就能拿则拿不能拿的就简单地封装了一下. 首先是Insert.Spring框架的JDBC包里面的 ...
- Neural Network Programming - Deep Learning with PyTorch - YouTube
百度云链接: 链接:https://pan.baidu.com/s/1xU-CxXGCvV6o5Sksryj3fA 提取码:gawn
- PHP 位运算
$a & $b a,b二进制后,取得每对应为都有1的部分,然后再转换为十进制 $a | $b a,b二进制后,取得每对应为只要有1的部分,然后再转换为十进制 $a >&g ...
- c语言 实验1
实验结论 Part 1 首次运行Part 1的几个实验内容时会产生错误,原因如下 有时忘记在主函数中的每行末尾加分号 return 0 时空格错误导致程序运行失败 # include <stdi ...
- 微信小程序 获取用户信息授权
login.wxml界面 获取用户授权可以用微信提供的接口 wx.authorize, 但是获取用户信息的授权用这个接口不会弹出授权窗口 <button class="submit-b ...
- Prime31
https://prime31.com/plugins
- CAShapeLayer绘图
之前讲过使用UIBezierPath在UIView的drawRect中绘图, 今天我们讲下另外一种方式: CAShaperLayer 先说说使用CAShapeLayer的优点: GPU执行, GPU执 ...
- java.lang.NullPointerException错误的解决方案
java.lang.NullPointerException空指针异常是像我一样新手很容易出现的问题,这个问题一般情况都是不细心的时候出现的,开始正文如下: 1.业务层面的错误: a.没有写非空验证: ...
- C#action和func的使用
以前我都是通过定义一个delegate来写委托的,但是最近看一些外国人写的源码都是用action和func方式来写,当时感觉对这很陌生所以看起源码也觉得陌生,所以我就花费时间来学习下这两种方式,然后发 ...
- 【软件安装与环境配置】ubuntu16.04+caffe+nvidia+CUDA+cuDNN安装配置
前言 博主想使用caffe框架进行深度学习相关网络的训练和测试,刚开始做,特此记录学习过程. 环境配置方面,博主以为最容易卡壳的是GPU的NVIDIA驱动的安装和CUDA的安装,前者尝试的都要吐了,可 ...