Skip to content

Commit 98d4c8c

Browse files
committed
Splitting MongoDB FAQ
1 parent 29ec8bc commit 98d4c8c

File tree

2 files changed

+44
-46
lines changed

2 files changed

+44
-46
lines changed

articles/cosmos-db/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Yes Azure CosmosDB supports time series analysis, here is a sample for [time ser
122122

123123
See the Azure Cosmos DB [service quotas](concepts-limits.md) and [throughout limits per container and database](set-throughput.md#comparison-of-models) articles for more information.
124124

125-
## SQL API
125+
## Frequently asked questions about SQL API
126126

127127
### How do I start developing against the SQL API?
128128

articles/cosmos-db/gremlin-api-faq.md

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ ms.author: sngun
1212

1313
This article explains answers to some frequently asked questions about Gremlin API in Azure Cosmos DB.
1414

15-
## Request units and partitioning
16-
1715
### How are RU/s charged when running queries on a graph database?
1816

1917
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).
@@ -24,6 +22,49 @@ The RU charge is based on the working data set of the traversal, and not the res
2422

2523
Azure Cosmos DB makes use of [horizontal partitioning](partition-data.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 Gremlin API 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](partition-data.md) article.
2624

25+
### For C#/.NET development, should I use the Microsoft.Azure.Graphs package or Gremlin.NET?
26+
27+
Azure Cosmos DB Gremlin API 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/).
28+
29+
### How can I protect against injection attacks using Gremlin drivers?
30+
31+
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/master/app.js).
32+
33+
### Why am I getting the "Gremlin Query Compilation Error: Unable to find any method" error?
34+
35+
Azure Cosmos DB Gremlin API implements a subset of the functionality defined in the Gremlin surface area. For supported steps and more information, see [Gremlin support](gremlin-support.md) article.
36+
37+
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.
38+
39+
### Why am I getting the "WebSocketException: The server returned status code '200' when status code '101' was expected" error?
40+
41+
This error is likely thrown when the wrong endpoint is being used. The endpoint that generates this error has the following pattern:
42+
43+
`https:// YOUR_DATABASE_ACCOUNT.documents.azure.com:443/`
44+
45+
This is the documents endpoint for your graph database. The correct endpoint to use is the Gremlin Endpoint, which has the following format:
46+
47+
`https://YOUR_DATABASE_ACCOUNT.gremlin.cosmosdb.azure.com:443/`
48+
49+
### Why am I getting the "RequestRateIsTooLarge" error?
50+
51+
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:
52+
53+
```
54+
// Query example:
55+
g.V()
56+
```
57+
58+
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.
59+
60+
### Why do my Gremlin driver connections get dropped eventually?
61+
62+
A Gremlin connection is made through a WebSocket connection. Although WebSocket connections don't have a specific time to live, Azure Cosmos DB Gremlin API will terminate idle connections after 30 minutes of inactivity.
63+
64+
### Why can't I use fluent API calls in the native Gremlin drivers?
65+
66+
Fluent API calls aren't yet supported by the Azure Cosmos DB Gremlin API. Fluent API calls require an internal formatting feature known as bytecode support that currently isn't supported by Azure Cosmos DB Gremlin API. Due to the same reason, the latest Gremlin-JavaScript driver is also currently not supported.
67+
2768
## Evaluate the efficiency of Gremlin queries
2869

2970
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:
@@ -96,49 +137,6 @@ g.V('mary').out('knows').executionProfile()
96137

97138
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.
98139

99-
### For C#/.NET development, should I use the Microsoft.Azure.Graphs package or Gremlin.NET?
100-
101-
Azure Cosmos DB Gremlin API 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/).
102-
103-
### How can I protect against injection attacks using Gremlin drivers?
104-
105-
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/master/app.js).
106-
107-
### Why am I getting the "Gremlin Query Compilation Error: Unable to find any method" error?
108-
109-
Azure Cosmos DB Gremlin API implements a subset of the functionality defined in the Gremlin surface area. For supported steps and more information, see [Gremlin support](gremlin-support.md) article.
110-
111-
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.
112-
113-
### Why am I getting the "WebSocketException: The server returned status code '200' when status code '101' was expected" error?
114-
115-
This error is likely thrown when the wrong endpoint is being used. The endpoint that generates this error has the following pattern:
116-
117-
`https:// YOUR_DATABASE_ACCOUNT.documents.azure.com:443/`
118-
119-
This is the documents endpoint for your graph database. The correct endpoint to use is the Gremlin Endpoint, which has the following format:
120-
121-
`https://YOUR_DATABASE_ACCOUNT.gremlin.cosmosdb.azure.com:443/`
122-
123-
### Why am I getting the "RequestRateIsTooLarge" error?
124-
125-
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:
126-
127-
```
128-
// Query example:
129-
g.V()
130-
```
131-
132-
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.
133-
134-
### Why do my Gremlin driver connections get dropped eventually?
135-
136-
A Gremlin connection is made through a WebSocket connection. Although WebSocket connections don't have a specific time to live, Azure Cosmos DB Gremlin API will terminate idle connections after 30 minutes of inactivity.
137-
138-
### Why can't I use fluent API calls in the native Gremlin drivers?
139-
140-
Fluent API calls aren't yet supported by the Azure Cosmos DB Gremlin API. Fluent API calls require an internal formatting feature known as bytecode support that currently isn't supported by Azure Cosmos DB Gremlin API. Due to the same reason, the latest Gremlin-JavaScript driver is also currently not supported.
141-
142140
## Next steps
143141

144142
* [Azure Cosmos DB Gremlin wire protocol support](gremlin-support.md)

0 commit comments

Comments
 (0)