Skip to content

Commit 7e2b0e3

Browse files
Merge pull request #113225 from SnehaGunda/Autoscale
Adding Table & Gremlin API FAQ as new doc
2 parents 801c6ab + f8bebb0 commit 7e2b0e3

File tree

9 files changed

+511
-436
lines changed

9 files changed

+511
-436
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@
697697
href: mongodb-feature-support-36.md
698698
- name: Wire protocol support (3.2)
699699
href: mongodb-feature-support.md
700+
- name: FAQ
701+
href: mongodb-api-faq.md
700702
- name: How-to guides
701703
items:
702704
- name: Pre-migration guide
@@ -763,6 +765,10 @@
763765
items:
764766
- name: 1 - Query data
765767
href: tutorial-query-graph.md
768+
- name: Concepts
769+
items:
770+
- name: FAQ
771+
href: gremlin-api-faq.md
766772
- name: How-to guides
767773
items:
768774
- name: Graph data modeling
@@ -844,6 +850,10 @@
844850
- name: F#
845851
href: /dotnet/articles/fsharp/using-fsharp-on-azure/table-storage
846852
maintainContext: true
853+
- name: Concepts
854+
items:
855+
- name: FAQ
856+
href: table-api-faq.md
847857
- name: How-to guides
848858
items:
849859
- name: Build apps with Table API

articles/cosmos-db/cassandra-faq.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ ms.topic: conceptual
77
ms.date: 04/09/2020
88
ms.author: thvankra
99
---
10-
# Frequently asked questions about the Cassandra API for Azure Cosmos DB
10+
# Frequently asked questions about the Cassandra API in Azure Cosmos DB
1111

12-
## What are some key differences between Apache Cassandra and the Cassandra API?
12+
This article describes the functionality differences between Apache Cassandra and Cassandra API in Azure Cosmos DB. It also provides answers to frequently asked questions about the Cassandra API in Azure Cosmos DB.
13+
14+
## Key differences between Apache Cassandra and the Cassandra API
1315

1416
- Apache Cassandra recommends a 100-MB limit on the size of a partition key. The Cassandra API for Azure Cosmos DB allows up to 20 GB per partition.
1517
- Apache Cassandra allows you to disable durable commits. You can skip writing to the commit log and go directly to the memtables. This can lead to data loss if the node goes down before memtables are flushed to SSTables on disk. Azure Cosmos DB always does durable commits to help prevent data loss.

articles/cosmos-db/faq.md

Lines changed: 9 additions & 429 deletions
Large diffs are not rendered by default.

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

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
title: Frequently asked questions about the Gremlin API in Azure Cosmos DB
3+
description: Get answers to frequently asked questions about the Gremlin API in Azure Cosmos DB
4+
author: SnehaGunda
5+
ms.service: cosmos-db
6+
ms.topic: conceptual
7+
ms.date: 04/28/2020
8+
ms.author: sngun
9+
---
10+
11+
# Frequently asked questions about the Gremlin API in Azure Cosmos DB
12+
13+
This article explains answers to some frequently asked questions about Gremlin API in Azure Cosmos DB.
14+
15+
## How to evaluate the efficiency of Gremlin queries
16+
17+
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:
18+
19+
**Query example**
20+
21+
```
22+
g.V('mary').out('knows').executionProfile()
23+
```
24+
25+
**Example output**
26+
27+
```json
28+
[
29+
{
30+
"gremlin": "g.V('mary').out('knows').executionProfile()",
31+
"totalTime": 8,
32+
"metrics": [
33+
{
34+
"name": "GetVertices",
35+
"time": 3,
36+
"annotations": {
37+
"percentTime": 37.5
38+
},
39+
"counts": {
40+
"resultCount": 1
41+
}
42+
},
43+
{
44+
"name": "GetEdges",
45+
"time": 5,
46+
"annotations": {
47+
"percentTime": 62.5
48+
},
49+
"counts": {
50+
"resultCount": 0
51+
},
52+
"storeOps": [
53+
{
54+
"count": 0,
55+
"size": 0,
56+
"time": 0.6
57+
}
58+
]
59+
},
60+
{
61+
"name": "GetNeighborVertices",
62+
"time": 0,
63+
"annotations": {
64+
"percentTime": 0
65+
},
66+
"counts": {
67+
"resultCount": 0
68+
}
69+
},
70+
{
71+
"name": "ProjectOperator",
72+
"time": 0,
73+
"annotations": {
74+
"percentTime": 0
75+
},
76+
"counts": {
77+
"resultCount": 0
78+
}
79+
}
80+
]
81+
}
82+
]
83+
```
84+
85+
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.
86+
87+
## Other frequently asked questions
88+
89+
### How are RU/s charged when running queries on a graph database?
90+
91+
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).
92+
93+
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.
94+
95+
### What's the maximum scale that a graph database can have in Azure Cosmos DB Gremlin API?
96+
97+
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.
98+
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+
142+
## Next steps
143+
144+
* [Azure Cosmos DB Gremlin wire protocol support](gremlin-support.md)
145+
* Create, query, and traverse an Azure Cosmos DB graph database using the [Gremlin console](create-graph-gremlin-console.md)

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Frequently asked questions about the Azure Cosmos DB's API for MongoDB
3+
description: Get answers to Frequently asked questions about the Azure Cosmos DB's API for MongoDB
4+
author: SnehaGunda
5+
ms.service: cosmos-db
6+
ms.topic: conceptual
7+
ms.date: 04/28/2020
8+
ms.author: sngun
9+
---
10+
11+
# Frequently asked questions about the Azure Cosmos DB's API for MongoDB
12+
13+
The Azure Cosmos DB's API for MongoDB is a wire-protocol compatibility layer that allows applications to easily and transparently communicate with the native Azure Cosmos database engine by using existing, community-supported SDKs and drivers for MongoDB. Developers can now use existing MongoDB toolchains and skills to build applications that take advantage of Azure Cosmos DB. Developers benefit from the unique capabilities of Azure Cosmos DB, which include global distribution with multi-master replication, auto-indexing, backup maintenance, financially backed service level agreements (SLAs) etc.
14+
15+
## How do I connect to my database?
16+
17+
The quickest way to connect to a Cosmos database with Azure Cosmos DB's API for MongoDB is to head over to the [Azure portal](https://portal.azure.com). Go to your account and then, on the left navigation menu, click **Quick Start**. Quickstart is the best way to get code snippets to connect to your database.
18+
19+
Azure Cosmos DB enforces strict security requirements and standards. Azure Cosmos DB accounts require authentication and secure communication via TLS, so be sure to use TLSv1.2.
20+
21+
For more information, see [Connect to your Cosmos database with Azure Cosmos DB's API for MongoDB](connect-mongodb-account.md).
22+
23+
## Error codes while using Azure Cosmos DB's API for MongoDB?
24+
25+
Along with the common MongoDB error codes, the Azure Cosmos DB's API for MongoDB has its own specific error codes:
26+
27+
| Error | Code | Description | Solution |
28+
|---------------------|-------|--------------|-----------|
29+
| TooManyRequests | 16500 | The total number of request units consumed is more than the provisioned request-unit rate for the container and has been throttled. | Consider scaling the throughput assigned to a container or a set of containers from the Azure portal or retrying again. |
30+
| ExceededMemoryLimit | 16501 | As a multi-tenant service, the operation has gone over the client's memory allotment. | Reduce the scope of the operation through more restrictive query criteria or contact support from the [Azure portal](https://portal.azure.com/?#blade/Microsoft_Azure_Support/HelpAndSupportBlade). <br><br> Example: `db.getCollection('users').aggregate([{$match: {name: "Andy"}}, {$sort: {age: -1}}]))` |
31+
32+
## Supported drivers
33+
34+
### Is the Simba driver for MongoDB supported for use with Azure Cosmos DB's API for MongoDB?
35+
36+
Yes, you can use Simba's Mongo ODBC driver with Azure Cosmos DB's API for MongoDB
37+
38+
## Next steps
39+
40+
* [Build a .NET web app using Azure Cosmos DB's API for MongoDB](create-mongodb-dotnet.md)
41+
* [Create a console app with Java and the MongoDB API in Azure Cosmos DB](create-mongodb-java.md)

0 commit comments

Comments
 (0)