Skip to content

Commit ccf2154

Browse files
author
TheovanKraay
committed
fix blocking and non-blocking issues
1 parent d923298 commit ccf2154

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
- name: Concepts
8484
items:
8585
- name: NoSQL Vs relational databases
86-
href: relational-or-nosql.md
86+
href: relational-nosql.md
8787
- name: Global distribution
8888
items:
8989
- name: Overview
@@ -1057,7 +1057,7 @@
10571057
- name: Migrate hundreds of terabytes of data into Azure Cosmos DB
10581058
href: migrate-cosmosdb-data.md
10591059
- name: Migrate one-to-few relational data
1060-
href: migrate-relational-to-cosmosdb-sql-api.md
1060+
href: migrate-relational-to-cosmos-db-sql-api.md
10611061
- name: Bulk executor library
10621062
items:
10631063
- name: About bulk executor library

articles/cosmos-db/migrate-relational-to-cosmosdb-sql-api.md renamed to articles/cosmos-db/migrate-relational-to-cosmos-db-sql-api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ FROM Orders o;
4444

4545
The results of this query would look as below:
4646

47-
![Order Details](./media/migrate-relational-to-cosmos-sql-api/for-json-query-result.png)
47+
![Order Details](./media/migrate-relational-to-cosmos-sql-api/for-json-query-result.png#lightbox)
4848

4949

5050
Ideally, you want to use a single Azure Data Factory (ADF) copy activity to query SQL data as the source and write the output directly to Azure Cosmos DB sink as proper JSON objects. Currently, it is not possible to perform the needed JSON transformation in one copy activity. If we try to copy the results of the above query into an Azure Cosmos DB SQL API container, we will see the OrderDetails field as a string property of our document, instead of the expected JSON array.
@@ -60,7 +60,7 @@ We can work around this current limitation in one of the following ways:
6060

6161
Let’s look at these approaches in more detail:
6262

63-
## Azure Data Factory with two copy activities
63+
## Azure Data Factory
6464

6565
Although we cannot embed OrderDetails as a JSON-array in the destination Cosmos DB document, we can work around the issue by using two separate Copy Activities.
6666

@@ -241,7 +241,7 @@ writeConfig = {
241241
}
242242
```
243243

244-
Then, we will query the source Database (in this case SQL Server) for both the order and order detail records, putting the results into Spark Dataframes. We will also create a list containing all the order ids, and a Thread pool for parallel operations:
244+
Then, we will query the source Database (in this case SQL Server) for both the order and order detail records, putting the results into Spark Dataframes. We will also create a list containing all the order IDs, and a Thread pool for parallel operations:
245245

246246
```python
247247
import json
@@ -274,7 +274,7 @@ orderids = orders.select('OrderId').collect()
274274
pool = ThreadPool(10)
275275
```
276276

277-
Then, create a function for writing Orders into the target SQL API collection. This function will filter all order details for the given order id, convert them into a JSON array, and insert the array into a JSON document that we will write into the target SQL API Collection for that order:
277+
Then, create a function for writing Orders into the target SQL API collection. This function will filter all order details for the given order ID, convert them into a JSON array, and insert the array into a JSON document that we will write into the target SQL API Collection for that order:
278278

279279
```python
280280
def writeOrder(orderid):
@@ -322,11 +322,11 @@ def writeOrder(orderid):
322322
df = spark.read.json(sc.parallelize([orderjsondata]))
323323

324324
#write the dataframe (this will be a single order record with merged many-to-one order details) to cosmos db using spark the connector
325-
#https://docs.microsoft.com/en-us/azure/cosmos-db/spark-connector
325+
#https://docs.microsoft.com/azure/cosmos-db/spark-connector
326326
df.write.format("com.microsoft.azure.cosmosdb.spark").mode("append").options(**writeConfig).save()
327327
```
328328

329-
Finally, we will call the above using a map function on the thread pool, to execute in parallel, passing in the list of order ids we created earlier:
329+
Finally, we will call the above using a map function on the thread pool, to execute in parallel, passing in the list of order IDs we created earlier:
330330

331331
```python
332332
#map order details to orders in parallel using the above function

articles/cosmos-db/relational-or-nosql.md renamed to articles/cosmos-db/relational-nosql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Understanding the differences between NoSQL and Relational Databases
3-
description: This article enumerates the differences between NoSQL and Relational Databases
2+
title: Understanding the differences between Azure Cosmos DB NoSQL and relational databases
3+
description: This article enumerates the differences between NoSQL and relational databases
44
author: TheovanKraay
55
ms.author: thvankra
66
ms.service: cosmos-db
@@ -27,7 +27,7 @@ If your transactional volumes are reaching extreme levels, such as many thousand
2727

2828
![Backend](./media/relational-or-nosql/backend-scaled.png)
2929

30-
## Hierarchical Data
30+
## Hierarchical data
3131

3232
There are a significant number of use cases where transactions in the database can contain many parent-child relationships. These relationships can grow significantly over time, and prove difficult to manage. Forms of [hierarchical databases](https://en.wikipedia.org/wiki/Hierarchical_database_model) did emerge during the 1980s, but were not popular due to inefficiency in storage. They also lost traction as [Ted Codd’s relational model](https://en.wikipedia.org/wiki/Relational_model) became the de facto standard used by virtually all mainstream database management systems.
3333

@@ -37,7 +37,7 @@ The emergence of [object oriented design](https://en.wikipedia.org/wiki/Object-o
3737

3838
![OrderDetails](./media/relational-or-nosql/order-orderdetails.jpg)
3939

40-
## Complex Networks and Relationships
40+
## Complex networks and relationships
4141

4242
Ironically, given their name, relational databases present a less than optimal solution for modeling deep and complex relationships. The reason for this is that relationships between entities do not actually exist in a relational database. They need to be computed at runtime, with complex relationships requiring cartesian joins in order to allow mapping using queries. As a result, operations become exponentially more expensive in terms of computation as relationships increase. In some cases, a relational database attempting to manage such entities will become unusable.
4343

@@ -63,7 +63,7 @@ The [microservices](https://en.wikipedia.org/wiki/Microservices) pattern has gro
6363
* a JavaScript engine and [query API](https://docs.microsoft.com/azure/cosmos-db/javascript-query-api) built into the database.
6464
* a state-of-the-art [change feed](https://docs.microsoft.com/azure/cosmos-db/change-feed) which clients can subscribe to in order to get notified of modifications to a container.
6565

66-
## Some challenges with NoSQL Databases
66+
## Some challenges with NoSQL databases
6767

6868
Although there are some clear advantages when implementing NoSQL databases, there are also some challenges that you may want to take into consideration. These may not be present to the same degree when working with the relational model:
6969

0 commit comments

Comments
 (0)