Azure Cosmos DB 的用于 MongoDB 的 APIAzure Cosmos DB's API for MongoDB
适用于:
Azure Cosmos DB API for MongoDB
Azure Cosmos DB 是世纪互联针对任务关键型应用程序提供的多区域分配式多模型数据库服务。Azure Cosmos DB is 21Vianet's multiple-regionally distributed, multi-model database service for mission-critical applications. Azure Cosmos DB 在中国各地提供统包式多区域分发、吞吐量和存储的弹性扩展、99% 的情况下低至个位数的毫秒级延迟以及得到保证的高可用性,所有这些均由行业领先的 SLA 提供支持。Azure Cosmos DB provides turn-key multiple-region distribution, elastic scaling of throughput and storage around China, single-digit millisecond latencies at the 99th percentile, and guaranteed high availability, all backed by industry-leading SLAs. Azure Cosmos DB 自动为数据编制索引,无需客户管理架构和索引。Azure Cosmos DB automatically indexes data without requiring you to deal with schema and index management. 它是多模型的,支持文档、键值、图和列式数据模型。Azure Cosmos DB 服务为包含 Cassandra、MongoDB、Gremlin 和 Azure 表存储在内的常见 NoSQL API 实现 Wire Protocol。It is multi-model and supports document, key-value, graph, and columnar data models.Azure Cosmos DB service implements wire protocols for common NoSQL APIs including Cassandra, MongoDB, Gremlin, and Azure Table Storage. 这样,你便可以使用熟悉的 NoSQL 客户端驱动程序和工具来与 Cosmos 数据库交互。This allows you to use your familiar NoSQL client drivers and tools to interact with your Cosmos database.
备注
无服务器容量模式现在在 Azure Cosmos DB API for MongoDB 上可用。The serverless capacity mode is now available on Azure Cosmos DB's API for MongoDB.
网络协议兼容性Wire protocol compatibility
Azure Cosmos DB 实现 MongoDB 的 Wire Protocol。Azure Cosmos DB implements the wire protocol for MongoDB. 此实现允许与本机 MongoDB 客户端 SDK、驱动程序和工具进行透明兼容。This implementation allows transparent compatibility with native MongoDB client SDKs, drivers, and tools. Azure Cosmos DB 托管 MongoDB 数据库引擎。Azure Cosmos DB does host the MongoDB database engine. 可在此处找到受 MongoDB 支持的功能的详细信息:The details of the supported features by MongoDB can be found here:
- Azure Cosmos DB API for Mongo DB 引擎 3.6 版Azure Cosmos DB's API for Mongo DB engine version 3.6
- Azure Cosmos DB API for Mongo DB 引擎 3.2 版Azure Cosmos DB's API for Mongo DB engine version 3.2
默认情况下,使用 Azure Cosmos DB 的 API for MongoDB 创建的新帐户与 MongoDB 线路协议 3.6 版兼容。By default, new accounts created using Azure Cosmos DB's API for MongoDB are compatible with version 3.6 of the MongoDB wire protocol. 任何识别此协议版本的 MongoDB 客户端驱动程序应该可以本机连接到 Cosmos DB。Any MongoDB client driver that understands this protocol version should be able to natively connect to Cosmos DB.
主要优点Key benefits
作为一种完全托管的多区域分布式数据库即服务,Cosmos DB 的主要优势详见此处。The key benefits of Cosmos DB as a fully managed, multiple-regionally distributed, database as a service are described here. 此外,Cosmos DB 通过本机实现流行 NoSQL API 的网络协议来提供以下优势:Additionally, by natively implementing wire protocols of popular NoSQL APIs, Cosmos DB provides the following benefits:
- 轻松将应用程序迁移到 Cosmos DB,同时保留应用程序逻辑的重要部分。Easily migrate your application to Cosmos DB while preserving significant portions of your application logic.
- 使应用程序保持可移植性,并继续保持云供应商的不可知性。Keep your application portable and continue to remain cloud vendor-agnostic.
- 为 Cosmos DB 支持的常用 NoSQL API 获取行业领先的、有资金保障的 SLA。Get industry leading, financially backed SLAs for the common NoSQL APIs powered by Cosmos DB.
- 根据需求弹性缩放 Cosmos 数据库的预配吞吐量和存储,并且只需为使用的吞吐量和存储付费。Elastically scale the provisioned throughput and storage for your Cosmos databases based on your need and pay only for the throughput and storage you need. 这可以大幅节省成本。This leads to significant cost savings.
- 通过多区域写入复制功能实现统包式多区域分布。Turnkey, multiple-region distribution with multi-region writes replication.
Cosmos DB 的用于 MongoDB 的 APICosmos DB's API for MongoDB
遵循快速入门创建 Azure Cosmos 帐户,并迁移现有 MongoDB 应用程序以使用 Azure Cosmos DB,或者生成一个新的应用程序:Follow the quickstarts to create an Azure Cosmos account and migrate your existing MongoDB application to use Azure Cosmos DB, or build a new one:
- 迁移现有的 MongoDB Node.js Web 应用。Migrate an existing MongoDB Node.js web app.
- 使用 Azure Cosmos DB 的用于 MongoDB 的 API 和 .NET SDK 生成 Web 应用Build a web app using Azure Cosmos DB's API for MongoDB and .NET SDK
- 使用 Azure Cosmos DB 的用于 MongoDB 的 API 和 Java SDK 生成控制台应用Build a console app using Azure Cosmos DB's API for MongoDB and Java SDK
后续步骤Next steps
下面是一些可帮助你入门的指南:Here are a few pointers to get you started:
- 在将 MongoDB 应用程序连接到 Azure Cosmos DB 教程中了解如何获取帐户连接字符串信息。Follow the Connect a MongoDB application to Azure Cosmos DB tutorial to learn how to get your account connection string information.
- 在将 Studio 3T 与 Azure Cosmos DB 配合使用教程中了解如何在 Studio 3T 中创建 Cosmos 数据库与 MongoDB 应用之间的连接。Follow the Use Studio 3T with Azure Cosmos DB tutorial to learn how to create a connection between your Cosmos database and MongoDB app in Studio 3T.
- 在将 MongoDB 数据导入 Azure Cosmos DB 教程中了解如何将数据导入 Cosmos 数据库。Follow the Import MongoDB data into Azure Cosmos DB tutorial to import your data to a Cosmos database.
- 使用 Robo 3T 连接到 Cosmos 帐户。Connect to a Cosmos account using Robo 3T.
- 了解如何配置多区域分布式应用的读取首选项。Learn how to Configure read preferences for multiple-regionally distributed apps.
- 在故障排除指南中查找常见错误的解决方案Find the solutions to commonly found errors in our Troubleshooting guide
注意:本文介绍了可与 MongoDB 数据库实现线路协议兼容的 Azure Cosmos DB 功能。Azure 不会运行 MongoDB 数据库来提供此服务。Azure Cosmos DB 并不隶属于 MongoDB, inc.Note: This article describes a feature of Azure Cosmos DB that provides wire protocol compatibility with MongoDB databases. Azure does not run MongoDB databases to provide this service. Azure Cosmos DB is not affiliated with MongoDB, Inc.