Handling large order/orderlines scenarios

Peter Bons 146 Reputation points
2021-10-01T13:38:26.34+00:00

We are currently investigating our options regarding the storage options for a new application. Cosmos DB is on our radar and I stumbled upon these docs regarding hierarchical data.

The example uses the order/orderdetails scenario and that model closely relates to our model. But I have some questions about whether cosmos db is still a good fit if the number of orderlines is very large, say 10000 lines. How would that work in terms of updating a select set of orderlines, would we need to read the whole document in memory and how cost effective would such scenario be?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,442 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anurag Sharma 17,571 Reputation points
    2021-10-04T06:06:57.737+00:00

    Hi @Peter Bons , welcome to Microsoft Q&A forum.

    Azure Cosmos DB gives us the advantage of having the entire relationship defined in single document as de-normalized data that means embedding all the information into single document which would help us in retrieving everything in single read operation. Now this looks good when we have one-to-few relationship between entities. But if there are lot of entities or ever growing entities then we need to think of alternatives. Reason being retrieving a big document could affect our RUs consumption and thus impacting our cost.

    In this case its better to form the weak relationship between documents as mentioned in the below article:

    Data modeling in Azure Cosmos DB

    This article provides a very nice explanation of multiple scenarios that we could encounter based on Cosmos DB design. I would suggest you to go through it once.

    Also how to form the weak links and query them can be referred in below thread:

    https://learn.microsoft.com/en-us/answers/questions/571404/index.html

    Please let us know if this helps or else we can discuss further on the same.

    ----------

    Please don't forgot to click on accept it as answer button 137322-image.png wherever the information provided helps you. This can be beneficial to other community members as well.

    0 comments No comments

0 additional answers

Sort by: Most helpful