Azure Cosmos DB Graph API with Python

From Ittichai Chammavanijakul's Wiki
Revision as of 15:40, 9 September 2018 by Ittichai (talk | contribs)
Jump to navigation Jump to search

https://www.taygan.co/blog/2018/01/23/azure-cosmos-db-graph-api-with-python

https://docs.microsoft.com/en-us/azure/cosmos-db/create-graph-python

https://docs.microsoft.com/en-us/azure/cosmos-db/graph-introduction

Depending on the queries, it is possible that the District->Store relationship is used uniquely for filtering the Store vertices. For example, if queries are in the format - “obtain all the stores that belong to a specific district”. If this is the case, then it is worth to consider collapsing the District entity from a vertex of its own to a property of the Store vertex.

This approach has the benefit of reducing the cost of retrieving each Store vertex from obtaining three graph objects at a time (District, District->Store, Store) to a single Store vertex. This can provide performance improvements, as well as a reduced cost per query.