Always free Apache Gremlin graph compatible Azure Cosmos DB instances

Cosmos DB has an Apache Tinkerpop /Gremlin, compatible persona that lets you run Gremlin Graph queries against a Cosmos DB data store.  This tool can be useful in a shared database in a personal project or startup situation. Cosmos DB Gremlin is targeted at teams migrating into Azure and off of some other COT product.

Azure has an always-free tier Cosmos DB Gremlin instance offering reasonable limits and some compatibility constraints. Usage limits for the free tier are mentioned below.

Caveat Emptor

Microsoft is dropping Graph support in their Azure Databases VSCode extension.
Microsoft's Cosmos DB Gremlin support document that Cosmos DB is compatible with Gremlin 3.4 version drivers.  Later versions of Gremlin drivers don't work with Cosmos DB.

At the time of this article, CAzure Cosmos DB supports the JSON format. It does not support the Gremlin bytecode format.  This means it doesn't work with some driver optimizations and libraries.

What is gremlin

Look at Kelvin Lawrence's book PRACTICAL GREMLIN: An Apache TinkerPop Tutorial and a tutorial with sample data in his GitHub repository

Free Tier 

Apache Gremlin is one of the Cosmos DB personas that can be used with the free tier Cosmos DB offering.


With Azure Cosmos DB free tier, you'll get the first 1000 RU/s and 25 GB of storage in your account for free, applied at the account level. Any RU/s and storage beyond 1000 RU/s and 25 GB will be billed at the regular pricing rates per the pricing page. 
  • 1000 RU/s

From the docs

With Azure Cosmos DB free tier, you'll get the first 1000 RU/s and 25 GB of storage in your account for free, applied at the account level.

Let's suppose we create a database or container in a free tier account with 1000 RU/s and 25 GB of storage. With the Azure Cosmos DB free tier discount applied, you are billed for an effective 1000 RU/s (10 units) of provisioned throughput at the single write region rate and 30 GB of storage.

Assumptions

When using the free tier

    Primary assumptions 

    • You are working outside of a corporate environment
    • You wish to connect from a machine outside of your Azure account
    • You are doing low-volume work

    Secondary assumptions

    • You wish to manage the database using locally executed tools on your developer machine when managing the database.
    • You are open to vendor-provided cloud-based tools.

    Creating a Cosmos DB - Apache Gremlin database

    Cosmos DB for MongoDB is a different SKU than the main Cosmos DB product SKU. That means they go into two different Azure Cosmos DB accounts. You can see here that I have two database accounts.  One for Cosmos DB / Mongo, and the other for Cosmos DB / Gremlin.


    Creating the account

    Go to the Azure Cosmos DB service page shown above.  Click on + Create shown above.  Azure will then ask you to pick the workload type.  Here we are going to click on Azure Cosmos DB for Apache Gremlin



    We give it a name and make sure to Apply the free tier. You can create the database right from this page.   Microsoft may force you into a region other than your home region. My database was put in the UAE.


    We can ignore the next couple of screens and create the database.

    Our free tier Azure Cosmos DB account

    This page shows our free tier database has been configured to never go above the free tier's throughput limit of 1000 Resource Units per Second (RU/s).


    Access controls

    You will usually have to go back into your database to manage access controls.  This screen is the Identity and Access Management (AM) home screen. I set up my access to support my Microsoft Entrat ID.


    Verifying the cost structure

    If you are like me, you sometimes wake up wondering if you left the Azure burning machine on overnight.  I can go back to sleep after checking the Cost Management screen.  This shows that our database will be taken down if we run over our cost limit.  Yeah!


    Using Gremlin with Cosmos DB

    The Apache Tinkerpop graph query language is very different from SQL.  It doesn't work like SQL.  It doesn't have SQL constructs. All of your tools will be different. 

    You may be able to use the Azure Cosmos DB / Gremlin Data Explorer as a learning aide.


    More help should be added in the future.

    References

    Apache Gremlin is an API on the regular Cosmos DB SKUs

    Revision History

    Created 2025 02

    Comments

    Popular posts from this blog

    Installing the RNDIS driver on Windows 11 to use USB Raspberry Pi as network attached

    Understanding your WSL2 RAM and swap - Changing the default 50%-25%

    Almost PaaS Document Parsing with Tika and AWS Elastic Beanstalk