azure api 管理

In my previous article, I’ve discussed a lot about the Graph database implementation with SQL Server 2017. In this case, we’ll see a walk-through of Graph API integration with Azure Cosmos DB.

在上一篇文章中,我讨论了很多有关使用SQL Server 2017实现Graph数据库的问题 。 在这种情况下,我们将看到Graph API与Azure Cosmos DB集成的演练。

Before we jump into the concepts though, let’s take a high-level overview of NoSQL databases. A NoSQL database is designed in such a way that no extra efforts are needed for the database to be distributed because NoSQL Database designed that way.

在进入概念之前,让我们对NoSQL数据库进行一个高级概述。 NoSQL数据库的设计方式是,由于NoSQL数据库是通过这种方式设计的,因此无需付出额外的精力即可分配数据库。

Note: In one of my previous article, I talked about differences between SQL vs NoSQL. I would recommend reading it for the better understanding of NoSQL concepts.

注意:在上一篇文章中,我谈到了 SQL与NoSQL 之间的区别 我建议阅读它,以更好地理解NoSQL概念。

什么是Azure Cosmos DB? (What is Azure Cosmos DB?)

Having explained the basic characteristics of a NoSQL database, we can now take a look at what Azure Cosmos DB is all about. In sort, it is an extension of Document DB, which has been Microsoft’s NoSQL document database running on Microsoft Azure since 2015. Cosmos DB capabilities started with Document DB, which was already delivering low latency and high availability for schema-free JSON documents.

在说明了NoSQL数据库的基本特征之后,我们现在可以看看Azure Cosmos DB的全部含义。 从某种意义上说,它是Document DB的扩展,Document DB是自2015年以来在Microsoft Azure上运行的Microsoft NoSQL文档数据库。CosmosDB功能始于Document DB,它已经为无模式的JSON文档提供了低延迟和高可用性。

Azure Cosmos DB is Microsoft’s globally distributed, fully managed, multi-model database service with global distribution of the data, elastic scaling, automatic tuning, and provides querying capabilities, and it also support Gremlin standard. You can quickly create and query document, key/value, and graph databases, all of which benefit from the global distribution and horizontal scale capabilities at the core of Azure Cosmos DB. It also provides the ability to use multiple models like document and graph over the same data. For example, you can use a document collection to store graph data side by side with documents, and use both SQL queries over JSON and Gremlin queries to query the collection.

Azure Cosmos DB是Microsoft的全球分布式,完全托管的多模型数据库服务,具有数据的全局分布,弹性伸缩,自动调整,并提供查询功能,并且还支持Gremlin标准。 您可以快速创建和查询文档,键/值和图形数据库,所有这些都受益于Azure Cosmos DB核心的全局分布和水平缩放功能。 它还提供对同一数据使用多个模型(如文档和图形)的功能。 例如,您可以使用文档集合与文档并排存储图形数据,并同时使用基于JSONSQL查询和Gremlin查询来查询集合。

先决条件 (Prerequisites)

  1. Requires an Azure subscription 需要Azure订阅
  2. free Azure subscription account 免费的Azure订阅帐户
  3. Basic knowledge of Graph databases 图数据库的基本知识
  4. Gremlin query Gremlin查询
  5. Basic understanding of JSON documents 基本了解JSON文档

入门 (Getting started)

Let’s jump in and get started.

让我们开始吧。

The following step by step details gives you the required information to understand the concepts of the design of Azure Cosmos DB. In this section, let us a take a look at the ways to create, query, and traverse the Graph database models.

以下分步详细信息为您提供了必要的信息,以了解Azure Cosmos DB设计的概念。 在本节中,让我们看一下创建,查询和遍历Graph数据库模型的方法。

  1. portal.azure.com and enter the required credentials portal.azure.com并输入所需的凭据
  2. + New button and type the search string “Cosmos” to lookup for Azure Cosmos DB component+新建按钮,然后键入搜索字符串“ Cosmos”以查找Azure Cosmos DB组件
  3. Create button at the bottom of the screen创建按钮
    • Key-Value 核心价值
    • Column family 列族
    • Documents 文件资料
    • Graph 图形
  4. ID

    unique name

    The unique name graphdemo will be used to identify this Azure Cosmos DB account. The URI, graphdemodb.documents.azure.com is a new unique identifiable ID.

    API

    Gremlin (graph)

    The GraphAPI, Gremlin (graph) is selected out of five APIs suite.

    Subscription

    Your subscription

    Select Azure subscription. In this case its pay-as-you-go subscription is selected. This is type that is used for Azure Cosmos DB account.

    Resource group

    Enter the Resource Group

    Enter the new or existing resource group. In this case, the new resource group called graphresource is created.

    Location

    Select the nearest location

    Use the closest location that gives an optimal performance gain to access the data.

    Enable geo-redundancy

    Check/un-check

    To create a replicated version of the database over a second (paired) region.

    Pin-to-dashboard

    Select

    This option adds the database to the dashboard for easy access.

    ID

    唯一名称

    唯一名称graphdemo将用于标识此Azure Cosmos DB帐户。 URI graphdemodb.documents.azure.com是一个新的唯一可识别ID。

    API

    格林姆林(图)

    从五个API套件中选择了GraphAPI Gremlin(图形)。

    订阅

    您的订阅

    选择Azure订阅。 在这种情况下,将选择其按需付费订阅。 该类型用于Azure Cosmos DB帐户。

    资源组

    输入资源组

    输入新的或现有的资源组。 在这种情况下,将创建名为graphresource的新资源组。

    位置

    选择最近的位置

    使用最能提高性能的最接近位置访问数据。

    启用地理冗余

    选中/取消选中

    在第二个(配对)区域上创建数据库的复制版本。

    针到仪表板

    选择

    此选项将数据库添加到仪表板以便于访问。

  5. Click Create 点击创建
  6. ‘Persons’ container. This can be done in two ways: “人员”容器下的Graph数据库中创建和查询顶点。 这可以通过两种方式完成:
    • Apply filter to run the Gremlin query应用过滤器”以运行Gremlin查询

      g.addV(‘person’).property(‘firstName’, ‘Prashanth’).property(‘lastName’, ‘Jayaram’).property(‘age’, 35).property(‘skillset’, ‘SQL’)

      g.addV('person')。property('firstName','Prashanth')。property('lastName','Jayaram')。property('age',35).property('skillset','SQL')

      You can run g.V().count() command to list all the vertices

      您可以运行gV()。count()命令列出所有顶点

      1. g.addV(‘person’).property(‘firstName’, ‘Brian’).property(‘lastName’, ‘Lockwood’).property(‘age’, 50).property(‘skillset’, ‘SQL’)
      2. g.addV('person')。property('firstName','Brian')。property('lastName','Lockwood')。property('age',50).property('skillset','SQL')
      3. g.addV(‘person’).property(‘firstName’, ‘Samir’).property(‘lastName’, ‘Behara’).property(‘age’, 35).property(‘skillset’, ‘.Net’)
      4. g.addV('person')。property('firstName','Samir')。property('lastName','Behara')。property('age',35).property('skillset','.Net' )
    • Apply filter应用过滤器”
    • g.V().hasLabel(‘person’).has(‘firstName’, ‘Prashanth’)

      gV()。hasLabel('person')。has('firstName','Prashanth')

  7. knows”. Let’s define a relationship that Brain knows Prashanth and Samir using firstName properties of the person label知道”。 我们使用人员标签的firstName属性来定义Brain知道Prashanth和Samir的关系

    g.V().hasLabel(‘person’).has(‘firstName’,’Brian’).addE(‘knows’).to(g.v().hasLabel(‘person’).has(‘firstName’,’Prashanth’))

    gV()。hasLabel('person')。has('firstName','Brian')。addE('knows')。to(gv()。hasLabel('person')。has('firstName','Prashanth '))

    g.V().hasLabel(‘person’).has(‘firstName’,’Brian’).addE(‘knows’).to(g.v().hasLabel(‘person’).has(‘firstName’,’Samir’))

    gV()。hasLabel('person')。has('firstName','Brian')。addE('knows')。to(gv()。hasLabel('person')。has('firstName','Samir '))

    On clicking each vertex, we can see the relationship between all three

    单击每个顶点,我们可以看到所有三个之间的关系

    g.V().hasLabel(‘person’).has(‘firstName’, ‘Brian’)

    gV()。hasLabel('person')。has('firstName','Brian')

  8. g.V().hasLabel(‘person’).has(‘firstName’, ‘Prashanth’).property(‘age’, 34)

    gV()。hasLabel('person')。has('firstName','Prashanth')。property('age',34)

    Let us query to find the persons who have SQL as his skillset

    让我们查询以掌握SQL为技能的人

    g.V().hasLabel(‘person’).has(‘skillset’, ‘SQL’)

    gV()。hasLabel('person')。has('skillset','SQL')

    SQL查询 (SQL Query)

    Now, let’s try to run a query against the dataset to understand some of the key aspects of Azure Cosmos DB’s SQL query language. For example, the following query returns the documents where the id field matches “1”. The output of the query is the complete JSON document.

    现在,让我们尝试对数据集运行查询,以了解Azure Cosmos DBSQL查询语言的一些关键方面。 例如,以下查询返回id字段与“ 1”匹配的文档。 查询的输出是完整的JSON文档。

    To run a query against a Persons collection

    对人员集合运行查询

    1. New Query 新查询
    2. SELECT { “id”:p.id, “Name”:p.name, “Age”: p.age} FROM Persons p where p.id=”1″

      SELECT {“ id”:p.id,“ Name”:p.name,“ Age”:p.age} FROM Persons其中p.id =“ 1”

    3. To run the query, press the execute icon which is marked 3 in the below image 要运行查询,请按下下图中标记为3的执行图标。

    That’s all for now…

    目前为止就这样了…

    摘要 (Summary)

    Thus far, we’ve covered a lot of ground in this first article. We started with NoSQL; comparison between SQL vs NoSQL. We then introduced Microsoft Azure Cosmos DB as Microsoft’s distributed NoSQL database. You also witnessed how to get started using the Azure portal to create a Cosmos DB account and integration of the Graph database API with Cosmos DB. Then we’ve created the sub-documents in the collection and then query the collection. In my next article, I will include a few complex models to give more insight into Cosmos DB integration. Thanks for reading this article. Feel free to comment below…

    到目前为止,我们在第一篇文章中已经涵盖了很多基础。 我们从NoSQL开始; SQL与NoSQL之间的比较。 然后,我们引入了Microsoft Azure Cosmos DB作为Microsoft的分布式NoSQL数据库。 您还见证了如何开始使用Azure门户创建Cosmos DB帐户以及Graph数据库API与Cosmos DB的集成。 然后,我们在集合中创建了子文档,然后查询集合。 在我的下一篇文章中,我将包括一些复杂的模型,以提供对Cosmos DB集成的更多见解。 感谢您阅读本文。 请在下面随意评论...

翻译自: https://www.sqlshack.com/graph-database-implementation-with-azure-cosmos-db-using-the-api/

azure api 管理

azure api 管理_使用API​​使用Azure Cosmos DB进行图形数据库实现相关推荐

  1. azure api 管理_通过成本管理跟踪Azure成本

    azure api 管理 The Azure Portal offers the free tool Cost Management that we can use for managing Azur ...

  2. azure api 管理_具有Azure功能的无服务器API

    azure api 管理 在这篇文章中,我将研究一个非常简单的用例. 在执行部署管道时, FlexDeploy可能会产生一些应被批准或拒绝的人工任务. 例如,某人必须批准对生产环境的部署. 可以在Fl ...

  3. 爽到爆!阿里腾讯都在用的API管理神器,API文档、测试、Mock全搞定

    作为一个后端开发,我做的大部分项目一般都是基于 Swagger 来管理 API 文档,基于 Postman 来做接口调试,基于 JMeter 来做接口性能测试,基于 RAP 等工具 Mock API ...

  4. promise的状态以及api介绍_前端 api 请求缓存

    作者:wsafight https://github.com/wsafight/personBlog/issues/2 web开发时,性能都是必不可少的话题.对于webpack打包的单页面应用程序而言 ...

  5. azure 安全组_用户安全和Azure成本风险

    azure 安全组 We've looked at both the organization and development side of managing Azure costs. One ri ...

  6. python api讲解_集合api讲解_Python C编程视频课程_Python视频-51CTO学院

    我们为什么要学习Python C编程? 第一个原因,用Python进行项目开发时,很多时候都需要用Python C来扩展Python模块,优化Python脚本的执行效率. 第二个原因,很多项目用C/C ...

  7. 微软azure是什么_什么是Microsoft Azure? 它是如何工作的?

    微软azure是什么 Microsoft Azure is a cloud computing service created and run by Microsoft. Azure provides ...

  8. sql azure 语法_什么是Azure SQL Cosmos DB?

    sql azure 语法 介绍 (Introduction) In the Azure Portal, you will find the option to install Azure SQL Co ...

  9. 云小课 | 使用ROMA API,API管理从此不用愁

    阅识风云是华为云信息大咖,擅长将复杂信息多元化呈现,其出品的一张图(云图说).深入浅出的博文(云小课)或短视频(云视厅)总有一款能让您快速上手华为云.更多精彩内容请单击此处. 摘要:ROMA API致 ...

最新文章

  1. ggplot2笔记8:主题设置、存储导出
  2. html屏幕宽度一体式下拉菜单怎么做_针对白屏埋点,我是这样做的
  3. 发现qq的mac输入法2.8,在终端全屏下输入不显示待选文字或单词
  4. 06 MapReduce工作机制
  5. html复选框全选按钮代码,全选复选框JavaScript编写小结(附代码)
  6. bower使用中遇到的问题
  7. 数学建模层次分析法例题及答案_数学建模层次分析法题目及程序
  8. 七宗罪----人性本恶
  9. 数据分析的软件最全场景盘点
  10. 计算机操作技能竞赛系列方案,2019 年上学期计算机文字录入操作技能竞赛
  11. CSR867x — 说说什么是ANC、CVC、DSP降噪
  12. arcgis批量裁剪影像tif流程_ArcGIS超级工具SPTOOLS-影像的批量裁剪和批量合并
  13. PS通道抠图及选区白边处理
  14. CAD中如何裁剪需要的区域
  15. LC串联谐振的分析方法
  16. 【中值滤波和最邻近插值(matlab)】
  17. 青岛科技大学计算机一级报名,2019年3月山东青岛科技大学计算机等级考试报名通知...
  18. python模块总结_Python常用模块资料总结和归纳
  19. Windows和Linux双系统下grub选单的清除
  20. 半双工通信java_Socket实现一个简单的半双工通信

热门文章

  1. 正则表达式 IP域名
  2. Unity3D ARPG网络游戏编程实践
  3. Android中的设计模式之观察者模式
  4. spring复杂数据类型传递
  5. svn提交代码失败提示清理(清理失败并且报错信息乱码解决办法)
  6. 认知心理学告诉你什么才是高效学习
  7. leetcode 137[转]
  8. android 动态壁纸开发
  9. Gentoo Framebuffer, Bootsplash Grubsplash 指南(修改版)
  10. 零基础带你学习MySQL—备份恢复数据库(三)