Site Name

Cosmos db and sql

Reading the azure cosmos db docs is kind of funny because you can see the changes in strategy over time

  1. We’re a NOSQL document db. Use our custom client to get/put jaon objects and then index aribitrary properties and partition based on a particular property you choose!
  2. Okay people really like sql so we strapped a very basic sql that supporsts select on top
  3. People are still afraid so lets really emphasis the sql in our nosql sections and just start calling the default inteface “sql” when we feel like it. For example the cli
> % az cosmosdb --help

Group
    az cosmosdb : Manage Azure Cosmos DB database accounts.

Subgroups:
    cassandra                   : Manage Cassandra resources of Azure Cosmos DB account.
    gremlin                     : Manage Gremlin resources of Azure Cosmos DB account.
...
    sql                         : Manage SQL resources of Azure Cosmos DB account.

and

> % az cosmosdb database list
This command has been deprecated and will be removed in a future release. Use 'cosmosdb sql database, cosmosdb mongodb database, cosmosdb cassandra keyspace or cosmosdb gremlin database' instead.
  1. Crap our sql doesn’t work with with how several languages expect it so lets write some sql drivers here’s golangs https://github.com/microsoft/gocosmos. Can you use this directly in orms like gorm? Nope
  2. Okay we stuck a postregres sql into our offering even though we also have another postgres offering as a stnndard db and we wrote this blog post