You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article explains answers to some frequently asked questions about API for Gremlin in Azure Cosmos DB.
16
-
17
16
sections:
18
17
- name: Gremlin queries
19
18
questions:
20
19
- question: |
21
20
How to evaluate the efficiency of Gremlin queries
22
21
answer: |
23
-
The **executionProfile()** preview step can be used to provide an analysis of the query execution plan. This step needs to be added to the end of any Gremlin query as illustrated by the following example:
The **executionProfile()** preview step can be used to provide an analysis of the query execution plan. This step needs to be added to the end of any Gremlin query. For example, you can add the step to the end of a `g.V('example').out('relationship')` query resulting in `g.V('example').out('relationship').executionProfile()`.
23
+
91
24
The output of the above profile shows how much time is spent obtaining the vertex objects, the edge objects, and the size of the working data set. This is related to the standard cost measurements for Azure Cosmos DB queries.
92
-
25
+
93
26
- name: Other frequently asked questions
94
27
questions:
95
28
- question: |
96
29
How are RU/s charged when running queries on a graph database?
97
30
answer: |
98
-
All graph objects, vertices, and edges, are shown as JSON documents in the backend. Since one Gremlin query can modify one or many graph objects at a time, the cost associated with it is directly related to the objects, edges that are processed by the query. This is the same process that Azure Cosmos DB uses for all other APIs. For more information, see [Request Units in Azure Cosmos DB](../request-units.md).
99
-
100
-
The RU charge is based on the working data set of the traversal, and not the result set. For example, if a query aims to obtain a single vertex as a result but needs to traverse more than one other object on the way, then the cost will be based on all the graph objects that it will take to compute the one result vertex.
101
-
31
+
All graph objects, vertices, and edges, are shown as JSON documents in the backend. Since one Gremlin query can modify one or many graph objects at a time, the cost associated with it's directly related to the objects, edges that are processed by the query. This is the same process that Azure Cosmos DB uses for all other APIs. For more information, see [Request Units in Azure Cosmos DB](../request-units.md).
32
+
33
+
The RU charge is based on the working data set of the traversal, and not the result set. For example, if a query aims to obtain a single vertex as a result but needs to traverse more than one other object on the way, then the cost is based on all the graph objects that it takes to compute the one result vertex.
34
+
102
35
- question: |
103
36
What's the maximum scale that a graph database can have in Azure Cosmos DB for Gremlin?
104
37
answer: |
105
-
Azure Cosmos DB makes use of [horizontal partitioning](../partitioning-overview.md) to automatically address increase in storage and throughput requirements. The maximum throughput and storage capacity of a workload is determined by the number of partitions that are associated with a given container. However, a API for Gremlin container has a specific set of guidelines to ensure a proper performance experience at scale. For more information about partitioning, and best practices, see [partitioning in Azure Cosmos DB](../partitioning-overview.md) article.
106
-
38
+
Azure Cosmos DB makes use of [horizontal partitioning](../partitioning-overview.md) to automatically address increase in storage and throughput requirements. The maximum throughput and storage capacity of a workload is determined by the number of partitions that are associated with a given container. However, an API for Gremlin container has a specific set of guidelines to ensure a proper performance experience at scale. For more information about partitioning, and best practices, see [partitioning in Azure Cosmos DB](../partitioning-overview.md) article.
39
+
107
40
- question: |
108
41
For C#/.NET development, should I use the Microsoft.Azure.Graphs package or Gremlin.NET?
109
42
answer: |
110
-
Azure Cosmos DB for Gremlin leverages the open-source drivers as the main connectors for the service. So the recommended option is to use [drivers that are supported by Apache Tinkerpop](https://tinkerpop.apache.org/).
111
-
43
+
Azure Cosmos DB for Gremlin uses the open-source drivers as the main connectors for the service. So the recommended option is to use [drivers supported by Apache](https://tinkerpop.apache.org/).
44
+
112
45
- question: |
113
46
How can I protect against injection attacks using Gremlin drivers?
114
47
answer: |
115
48
Most native Apache Tinkerpop Gremlin drivers allow the option to provide a dictionary of parameters for query execution. This is an example of how to do it in [Gremlin.Net](https://tinkerpop.apache.org/docs/3.2.7/reference/#gremlin-DotNet) and in [Gremlin-Javascript](https://github.com/Azure-Samples/azure-cosmos-db-graph-nodejs-getting-started/blob/main/app.js).
116
-
49
+
117
50
- question: |
118
51
Why am I getting the "Gremlin Query Compilation Error: Unable to find any method" error?
119
52
answer: |
120
53
Azure Cosmos DB for Gremlin implements a subset of the functionality defined in the Gremlin surface area. For supported steps and more information, see [Gremlin support](support.md) article.
121
-
54
+
122
55
The best workaround is to rewrite the required Gremlin steps with the supported functionality, since all essential Gremlin steps are supported by Azure Cosmos DB.
123
-
56
+
124
57
- question: |
125
58
Why am I getting the "WebSocketException: The server returned status code '200' when status code '101' was expected" error?
126
59
answer: |
127
-
This error is likely thrown when the wrong endpoint is being used. The endpoint that generates this error has the following pattern:
This error is likely thrown when the wrong endpoint is being used. The endpoint that generates this error has the following pattern: `https://<account-name>.documents.azure.com:443/`
61
+
131
62
This is the documents endpoint for your graph database. The correct endpoint to use is the Gremlin Endpoint, which has the following format:
Why am I getting the "RequestRateIsTooLarge" error?
137
68
answer: |
138
-
This error means that the allocated Request Units per second aren't enough to serve the query. This error is usually seen when you run a query that obtains all vertices:
139
-
69
+
This error means that the allocated Request Units per second aren't enough to serve the query. This error is seen when you run a query that obtains all vertices:
70
+
140
71
```
141
72
// Query example:
142
73
g.V()
143
74
```
144
-
145
-
This query will attempt to retrieve all vertices from the graph. So, the cost of this query will be equal to at least the number of vertices in terms of RUs. The RU/s setting should be adjusted to address this query.
146
-
75
+
76
+
This query attempts to retrieve all vertices from the graph. So, the cost of this query will be equal to at least the number of vertices in terms of RUs. The RU/s setting should be adjusted to address this query.
77
+
147
78
- question: |
148
79
Why do my Gremlin driver connections get dropped eventually?
149
80
answer: |
@@ -155,8 +86,12 @@ sections:
155
86
Fluent API calls aren't yet supported by the Azure Cosmos DB for Gremlin. Fluent API calls require an internal formatting feature known as bytecode support that currently isn't supported by Azure Cosmos DB for Gremlin. Due to the same reason, the latest Gremlin-JavaScript driver is also currently not supported.
156
87
157
88
additionalContent: |
89
+
## Related content
90
+
91
+
- [Azure Cosmos DB for Gremlin wire protocol support](support.md)
92
+
- Create, query, and traverse an Azure Cosmos DB graph database using the [Gremlin console](quickstart-console.md)
93
+
94
+
## Next step
158
95
159
-
## Next steps
160
-
161
-
* [Azure Cosmos DB for Gremlin wire protocol support](support.md)
162
-
* Create, query, and traverse an Azure Cosmos DB graph database using the [Gremlin console](quickstart-console.md)
96
+
> [!div class="nextstepaction"]
97
+
> [Frequently asked questions about Azure Cosmos DB](../faq.yml)
0 commit comments