Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure SQL API vs Azure Mongo API

I'm very new in the world of "NoSQL", Recently I started using Cosmos DB for JSON documents and am able to store and get data using CosmosDB "SQL" and "Mongo" API.

Which API is best for me? (requirement: Performance, Low Latency, Huge Collection, Low cost)

like image 419
Pankaj Rawat Avatar asked Mar 25 '18 13:03

Pankaj Rawat


People also ask

Is Cosmos DB same as MongoDB?

Azure Cosmos DB is comparatively faster than MongoDB in most common use cases, although MongoDB performs better over 1MB payload. MongoDB offers more flexibility in terms of setup. It runs on-prem, any cloud provider (Google Cloud Platform, AWS, Azure and more).

Which API is best for Cosmos DB?

API for Apache Cassandra Apache Cassandra offers a highly distributed, horizontally scaling approach to storing large volumes of data while offering a flexible approach to a column-oriented schema. API for Cassandra in Azure Cosmos DB aligns with this philosophy to approaching distributed NoSQL databases.

What is Azure Cosmos DB API for MongoDB?

The Azure Cosmos DB for MongoDB makes it easy to use Azure Cosmos DB as if it were a MongoDB database. You can leverage your MongoDB experience and continue to use your favorite MongoDB drivers, SDKs, and tools by pointing your application to the API for MongoDB account's connection string.

Is MongoDB compatible with Azure?

As part of an Azure database deployment, MongoDB can add its capabilities to the Microsoft cloud's scalability and services. These capabilities can make MongoDB usage a key part of your Azure big data workloads.


3 Answers

As a software engineer using MongoDB API. I can confirm that my team and I suffered when handling 426 code errors from CosmosDB. So we end up developing our own custom solution with Polly to handles these throttles. Whereas if we used SQL API we would have access to CosmosDB sdk which pretty much handles these situations. This is just my feedback.

like image 189
Melchia Avatar answered Oct 13 '22 03:10

Melchia


Now I have spent more than 6 months with Cosmos DB project. I can give my opinion on this question.

Azure Cosmos DB offer the same feature with SQL API vs Mongo API, hence you can't compare by feature.

Reason using Mongo API in Cosmos DB

  1. If you have existing Mongo DB database and you want to migrate on Azure.
  2. If you or your team members have Mongo DB experience.
  3. If you are developing cloud agnostic application, you can move your application on-premise or any other cloud vendor.

Reason using SQL API in Cosmos DB

  1. If you have SQL query experience, it would be easy to start.

  2. If you are not looking cloud agnostic application. (can't move Cosmos DB application on-premise or other clouds vendors).

  3. Cosmos DB Change Feed only available with SQL API.

--- UPDATED 2020 ---

Change Feed is available for all the APIs across all available SDKs except the Table API

like image 37
Pankaj Rawat Avatar answered Oct 13 '22 04:10

Pankaj Rawat


Both the API’s provide you high throughput, low latency, elastic scale, geo-replication, etc.

It boils down to what you are comfortable with. Many people preferred Mongo, as they are already familiar with Mongo, it’s syntax, tools, and they already had an application built on Mongo which they migrated to CosmosDB.

If you are starting new, and don’t have an existing investment in Mongo, I will suggest starting with SQL. SQL is the oldest API of CosmosDB, and more battle hardened.

like image 22
Rafat Sarosh Avatar answered Oct 13 '22 02:10

Rafat Sarosh