Mongo API
Mongo API
Cosmos DB
Azure Cosmos DB is a globally distributed and elastically scalable database. It has a guaranteed low latency
that is backed by a comprehensive set of Service Level Agreements (SLAs). Consistency can sometimes be an
issue when you are working with distributed systems, but Azure Cosmos DB alleviates this situation by offering
you five different consistency levels: strong, bounded staleness, session, consistent prefix, and eventual.
All of the above is supported by a multi-model Azure Cosmos DB's approach, which provides you with the
ability to use document, key-value, wide-column, or graph-based data.
The final choice you have is how to access and manipulate your data. Azure Cosmos DB was built to support
multiple different models, and you can continue to use industry standard APIs if they are already part of your
application or database design.
This flexibility means that Azure Cosmos DB can be used as the database in all of the components that are
being designed for your project.
In this unit you'll discover, at a High Level, what each of the API choices are, and how they might be used. In
the following units, you'll see scenarios where each of the API choices will be applicable.
Core (SQL) is the default API for Azure Cosmos DB, which provides you with a view of your data that resembles
a traditional NoSQL document store. You can query the hierarchical JSON documents with a SQL-like language.
Core (SQL) uses JavaScript's type system, expression evaluation, and function invocation.
MongoDB API
Azure Cosmos DB's API for MongoDB supports the MongoDB wire protocol. This API allows existing MongoDB
client SDKs, drivers, and tools to interact with the data transparently, as if they are running against an actual
MongoDB database. The data is stored in document format, which is the same as using Core (SQL). Azure
Cosmos DB's API for MongoDB is currently compatible with 3.2 version of the MongoDB wire protocol.
Cassandra API
Azure Cosmos DB's support for the Cassandra API makes it possible to query data by using the Cassandra
Query Language (CQL), and your data will appear to be a partitioned row store. Just like the MongoDB API, any
clients or tools should be able to connect transparently to Azure Cosmos DB; only your connection settings
should need to be updated. Cosmos DB's Cassandra API currently supports version 4 of the CQL wire protocol.
Azure Cosmos DB's Azure Table API provides support for applications that are written for Azure Table Storage
that need premium capabilities like global distribution, high availability, scalable throughput. The original Table
API only allows for indexing on the Partition and Row keys; there are no secondary indexes. Storing table data
in Cosmos DB automatically indexes all the properties, and requires no index management.
Gremlin (graph) API
Choosing Gremlin as the API provides a graph-based view over the data. Remember that at the lowest level, all
data in any Azure Cosmos DB is stored in an ARS format. A graph-based view on the database means data is
either a vertex (which is an individual item in the database), or an edge (which is a relationship between items
in the database).
References:
https://docs.microsoft.com/en-us/learn/modules/choose-api-for-cosmos-db/