Cosmos db and sql
2 March, 2024Reading the azure cosmos db docs is kind of funny because you can see the changes in strategy over time
- 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!
- Okay people really like sql so we strapped a very basic sql that supporsts select on top
- 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.
- 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
- 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