Skip to content

Commit 7b51361

Browse files
committed
A variety of fixes.
1 parent 643bdf5 commit 7b51361

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

articles/cosmos-db/performance-tips-async-java.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Azure Cosmos DB performance tips for Async Java SDK v2
2+
title: Performance tips for Azure Cosmos DB Async Java SDK v2
33
description: Learn client configuration options to improve Azure Cosmos database performance for Async Java SDK v2
44
author: anfeldma-ms
55
ms.service: cosmos-db
@@ -10,7 +10,7 @@ ms.author: anfeldma
1010

1111
---
1212

13-
# Performance tips for Azure Cosmos DB and Async Java SDK v2
13+
# Performance tips for Azure Cosmos DB Async Java SDK v2
1414

1515
> [!div class="op_single_selector"]
1616
> * [Java SDK v4](performance-tips-java-sdk-v4-sql.md)
@@ -20,7 +20,7 @@ ms.author: anfeldma
2020
>
2121
2222
> [!IMPORTANT]
23-
> This is *not* the latest Java SDK for Azure Cosmos DB! Consider using __[Java SDK v4](sql-api-sdk-java-v4-sql.md)__ for your project. Guidance on upgrading can be found __[here](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/migration-guide.md)__ and __[here](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md)__.
23+
> This is *not* the latest Java SDK for Azure Cosmos DB! Consider using [Java SDK v4](sql-api-sdk-java-v4-sql.md) for your project. Guidance on upgrading can be found [here](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/migration-guide.md) and [here](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md).
2424
>
2525
> These performance tips are for Async Java SDK v2 only. Please view the Async Java SDK v2 __[Release notes](https://docs.microsoft.com/azure/cosmos-db/sql-api-sdk-async-java)__, __[Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/azure-cosmosdb)__ and __[troubleshooting guide](troubleshoot-java-async-sdk.md)__ for more information.
2626
>

articles/cosmos-db/performance-tips-java-sdk-v4-sql.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Azure Cosmos DB performance tips for Java SDK v4
2+
title: Performance tips for Azure Cosmos DB Java SDK v4
33
description: Learn client configuration options to improve Azure Cosmos database performance for Java SDK v4
44
author: anfeldma-ms
55
ms.service: cosmos-db
@@ -10,7 +10,7 @@ ms.author: anfeldma
1010

1111
---
1212

13-
# Performance tips for Azure Cosmos DB and Java SDK v4
13+
# Performance tips for Azure Cosmos DB Java SDK v4
1414

1515
> [!div class="op_single_selector"]
1616
> * [Java SDK v4](performance-tips-java-sdk-v4-sql.md)
@@ -20,10 +20,10 @@ ms.author: anfeldma
2020
>
2121
2222
> [!IMPORTANT]
23-
> These performance tips are for Java SDK v4 only. Please view the Java SDK v4 __[Release notes](sql-api-sdk-java-v4-sql.md)__, __[Maven repository](https://mvnrepository.com/artifact/com.azure/azure-cosmos)__ and __[troubleshooting guide](troubleshoot-java-sdk-v4-sql.md)__ for more information.
23+
> These performance tips are for Azure Cosmos DB Java SDK v4 only. Please view the Azure Cosmos DB Java SDK v4 [Release notes](sql-api-sdk-java-v4-sql.md), [Maven repository](https://mvnrepository.com/artifact/com.azure/azure-cosmos) and [troubleshooting guide](troubleshoot-java-sdk-v4-sql.md) for more information.
2424
>
2525
26-
Azure Cosmos DB is a fast and flexible distributed database that scales seamlessly with guaranteed latency and throughput. You do not have to make major architecture changes or write complex code to scale your database with Azure Cosmos DB. Scaling up and down is as easy as making a single API call or SDK method call. However, because Azure Cosmos DB is accessed via network calls there are client-side optimizations you can make to achieve peak performance when using the [SQL Java SDK v4](sql-api-sdk-async-java.md).
26+
Azure Cosmos DB is a fast and flexible distributed database that scales seamlessly with guaranteed latency and throughput. You do not have to make major architecture changes or write complex code to scale your database with Azure Cosmos DB. Scaling up and down is as easy as making a single API call or SDK method call. However, because Azure Cosmos DB is accessed via network calls there are client-side optimizations you can make to achieve peak performance when using [Azure Cosmos DB Java SDK v4](sql-api-sdk-async-java.md).
2727

2828
So if you're asking "How can I improve my database performance?" consider the following options:
2929

@@ -32,7 +32,7 @@ So if you're asking "How can I improve my database performance?" consider the fo
3232
* **Connection mode: Use Direct mode**
3333
<a id="direct-connection"></a>
3434

35-
How a client connects to Azure Cosmos DB has important implications on performance, especially in terms of client-side latency. The *ConnectionMode* is a key configuration setting available for configuring the client *ConnectionPolicy*. For Java SDK v4, the two available *ConnectionMode*s are:
35+
How a client connects to Azure Cosmos DB has important implications on performance, especially in terms of client-side latency. The *ConnectionMode* is a key configuration setting available for configuring the client *ConnectionPolicy*. For Azure Cosmos DB Java SDK v4, the two available *ConnectionMode*s are:
3636

3737
* [Gateway (default)](/java/api/com.microsoft.azure.cosmosdb.connectionmode)
3838
* [Direct](/java/api/com.microsoft.azure.cosmosdb.connectionmode)
@@ -118,7 +118,7 @@ Please see the [Windows](https://docs.microsoft.com/azure/virtual-network/create
118118

119119
* **Use Async API to max out provisioned throughput**
120120

121-
Java SDK v4 bundles two APIs, Sync and Async. Roughly speaking, the Async API implements SDK functionality, whereas the Sync API is a thin wrapper that makes blocking calls to the Async API. This stands in contrast to the older Async Java SDK v2, which was Async-only, and to the older Legacy Sync Java SDK v2, which was Sync-only and had a completely separate implementation.
121+
Azure Cosmos DB Java SDK v4 bundles two APIs, Sync and Async. Roughly speaking, the Async API implements SDK functionality, whereas the Sync API is a thin wrapper that makes blocking calls to the Async API. This stands in contrast to the older Azure Cosmos DB Async Java SDK v2, which was Async-only, and to the older Azure Cosmos DB Sync Java SDK v2, which was Sync-only and had a completely separate implementation.
122122

123123
The choice of API is determined during client initialization; a *CosmosAsyncClient* supports Async API while a *CosmosClient* supports Sync API.
124124

@@ -130,7 +130,7 @@ Please see the [Windows](https://docs.microsoft.com/azure/virtual-network/create
130130

131131
Geographic collocation can give you higher and more consistent throughput when using Sync API (see [Collocate clients in same Azure region for performance](#collocate-clients)) but still is not expected to exceed Async API attainable throughput.
132132

133-
Some users may also be unfamiliar with [Project Reactor](https://projectreactor.io/), the Reactive Streams framework used to implement Java SDK v4 Async API. If this is a concern, we recommend you read our introductory [Reactor Pattern Guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-pattern-guide.md) and then take a look at this [Introduction to Reactive Programming](https://tech.io/playgrounds/929/reactive-programming-with-reactor-3/Intro) in order to familiarize yourself. If you have already used Azure Cosmos DB with an Async interface, and the SDK you used was Async Java SDK v2, then you may be familiar with [ReactiveX](http://reactivex.io/)/[RxJava](https://github.com/ReactiveX/RxJava) but be unsure what has changed in Project Reactor. In that case, please take a look at our [Reactor vs. RxJava Guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) to become familiarized.
133+
Some users may also be unfamiliar with [Project Reactor](https://projectreactor.io/), the Reactive Streams framework used to implement Azure Cosmos DB Java SDK v4 Async API. If this is a concern, we recommend you read our introductory [Reactor Pattern Guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-pattern-guide.md) and then take a look at this [Introduction to Reactive Programming](https://tech.io/playgrounds/929/reactive-programming-with-reactor-3/Intro) in order to familiarize yourself. If you have already used Azure Cosmos DB with an Async interface, and the SDK you used was Azure Cosmos DB Async Java SDK v2, then you may be familiar with [ReactiveX](http://reactivex.io/)/[RxJava](https://github.com/ReactiveX/RxJava) but be unsure what has changed in Project Reactor. In that case, please take a look at our [Reactor vs. RxJava Guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) to become familiarized.
134134

135135
The following code snippets show how to initialize your Azure Cosmos DB client for Async API or Sync API operation, respectively:
136136

@@ -164,9 +164,9 @@ Please see the [Windows](https://docs.microsoft.com/azure/virtual-network/create
164164

165165
* **Tuning ConnectionPolicy**
166166

167-
By default, Direct mode Cosmos DB requests are made over TCP when using Java SDK v4. Internally the SDK uses a special Direct mode architecture to dynamically manage network resources and get the best performance.
167+
By default, Direct mode Cosmos DB requests are made over TCP when using Azure Cosmos DB Java SDK v4. Internally the SDK uses a special Direct mode architecture to dynamically manage network resources and get the best performance.
168168

169-
In Java SDK v4, Direct mode is the best choice to improve database performance with most workloads.
169+
In Azure Cosmos DB Java SDK v4, Direct mode is the best choice to improve database performance with most workloads.
170170

171171
* ***Overview of Direct mode***
172172

@@ -201,7 +201,7 @@ Please see the [Windows](https://docs.microsoft.com/azure/virtual-network/create
201201
202202
* **Tuning parallel queries for partitioned collections**
203203
204-
Azure Cosmos DB SQL Java SDK v4 supports parallel queries, which enable you to query a partitioned collection in parallel. For more information, see [code samples](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples) related to working with Java SDK v4. Parallel queries are designed to improve query latency and throughput over their serial counterpart.
204+
Azure Cosmos DB Java SDK v4 supports parallel queries, which enable you to query a partitioned collection in parallel. For more information, see [code samples](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples) related to working with Azure Cosmos DB Java SDK v4. Parallel queries are designed to improve query latency and throughput over their serial counterpart.
205205
206206
* ***Tuning setMaxDegreeOfParallelism\:***
207207
@@ -239,7 +239,7 @@ Please see the [Windows](https://docs.microsoft.com/azure/virtual-network/create
239239

240240
* **Use Appropriate Scheduler (Avoid stealing Event loop IO Netty threads)**
241241

242-
The asynchronous functionality of Java SDK is based on [netty](https://netty.io/) non-blocking IO. The SDK uses a fixed number of IO netty event loop threads (as many CPU cores your machine has) for executing IO operations. The Flux returned by API emits the result on one of the shared IO event loop netty threads. So it is important to not block the shared IO event loop netty threads. Doing CPU intensive work or blocking operation on the IO event loop netty thread may cause deadlock or significantly reduce SDK throughput.
242+
The asynchronous functionality of Azure Cosmos DB Java SDK is based on [netty](https://netty.io/) non-blocking IO. The SDK uses a fixed number of IO netty event loop threads (as many CPU cores your machine has) for executing IO operations. The Flux returned by API emits the result on one of the shared IO event loop netty threads. So it is important to not block the shared IO event loop netty threads. Doing CPU intensive work or blocking operation on the IO event loop netty thread may cause deadlock or significantly reduce SDK throughput.
243243

244244
For example the following code executes a cpu intensive work on the event loop IO netty thread:
245245
### <a id="java4-noscheduler"></a>Java SDK V4 (Maven com.azure::azure-cosmos) Async API
@@ -278,7 +278,7 @@ Please see the [Windows](https://docs.microsoft.com/azure/virtual-network/create
278278
Based on the type of your work you should use the appropriate existing Reactor Scheduler for your work. Read here
279279
[``Schedulers``](https://projectreactor.io/docs/core/release/api/reactor/core/scheduler/Schedulers.html).
280280

281-
For more information on Java SDK v4, please look at the [Cosmos DB directory of the Azure SDK for Java monorepo on GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-cosmos).
281+
For more information on Azure Cosmos DB Java SDK v4, please look at the [Cosmos DB directory of the Azure SDK for Java monorepo on GitHub](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-cosmos).
282282

283283
* **Optimize logging settings in your application**
284284

articles/cosmos-db/performance-tips-java.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Azure Cosmos DB performance tips for Sync Java SDK v2
2+
title: Performance tips for Azure Cosmos DB Sync Java SDK v2
33
description: Learn client configuration options to improve Azure Cosmos database performance for Sync Java SDK v2
44
author: anfeldma-ms
55
ms.service: cosmos-db
@@ -10,7 +10,7 @@ ms.author: anfeldma
1010

1111
---
1212

13-
# Performance tips for Azure Cosmos DB and Sync Java SDK v2
13+
# Performance tips for Azure Cosmos DB Sync Java SDK v2
1414

1515
> [!div class="op_single_selector"]
1616
> * [Java SDK v4](performance-tips-java-sdk-v4-sql.md)

0 commit comments

Comments
 (0)