词条 | Cosmos DB | |||||||||||||||||||||
释义 |
}}{{Infobox software | name = Azure Cosmos DB | developer = Microsoft | released = 2010 | language = English | genre = Multi-model database | website = {{URL|cosmosdb.com}} }} Azure Cosmos DB is Microsoft’s proprietary globally-distributed, multi-model database service "for managing data at planet-scale" launched in May 2017.[1] It is schema-agnostic, horizontally scalable and generally classified as a NoSQL database. Data modelInternally, Cosmos DB stores "items" in "containers"[2], with these 2 concepts being surfaced differently depending on the API used (these would be "documents" in "collections" when using the MongoDB-compatible API, for example). Containers are grouped in "databases", which are analogous to namespaces above containers. Containers are schema-agnostic, which means that no schema is enforced when adding items. By default, every field in each item is automatically indexed, generally providing good performance without tuning to specific query patterns. These defaults can be modified by setting an indexing policy which can specify, for each field, the index type and precision desired. Cosmos DB offers 3 types of indexes:
Containers can also enforce unique key constraints to ensure data integrity.[3] Each Cosmos DB container exposes a change feed, which clients can subscribe to in order to get notified of new items being added or updated in the container.[4] Item deletions are currently not exposed by the change feed. Changes are persisted by Cosmos DB, which makes it possible to request changes from any point in time, up to the creation of the container. A "Time to Live" (or TTL) can be specified at the container level to let Cosmos DB automatically delete items after a certain amount of time expressed in seconds. This countdown starts after the last update of the item. If needed, the TTL can also be overloaded at the item level. Multi-model APIsThe internal data model described in the previous section is exposed through:
SQL APIThe SQL API lets clients create, update and delete containers and items. Items can be queried with a read-only, JSON-friendly SQL dialect[6]. As Cosmos DB embeds a JavaScript engine, the SQL API also enables:
The SQL API is exposed as a REST API, which itself is implemented in various SDKs that are officially supported by Microsoft and available for .NET, .NET Core[8], Node.js (Javascript), Java and Python. PartitioningCosmos DB added automatic partitioning capability in 2016 with the introduction of partitioned containers. Behind the scenes, partitioned containers span multiple physical partitions with items distributed by a client-supplied partition key. Cosmos DB automatically decides how many partitions to spread data across depending on the size and throughput needs. When partitions are added or removed, the operation is performed without any downtime so data remains available while it is re-balanced across the new or remaining partitions. Before partitioned containers were available, it was common to write custom code to partition data and some of the Cosmos DB SDKs explicitly supported several different partitioning schemes. That mode is still available but only recommended when storage and throughput requirements don't exceed the capacity of one container, or when the built-in partitioning capability does not otherwise meet the application's needs. Tunable throughputDevelopers can specify desired throughput to match the application's expected load. Cosmos DB reserves resources (memory, CPU and IOPS) to guarantee the requested throughput while maintaining request latency below 10ms for both reads and writes at the 99.999th percentile. Throughput is specified in request units (RUs) per second. The number of RUs consumed for a particular operation depends on a number of factors, but fetching a single 1KB document by its `id` field consumes 1 RU. Delete, update, and insert operations consume around 5 RUs for 1 KB documents. Large queries and stored procedure executions can consume hundreds to thousands of RUs depending on the complexity of the operations needed.[9] Throughput can be provisioned at either the container or the database level. When provisioned at the database level, the throughput is shared across all the containers within that database, with the additional ability to have dedicated throughput for some containers. Global distributionCosmos DB databases can be configured to be available in any of the Microsoft Azure regions (54 regions as of December 2018), letting application developers place their data closer to where their users are.[10] Each container's data gets transparently replicated across all configured regions. Adding or removing regions is performed without any downtime or impact on performance. By leveraging Cosmos DB's multi-homing API, applications don't have to be updated or redeployed when regions are added or removed, as Cosmos DB will automatically route their requests to the regions that are available and closest to their location. Consistency levelsData consistency is configurable on Cosmos DB, letting application developers choose among 5 different levels:[11]
The desired consistency level is defined at the account level but can be overridden on a per request basis by using a specific HTTP header or the corresponding feature exposed by the SDKs. All 5 consistency levels have been specified and verified using the TLA+ specification language, with the TLA+ model being open-sourced on GitHub.[13] Multi-masterCosmos DB's original distribution model involves one single write region, with all other regions being read-only replicas. In March 2018, a new multi-master capability was announced, enabling multiple regions to be write replicas within a global deployment. Potential merge conflicts that may arise when different write regions issue concurrent, conflicting writes can be resolved by either the default Last Write Wins policy, or a custom JavaScript function. ReceptionGartner Research positions Microsoft as the leader in the Magic Quadrant Operational Database Management Systems in 2016[14] and explicitly calls out the unique capabilities of Cosmos DB in their write-up. Real-world use casesThese Microsoft services utilize Cosmos DB[15]:
If you're looking to use Cosmos DB to build a more globally resilient application / system, you can combine it with other Azure services such as Azure App Service and Azure Traffic Manager[16]. Limitations, criticism and cautions
References1. ^{{cite web|title=Azure Cosmos DB|url=https://azure.microsoft.com/en-us/services/cosmos-db/|website=Microsoft Azure|publisher=Microsoft|accessdate=9 July 2017}} {{MS DevTools}}2. ^{{Cite web|url=https://docs.microsoft.com/en-us/azure/cosmos-db/databases-containers-items|title=Working with Azure Cosmos DB databases, containers and items|last=dharmas|website=docs.microsoft.com|language=en-us|access-date=2018-12-13}} 3. ^{{Cite web|url=https://dibranmulder.github.io/2018/07/03/Unique-keys-in-Azure-Cosmos-DB/index.html|title=Unique keys in Azure Cosmos DB|website=Dibran's Blog|access-date=2018-12-13}} 4. ^{{Cite web|url=https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed|title=Working with the change feed support in Azure Cosmos DB|last=rafats|website=docs.microsoft.com|language=en-us|access-date=2018-12-13}} 5. ^{{Cite web|url=https://azure.microsoft.com/en-us/blog/azure-cosmosdb-extends-support-for-mongodb-aggregation-pipeline-unique-indexes-and-more/|title=Azure #CosmosDB extends support for MongoDB aggregation pipeline, unique indexes, and more|website=azure.microsoft.com|language=en|access-date=2018-12-13}} 6. ^{{Cite web|url=https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-query-reference|title=SQL language syntax in Azure Cosmos DB|last=LalithaMV|website=docs.microsoft.com|language=en-us|access-date=2018-12-13}} 7. ^{{Cite web|url=http://blog.lumenize.com/announcing-documentdb-lumenize|title=Announcing documentdb-lumenize|last=Maccherone|first=Larry|date=|website=blog.lumenize.com|publisher=|access-date=2016-12-11}} 8. ^{{Cite web|url=https://auth0.com/blog/documentdb-with-aspnetcore/|title=Using Azure DocumentDB and ASP.NET Core for extreme NoSQL performance|website=auth0.com}} 9. ^{{Cite web|url=https://docs.microsoft.com/en-us/azure/cosmos-db/manage-account|title=How to manage an Azure Cosmos DB account|last=syamkmsft|website=docs.microsoft.com|access-date=2017-08-22}} 10. ^{{Cite web|url=https://docs.microsoft.com/en-us/azure/cosmos-db/distribute-data-globally|title=How to distribute data globally with Azure Cosmos DB|last=kiratp|website=docs.microsoft.com|access-date=2017-08-22}} 11. ^{{Cite web|url=https://www.c-sharpcorner.com/article/diving-deep-into-different-consistency-levels-of-azure-cosmos-db/|title=Diving Deep Into Different Consistency Levels Of Azure Cosmos DB|website=www.c-sharpcorner.com|access-date=2018-12-13}} 12. ^{{Cite web|url=https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels|title=Tunable data consistency levels in Azure Cosmos DB|last=syamkmsft|first=|date=|website=docs.microsoft.com|publisher=Microsoft|access-date=2017-08-22}} 13. ^{{Citation|title=Azure Cosmos TLA+ specifications. Contribute to Azure/azure-cosmos-tla development by creating an account on GitHub|date=2018-12-09|url=https://github.com/Azure/azure-cosmos-tla|publisher=Microsoft Azure|access-date=2018-12-13}} 14. ^{{Cite web|url=https://www.gartner.com/doc/3467318/magic-quadrant-operational-database-management|title=Magic Quadrant for Operational Database Management Systems|website=www.gartner.com|access-date=2016-12-11}} 15. ^http://www.vldb.org/pvldb/vol8/p1668-shukla.pdf 16. ^{{cite web |last1=Pietschmann |first1=Chris |title=Building Globally Resilient Apps with Azure App Service and Cosmos DB |url=https://buildazure.com/2018/01/30/designing-globally-resilient-apps-with-azure-app-service-and-cosmos-db/ |website=BuildAzure.com |publisher=Opsgility |accessdate=30 January 2018}} 17. ^{{Cite web|url=http://stackoverflow.com/questions/tagged/azure-documentdb+linq|title=Newest 'azure-documentdb' Questions|website=stackoverflow.com|access-date=2016-12-07}} 18. ^{{Cite web|url=https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/18561901-add-group-by-support-for-aggregate-functions|title=Add Group By support for Aggregate Functions|website=feedback.azure.com|access-date=2019-03-31}} 19. ^{{cite web |title=Using Azure Cosmos DB as a database for the globally distributed Christian dating app Flourish |url=https://www.flourishflourish.com/WhitePaper_CosmosDB_Flourish.pdf |website=flourishflourish.com |publisher=zareda Ltd |accessdate=March 31, 2019}} 20. ^{{Cite web|url=https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/6350987--documentdb-allow-paging-skip-take|title=[DocumentDB] Allow Paging (skip/take)|website=feedback.azure.com|access-date=2018-03-06}} 3 : Document-oriented databases|Microsoft cloud services|NoSQL |
|||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。