Skip to content

Commit 6c455b1

Browse files
authored
Merge pull request #114479 from anfeldma-ms/FirstRoundPerfTSLinkFixes
Reconciled some (not all) missing links in the perf tips/troubleshoot…
2 parents 572751e + ac9c6ac commit 6c455b1

6 files changed

+47
-42
lines changed

articles/cosmos-db/migrate-java-v4-sdk.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,60 @@
11
---
2-
title: Migrate your application to use the Java V4 SDK in Azure Cosmos DB (com.azure.cosmos)
3-
description: Learn how to upgrade your existing Java application from using the older Azure Cosmos DB Java SDK to the newer Java SDK 4.0 (com.azure.cosmos package)for Core (SQL) API.
2+
title: Migrate your application to use the Azure Cosmos DB Java SDK v4 (com.azure.cosmos)
3+
description: Learn how to upgrade your existing Java application from using the older Azure Cosmos DB Java SDKs to the newer Java SDK 4.0 (com.azure.cosmos package)for Core (SQL) API.
44
author: anfeldma-ms
55
ms.author: anfeldma
66
ms.service: cosmos-db
77
ms.topic: conceptual
8-
ms.date: 05/07/2020
8+
ms.date: 05/08/2020
99
ms.reviewer: sngun
1010
---
1111

12-
# Migrate your application to use the Java V4 SDK
12+
# Migrate your application to use the Azure Cosmos DB Java SDK v4
1313

14-
This article explains how to upgrade your existing Java application that is using older Azure Cosmos DB Java SDK to the newer Java SDK 4.0 for Core (SQL) API. The Java V4 SDK corresponds to the `com.azure.cosmos` package. You can use the instructions in this doc if you are migrating your application from any of the following SDKs:
14+
> [!IMPORTANT]
15+
> For more information about this SDK, please view the Azure Cosmos DB Java SDK v4 Release notes, [Maven repository](https://mvnrepository.com/artifact/com.azure/azure-cosmos), Azure Cosmos DB Java SDK v4 [performance tips](performance-tips-java-sdk-v4-sql.md), and Azure Cosmos DB Java SDK v4 [troubleshooting guide](troubleshoot-java-sdk-v4-sql.md).
16+
>
1517
16-
* Legacy Sync Java SDK 2.x.x
18+
This article explains how to upgrade your existing Java application that is using an older Azure Cosmos DB Java SDK to the newer Azure Cosmos DB Java SDK 4.0 for Core (SQL) API. Azure Cosmos DB Java SDK v4 corresponds to the `com.azure.cosmos` package. You can use the instructions in this doc if you are migrating your application from any of the following Azure Cosmos DB Java SDKs:
19+
20+
* Sync Java SDK 2.x.x
1721
* Async Java SDK 2.x.x
1822
* Java SDK 3.x.x
1923

20-
## Java SDK’s and package mappings
24+
## Azure Cosmos DB Java SDK’s and package mappings
2125

2226
The following table lists different Azure Cosmos DB Java SDKs, the package name and the release information:
2327

2428
| Java SDK| Release Date | Bundled APIs | Maven Jar | Java package name |API Reference | Release Notes |
2529
|-------|------|-----------|-----------|--------------|-------------|---------------------------|
2630
| Async 2.x.x | June 2018 | Async(RxJava) | `com.microsoft.azure::azure-cosmosdb` | `com.microsoft.azure.cosmosdb.rx` | [API](https://azure.github.io/azure-cosmosdb-java/2.0.0/) | [Release Notes](sql-api-sdk-async-java.md) |
27-
| Legacy Sync 2.x.x | Sept 2018 | Sync | `com.microsoft.azure::azure-documentdb` | `com.microsoft.azure.cosmosdb` | [API](https://azure.github.io/azure-cosmosdb-java/2.0.0/) | [Release Notes](sql-api-sdk-java.md) |
31+
| Sync 2.x.x | Sept 2018 | Sync | `com.microsoft.azure::azure-documentdb` | `com.microsoft.azure.cosmosdb` | [API](https://azure.github.io/azure-cosmosdb-java/2.0.0/) | [Release Notes](sql-api-sdk-java.md) |
2832
| 3.x.x | July 2019 | Async(Reactor)/Sync | `com.microsoft.azure::azure-cosmos` | `com.azure.data.cosmos` | [API](https://azure.github.io/azure-cosmosdb-java/3.0.0/) | - |
2933
| 4.0 | April 2020 | Async(Reactor)/Sync | `com.azure::azure-cosmos` | `com.azure.cosmos` | - | - |
3034

3135
## SDK level implementation changes
3236

3337
The following are the key implementation differences between different SDKs:
3438

35-
### RxJava is replaced with reactor in Java 3.x.x and 4.0 SDKs
39+
### RxJava is replaced with reactor in Azure Cosmos DB Java SDK versions 3.x.x and 4.0
3640

37-
If you have been using the 3.x.x Java SDK or the preview versions of that SDK and migrating to the 4.0 SDK, see the [Reactor pattern guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-pattern-guide.md) for an introduction to async programming and Reactor.
41+
If you are unfamiliar with asynchronous programming or Reactive Programming, see the [Reactor pattern guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-pattern-guide.md) for an introduction to async programming and Project Reactor. This guide may be useful if you have been using Azure Cosmos DB Sync Java SDK 2.x.x or Azure Cosmos DB Java SDK 3.x.x Sync API in the past.
3842

39-
If you have been using Async Java SDK 2.x.x, and migrating to the 4.0 SDK, see the [Reactor vs RxJava Guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) for guidance on converting RxJava code to use Reactor.
43+
If you have been using Azure Cosmos DB Async Java SDK 2.x.x, and you plan on migrating to the 4.0 SDK, see the [Reactor vs RxJava Guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) for guidance on converting RxJava code to use Reactor.
4044

41-
### Java SDK 4.0 has direct connectivity mode in both Async and Sync APIs
45+
### Azure Cosmos DB Java SDK v4 has direct connectivity mode in both Async and Sync APIs
4246

43-
If you have been using the legacy Sync Java SDK 2.x.x, note that the direct connection mode based on TCP (as opposed to HTTP) is implemented in Java SDK 4.0 for both the Async and Sync APIs.
47+
If you have been using Azure Cosmos DB Sync Java SDK 2.x.x, note that the direct connection mode based on TCP (as opposed to HTTP) is implemented in Azure Cosmos DB Java SDK 4.0 for both the Async and Sync APIs.
4448

4549
## API level changes
4650

47-
The following are the API level changes between Java 3.x.x Vs 4.x.x SDK and Async Java SDK 2.x.x and Legacy sync Java SDK 2.x.x:
51+
The following are the API level changes in Azure Cosmos DB Java SDK 4.x.x compared to previous SDKs (Java SDK 3.x.x, Async Java SDK 2.x.x, and Sync Java SDK 2.x.x):
4852

4953
![Azure Cosmos DB Java SDK naming conventions](./media/migrate-java-v4-sdk/java-sdk-naming-conventions.png)
5054

51-
* The Java SDK 3.x.x and 4.0 refer the client resources as `Cosmos<resourceName>`. For example, `CosmosClient`, `CosmosDatabase`, `CosmosContainer`. Whereas in version 2.x.x, the Java SDKs doesn’t have a uniform naming scheme.
55+
* The Azure Cosmos DB Java SDK 3.x.x and 4.0 refer the client resources as `Cosmos<resourceName>`. For example, `CosmosClient`, `CosmosDatabase`, `CosmosContainer`. Whereas in version 2.x.x, the Azure Cosmos DB Java SDKs don’t have a uniform naming scheme.
5256

53-
* The Java SDK 3.x.x and 4.0 offer both Sync and Async APIs.
57+
* Azure Cosmos DB Java SDK 3.x.x and 4.0 offer both Sync and Async APIs.
5458

5559
* **Java SDK 4.0** : All the classes belong to the Sync API unless the class name is appended with `Async` after `Cosmos`.
5660

@@ -60,31 +64,31 @@ The following are the API level changes between Java 3.x.x Vs 4.x.x SDK and Asyn
6064

6165
### Hierarchical API structure
6266

63-
The Java SDK 4.0 and Java SDK 3.x.x introduces a hierarchical API structure that organizes the clients, databases, and containers in a nested fashion as shown in the following 4.0 SDK code snippet:
67+
Azure Cosmos DB Java SDK 4.0 and 3.x.x introduce a hierarchical API structure that organizes the clients, databases, and containers in a nested fashion as shown in the following 4.0 SDK code snippet:
6468

6569
```java
6670
CosmosContainer = client.getDatabase("MyDatabaseName").getContainer("MyContainerName");
6771
```
6872

69-
In version 2.x.x of Java SDKs, all operations on resources and documents are performed through the client instance.
73+
In version 2.x.x of the Azure Cosmos DB Java SDK, all operations on resources and documents are performed through the client instance.
7074

7175
### Representing documents
7276

73-
In Java SDK 4.0, custom POJO's and `JsonNodes` are the two options to read and write the documents from Azure Cosmos DB.
77+
In Azure Cosmos DB Java SDK 4.0, custom POJO's and `JsonNodes` are the two options to read and write the documents from Azure Cosmos DB.
7478

75-
In the Java SDK 3.x.x, the `CosmosItemProperties` object is exposed by the public API and served as a document representation. This class is no longer exposed in Java SDK 4.0.
79+
In the Azure Cosmos DB Java SDK 3.x.x, the `CosmosItemProperties` object is exposed by the public API and served as a document representation. This class is no longer exposed publicly in version 4.0.
7680

7781
### Imports
7882

79-
* The Java SDK 4.0 packages begin with `com.azure.cosmos`
80-
* Java SDK 3.x.x packages begin with `com.azure.data.cosmos`
83+
* The Azure Cosmos DB Java SDK 4.0 packages begin with `com.azure.cosmos`
84+
* Azure Cosmos DB Java SDK 3.x.x packages begin with `com.azure.data.cosmos`
8185

82-
* Java SDK 4.0 places several classes in a nested package `com.azure.cosmos.models`. Some of these packages include:
86+
* Azure Cosmos DB Java SDK 4.0 places several classes in a nested package `com.azure.cosmos.models`. Some of these packages include:
8387

8488
* `CosmosContainerResponse`
8589
* `CosmosDatabaseResponse`
8690
* `CosmosItemResponse`
87-
* The Async API analogs for all the above packages
91+
* The Async API analogs for all of the above packages
8892
* `CosmosContainerProperties`
8993
* `FeedOptions`
9094
* `PartitionKey`
@@ -93,9 +97,9 @@ In the Java SDK 3.x.x, the `CosmosItemProperties` object is exposed by the publi
9397

9498
### Accessors
9599

96-
The Java SDK 4.0 exposes `get` and `set` methods to access the instance members. For example, the `CosmosContainer` instance has `container.getId()` and `container.setId()` methods.
100+
Azure Cosmos DB Java SDK 4.0 exposes `get` and `set` methods to access the instance members. For example, the `CosmosContainer` instance has `container.getId()` and `container.setId()` methods.
97101

98-
This is different from Java SDK 3.x.x which exposes a fluent interface. For example, a `CosmosSyncContainer` instance has `container.id()` which is overloaded to get or set the `id` value.
102+
This is different from Azure Cosmos DB Java SDK 3.x.x which exposes a fluent interface. For example, a `CosmosSyncContainer` instance has `container.id()` which is overloaded to get or set the `id` value.
99103

100104
## Code snippet comparisons
101105

@@ -537,4 +541,5 @@ SalesOrder salesOrder = new SalesOrder(
537541
## Next steps
538542

539543
* [Build a Java app](create-sql-api-java.md) to manage Azure Cosmos DB SQL API data using the V4 SDK
540-
* Learn about the [Reactor-based Java SDKs](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-pattern-guide.md)
544+
* Learn about the [Reactor-based Java SDKs](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-pattern-guide.md)
545+
* Learn about converting RxJava async code to Reactor async code with the [Reactor vs RxJava Guide](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: anfeldma-ms
55
ms.service: cosmos-db
66
ms.devlang: java
77
ms.topic: conceptual
8-
ms.date: 05/05/2020
8+
ms.date: 05/08/2020
99
ms.author: anfeldma
1010

1111
---
@@ -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 Azure Cosmos DB Java SDK v4 for your project. To upgrade, follow the instructions in the [Migrate to Azure Cosmos DB Java SDK v4](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/migration-guide.md) guide and the [Reactor vs RxJava](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) guide.
23+
> This is *not* the latest Java SDK for Azure Cosmos DB! Consider using Azure Cosmos DB Java SDK v4 for your project. To upgrade, follow the instructions in the [Migrate to Azure Cosmos DB Java SDK v4](migrate-java-v4-sdk.md) guide and the [Reactor vs RxJava](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) guide.
2424
>
2525
> The performance tips in this article are for Azure Cosmos DB Async Java SDK v2 only. See the Azure Cosmos DB Async Java SDK v2 [Release notes](sql-api-sdk-async-java.md), [Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/azure-cosmosdb), and Azure Cosmos DB Async Java SDK v2 [troubleshooting guide](troubleshoot-java-async-sdk.md) for more information.
2626
>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: anfeldma-ms
55
ms.service: cosmos-db
66
ms.devlang: java
77
ms.topic: conceptual
8-
ms.date: 05/05/2020
8+
ms.date: 05/08/2020
99
ms.author: anfeldma
1010

1111
---
@@ -20,10 +20,10 @@ ms.author: anfeldma
2020
>
2121
2222
> [!IMPORTANT]
23-
> The performance tips in this article are for Azure Cosmos DB Java SDK v4 only. Please view the Azure Cosmos DB Java SDK v4 Release notes, [Maven repository](https://mvnrepository.com/artifact/com.azure/azure-cosmos), and Azure Cosmos DB Java SDK v4 troubleshooting guide for more information.
23+
> The performance tips in this article are for Azure Cosmos DB Java SDK v4 only. Please view the Azure Cosmos DB Java SDK v4 Release notes, [Maven repository](https://mvnrepository.com/artifact/com.azure/azure-cosmos), and Azure Cosmos DB Java SDK v4 [troubleshooting guide](troubleshoot-java-sdk-v4-sql.md) for more information. If you are currently using an older version than v4, see the [Migrate to Azure Cosmos DB Java SDK v4](migrate-java-v4-sdk.md) guide for help upgrading to v4.
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 [Azure Cosmos DB 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.
2727

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: anfeldma-ms
55
ms.service: cosmos-db
66
ms.devlang: java
77
ms.topic: conceptual
8-
ms.date: 05/05/2020
8+
ms.date: 05/08/2020
99
ms.author: anfeldma
1010

1111
---
@@ -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 Azure Cosmos DB Java SDK v4 for your project. To upgrade, follow the instructions in the [Migrate to Azure Cosmos DB Java SDK v4](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/migration-guide.md) guide and the [Reactor vs RxJava](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) guide.
23+
> This is *not* the latest Java SDK for Azure Cosmos DB! Consider using Azure Cosmos DB Java SDK v4 for your project. To upgrade, follow the instructions in the [Migrate to Azure Cosmos DB Java SDK v4](migrate-java-v4-sdk.md) guide and the [Reactor vs RxJava](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) guide.
2424
>
2525
> These performance tips are for Azure Cosmos DB Sync Java SDK v2 only. Please view the Azure Cosmos DB Sync Java SDK v2 [Release notes](sql-api-sdk-java.md) and [Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/azure-documentdb) for more information.
2626
>

articles/cosmos-db/troubleshoot-java-async-sdk.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ title: Diagnose and troubleshoot Azure Cosmos DB Async Java SDK v2
33
description: Use features like client-side logging and other third-party tools to identify, diagnose, and troubleshoot Azure Cosmos DB issues in Async Java SDK v2.
44
author: anfeldma-ms
55
ms.service: cosmos-db
6-
ms.date: 05/04/2020
6+
ms.date: 05/08/2020
77
ms.author: anfeldma
88
ms.devlang: java
99
ms.subservice: cosmosdb-sql
1010
ms.topic: troubleshooting
1111
ms.reviewer: sngun
1212
---
1313

14-
# Troubleshoot issues when you use the Java Async SDK with Azure Cosmos DB SQL API accounts
14+
# Troubleshoot issues when you use the Azure Cosmos DB Async Java SDK v2 with SQL API accounts
1515

1616
> [!div class="op_single_selector"]
1717
> * [Java SDK v4](troubleshoot-java-sdk-v4-sql.md)
@@ -20,7 +20,7 @@ ms.reviewer: sngun
2020
>
2121
2222
> [!IMPORTANT]
23-
> This is *not* the latest Java SDK for Azure Cosmos DB! Consider using Azure Cosmos DB Java SDK v4 for your project. Follow the instructions in the [Migrate to Azure Cosmos DB Java SDK v4](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/migration-guide.md) guide and [Reactor vs RxJava](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) guide to upgrade.
23+
> This is *not* the latest Java SDK for Azure Cosmos DB! Consider using Azure Cosmos DB Java SDK v4 for your project. Follow the instructions in the [Migrate to Azure Cosmos DB Java SDK v4](migrate-java-v4-sdk.md) guide and [Reactor vs RxJava](https://github.com/Azure-Samples/azure-cosmos-java-sql-api-samples/blob/master/reactor-rxjava-guide.md) guide to upgrade.
2424
>
2525
> This article covers troubleshooting for Azure Cosmos DB Async Java SDK v2 only. See the Azure Cosmos DB Async Java SDK v2 [Release Notes](sql-api-sdk-async-java.md), [Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/azure-cosmosdb) and [performance tips](performance-tips-async-java.md) for more information.
2626
>

0 commit comments

Comments
 (0)