未加星标

Getting Started with Azure Cosmos DB and MongoDB API

字体大小 | |
[数据库(综合) 所属分类 数据库(综合) | 发布者 店小二04 | 时间 2018 | 作者 红领巾 ] 0人收藏点击收藏

In the previous article on Azure Cosmos DB, we reviewed NoSQL concepts and how to integrate with the Microsoft Azure platform-as-a-service model using the API . After working as a database engineer for over a decade, I feel that this technology is the future for many organizations for various reasons. I had that in mind as I wrote this article which will provide basic information and help you to get started with MongoDB API integration. The MongoDB API works with BSON documents. BSON is MongoDB’s binary-encoded-version of JSON, and it extends the JSON model with additional language feature support. It’s a great effort from Microsoft to build the enterprise solutions which provide flexibility in manage distributed data along with scalable option.

A quick overview

Azure Cosmos DB is a derived version of Azure DocumentDB Its launched with Microsoft build in May 2017 It’s a globally distributed multi-model database PaaS model The data is globally distributed with automatic index tuning is enabled by default Enterprise features include: Globally distributed Automatic sharding Availability and latency guaranteed Automatic indexing tuning Encryption Backups

Let’s deep dive into the this Microsoft Azure PaaS (platform-as-a-service ) offering and see how it can be beneficial for us. This article covers the following topics:

Introduction Setting up Creating a database and collection MongoDB query samples And more… Quick overview

Azure Cosmos DB is a globally distributed, replicated, multi-model database service that offers 99.99% availability within the region. It also offers rich querying over schema-free data, helps to deliver configurable and reliable performance, and enables rapid development.

Azure Cosmos DB is a right choice for many or new web, mobile, gaming, and IoT applications where automatic scaling, predictable performance, high availability, high throughput, rich indexing, and provide a platform for rapid application building process and rich capability to query over schema-free data are the key requirements.

Advantages

Azure Cosmos DB is a complete service and ready to use: It gives you a complete product and can be automatically replicated in data centers worldwide using local and global distribution. Partitioning provides elastic scaling and its automatic, the resource partition is first spread across the regions using a local distribution layer and the resource partitions are replicated across global regions using global distribution.

Getting started

Let’s pop into the demo,and create a new account.

This section details the step required to create and configure Azure Cosmos DB.

Log in to the Azure portal On the left part of the screen, clickthe New button and type the search string Cosmos to lookup for Azure Cosmos DB
Getting Started with Azure Cosmos DB and MongoDB API

In theNew accountform, enter the required configuration for the new account.

Four programming models are supported:

Key-Value Column family Documents Graph

In this section, we’ll walk-through the steps to integrate MongoDB API. Let us choose MongoDB API and type in other values of the form. The following table takes you through the required information to fill out the values needed for the MongoDB API integration

Setting

Suggested value

Description

ID

Unique value

A unique name you choose to identify the new account. documents.azure.com is appended to the ID you provide to create your URI, so use a unique but identifiable ID. The ID may contain only lowercase letters, numbers, and the ‘-‘ character, and must be between 3 and 50 characters.

API

MongoDB

The API determines the type of account to create. Five APIs exist to suit the needs of your application: SQL (document database), Gremlin (graph database), MongoDB (document database), Azure Table, and Cassandra, each which currently require a separate account.

SelectMongoDBbecause in this quick start you are creating a document database that is queryable using MongoDB.

Learn more about the MongoDB API

Subscription

Your subscription

The Azure subscription that you want to use for the new account

Resource Group

The same value as ID

The new resource group name for your account. For simplicity, you can use the same name as your ID.

Location

The region closest to your users

The geographic location in which to host your Azure Cosmos DB account. Choose the location closest to your users to give them the fastest access to the data.

ClickCreateto create the account.
Getting Started with Azure Cosmos DB and MongoDB API
Extensible Multi-APIs

The database is first stored locally.This is our local distribution level.In this case, it happens to be in the region of US East.The databases are then replicated to other regions.This always ensures that the databaseis available and easily accessible.The extensible APIs that you can use include .NET, .NET Core, Node.js,Java, python, and MongoDB.If you’re using .NET, you can use DocumentDB API,MongoDB API, Graph API, or Table API.Java and Node.js will only work with the Document DB APIs,MongoDB APIs, and Graph APIs.Python will only work with the DocumentDB API,and Gremlin, only the Graph API.

Enable geo-redundancy

In this case, the Geo-Redundancy and Multi-region writes are disabled. For the demo, I will be going with the default setting. But, let us take a moment to discuss partitioning,which provides elastic scaling for Azure Cosmos DB.First, we have our local distribution layer.Here, the resource partitions are spread across the region.And then we have a global distribution layer,now our resource partitions are replicated. And the best part of this is,it’s all handled automatically

It uses five different phases of consistency levels: bounded staleness, strong, session, eventual, and consistent-prefix and it provides a guaranteed latency of less than 10 milliseconds for data read and less than 15 milliseconds for data write operations.


Getting Started with Azure Cosmos DB and MongoDB API
A Request unit (RU) is the measure of the throughput. It also ensures predictable performance no matter how demanding the workload the application

本文数据库(综合)相关术语:系统安全软件

代码区博客精选文章
分页:12
转载请注明
本文标题:Getting Started with Azure Cosmos DB and MongoDB API
本站链接:https://www.codesec.net/view/611343.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(综合) | 评论(0) | 阅读(183)