locked
Cosmos DB : Which API type should be used for what usecase RRS feed

  • Question

  • User1644485212 posted

    Hello,

    As per Cosmos DB documentation it provides 4 API types to query the data - SQL, MongoDB, Cassandra, Tables, or Gremlin. Can anyone please help me with usecases for each type? Which API type should I use for what purpose? 

    Does all type provides same set of functions or it differs for each type?

    Thanks,

    Komal

    Wednesday, March 20, 2019 12:14 PM

All replies

  • User283571144 posted

    Hi komaldparekh,

    komaldparekh

    As per Cosmos DB documentation it provides 4 API types to query the data - SQL, MongoDB, Cassandra, Tables, or Gremlin. Can anyone please help me with usecases for each type? Which API type should I use for what purpose? 

    The Azure Cosmos DB's API for MongoDB is used by the people which is familiar with MongoDB.

    By using this you can enjoy the benefits of the MongoDB you're used to, with all of the enterprise capabilities that Cosmos DB provides: global distribution, automatic sharding, availability and latency guarantees, automatic indexing of every field, encryption at rest, backups, and much more.

    Azure Cosmos DB Cassandra API  is used by the people which is familiar with Cassandra.

    Azure Cosmos DB Cassandra API can be used as the data store for apps written for Apache Cassandra. This means that by using existing Apache drivers compliant with CQLv4, your existing Cassandra application can now communicate with the Azure Cosmos DB Cassandra API. In many cases, you can switch from using Apache Cassandra to using Azure Cosmos DB 's Cassandra API, by just changing a connection string.The Cassandra API enables you to interact with data stored in Azure Cosmos DB using the Cassandra Query Language (CQL) , Cassandra-based tools (like cqlsh) and Cassandra client drivers that you’re already familiar with.

    The Azure Cosmos DB Gremlin API is used to store and operate on graph data.

    Gremlin API supports modeling Graph data and provides APIs to traverse through the graph data.

    The Azure Cosmos DB Table API 

    It is used to store flexible datasets such as user data for web applications, address books, device information, or other types of metadata your service requires. You can store any number of entities in a table, and a storage account or Table API account may contain any number of tables, up to the capacity limit of the storage account or Table API account.

    komaldparekh

    Does all type provides same set of functions or it differs for each type?

    Yes, each type has its own functions.

    Best Regards,

    Brando

    Thursday, March 21, 2019 5:38 AM
  • User1289604957 posted

    Hello Komal,

    Does all type provides <g class="gr_ gr_12 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="12" data-gr-id="12">same</g> set of functions or it differs for each type?

    https://db-engines.com/en/system/Cassandra%3BMicrosoft+Azure+Cosmos+DB%3BMongoDB

    Best Regards,

    Maher

    Friday, March 29, 2019 8:37 AM