In yesterday’s post, I included links for getting started with the SQL API. In today’s post, we’re going to look at the other APIs that you can use with Azure Cosmos DB:
- Cassandra API – column family API
- Gremlin API – graph database API
- Azure Cosmos DB API for MongoDB – document database API
- Table API – table storage API
How do you choose which of these to use? If you’re coming from an environment where you’re already working with MongoDB, Apache Cassandra, Apache TinkerPop’s Gremlin, or Azure Table storage, there is a respective API. If you are building a new app, though, there are other considerations to figure which API is right for you. This article on Choose an API will help with that.
Let’s look at some resources that give you ideas on working with these APIs.
Cassandra API
Azure Cosmos DB Cassandra API is the API used for apps that are written to work with Apache Cassandra, a column-family environment. If you’re coming from Apache Cassandra, here is a guide on how to adapt to the Cassandra API if you are coming from Apache Cassandra.
The change feed that was mentioned yesterday is available for the Cassandra API. Check it out in this article on the change feed in the Azure Cosmos DB API for Cassandra.
Here are some additional resources to give you more insights on Azure Cosmos DB Cassandra API:
- Azure Cosmos DB Conf 2022 – Migrating Apache Flink data pipelines to write to Azure Cosmos DB (Cassandra API)
- Ingest data from Apache Kafka into Azure Cosmos DB Cassandra API using Kafka Connect
- Connect to Azure Cosmos DB Cassandra API from Spark
- Microsoft Learn – Migrate Cassandra workloads to Cosmos DB
- Samples for Azure Cosmos DB Cassandra API: Azure PowerShell and Azure CLI
Gremlin API
Azure Cosmos DB Gremlin API is the API used for working with graph data. The Gremlin API uses the Gremlin language from the Apache TinkerPop project. The data is queried using the Gremlin syntax, and JSON is returned. The Azure Data Explorer shows graph results visualizations in the browser. The documentation also includes a list of visualization solutions for the graph data – including Linkurious Enterprise, Tom Sawyer, Graphistry, Graphlytic, and yWorks.
Here are some resources to give you more insights on Azure Cosmos DB Gremlin API:
- Azure Cosmos DB Conf 2022 – Using Gremlin.NET and Azure Cosmos DB for code analysis
- Azure Cosmos DB Conf 2022 – Using Gremlin API and Apache Airflow to facilitate Complex System Integrations
- Azure Cosmos DB Conf 2022 – Graph of Thrones, Azure Cosmos DB vs The Seven Kingdoms
- Azure Cosmos DB Conf 2022 – Migrating Graph from a (MariaDB & MongoDB) solution to Azure Cosmos DB’s Gremlin API
- Samples for Azure Cosmos DB Gremlin API: Azure PowerShell and Azure CLI
Azure Cosmos DB API for MongoDB
Azure Cosmos DB API for MongoDB is the API used with apps written for MongoDB.
There is change feed support for the API for MongoDB. You can learn more in this article on change streams in Azure Cosmos DB’s API for MongoDB.
You can use tools such as Studio 3T and MongoDB Compass to connect to Azure Cosmos DB.
Here are some resources to give you more insights on Azure Cosmos DB API for MongoDB:
- Azure Cosmos DB Conf 2021 – Migrating to Cosmos DB’s API for MongoDB
- Microsoft Learn: Azure Cosmos DB API for MongoDB (learning path)
- Microsoft Learn: Migrate on-premises MongoDB database to Cosmos DB
- Samples for Azure Cosmos DB API for MongoDB: Azure PowerShell and Azure CLI
Table API
Azure Cosmos DB Table API works for applications written for Azure Table storage that need premium capabilities. The Azure Tables SDK can be used to target Azure Cosmos DB tables.
Here are some resources to give you more insights on Azure Cosmos DB Table API:
- Developing with Azure Cosmos DB Table API and Azure Table storage
- Microsoft Learn: Store and access NoSQL data with Azure Cosmos DB and Table API
- Samples for Azure Cosmos DB Table API: Azure PowerShell and Azure CLI
Conclusion
In this post, we included links to different types of resources. Azure Cosmos DB Conf has many videos of how the products are being used. Microsoft Learn has modules and learning paths to read through concepts and practice these skills. Microsoft Docs has samples and quickstarts to help you get started today. Check them out! And if you have questions, please check in with the Azure Cosmos DB Developer Community!