Azure CosmosDB: Types of Accounts Explained

Mohamed Mohsen
3 min readMay 11, 2024

--

Azure Cosmos DB for NoSQL

Azure Cosmos DB’s Core API provides native support for working with documents.

It facilitates rapid and flexible development using a familiar SQL query language and client libraries for .NET, JavaScript, Python, and Java.

While it employs a similar structure and syntax to working with traditional SQL, the key distinction lies in storing data within a NoSQL container rather than conventional SQL tables.

builder.Services.AddDbContext<TweetsDbContext>(options =>
{
options.UseCosmos(client.GetSecret("ConnectionStrings-Tweets-CosmosDB").Value.Value, "tweets-db");
});
await _tweetRepository.AddAsync(tweet, cancellationToken);
await _tweetRepository.SaveChangesAsync(cancellationToken);

As demonstrated above, despite working with a NoSQL database, the syntax remains identical. Therefore, this option is most suitable for developers experienced and familiar with SQL.

Azure Cosmos DB for MongoDB

If you’re currently using MongoDB and looking to migrate to CosmosDB, or if you’re familiar with MongoDB syntax and drivers, you can choose this option and treat CosmosDB just like MongoDB.

Similar to the previous example where we utilized SQL syntax to interact with CosmosDB NoSQL in .NET, integrating CosmosDB for MongoDB offers the same querying and development experience, leveraging existing expertise, whether you’re integrating it with NodeJS, Go, or other platforms.

Azure Cosmos DB for PostgreSQL

Fully-managed relational database service for PostgreSQL with distributed query execution.

It’s important to understand and distinguish between CosmosDB’s PostgreSQL and Azure’s PostgreSQL.

Reserved for Microsoft blog (link)

Remember: Azure Cosmos DB for PostgreSQL is a relational database option.

Azure Cosmos DB for Apache Gremlin

Azure Cosmos DB for Apache Gremlin is a graph database service designed to store enormous graphs containing billions of vertices and edges.

Queries on these graphs yield results in milliseconds, and adjusting the graph’s structure is straightforward.

The Gremlin API is constructed upon Apache TinkerPop, a graph computing framework that employs the Gremlin query language.

Azure Cosmos DB for Apache Cassandra

If you’re currently using Apache Cassandra and considering a migration to Cosmos DB, you can seamlessly transition while leveraging your familiarity with Apache Cassandra’s syntax and drivers.

Azure Cosmos DB for Table

Fully managed database service for apps written for Azure Table storage.

also the already existed applications written for Azure Table Storage using the Azure Tables SDKs can be migrated to the Azure Cosmos DB with no code changes to take advantage of premium capabilities.

it’s recommended to use the Azure Cosmos DB for Table instead of the azure table storage as it’s more faster and also has low latency by its SLA, which guarantee that your data will be retrieved in less than 10 milli-seconds which make it incredibly fast.

Reserved for YouTube channel video (link)
Reserved for Microsoft docs (link)

If you enjoyed this article and are hungry for more .NET and Azure content, consider following me for regular updates and fresh insights into the world of .NET and Azure development.

--

--

Mohamed Mohsen

Software Engineer @Microsoft | .NET | Azure Cloud Services | System Design | Architecture