locked
To do JSON manipulations in Azure SQL or .NET objects? RRS feed

  • Question

  • Hi Team, 

    I have a requirement where we get a large JSON (approx 400-500 fields) from API, which needs to be parsed and updated (just 10-20 of fields) based on some business rules and then stored in DB. The architecture is as shown in the image here. I have multiple such JSON files for different products configured which the API will receive. Functionality is similar to create a simple Business Rules Engine using JSON and Azure. 

    

    I have 2 approaches: 

    1. Use JSON classes / objects in C# to parse and update the JSON in the App Service and use the Azure SQL just to store the updated the JSON. No data manipulation in the Azure SQL Stored Proc. (Traditional) 
    2. Use Azure SQL JSON capabilities to parse and update the JSON in Azure SQL Stored Proc and use the C# just to call the Stored Proc. (Something I learnt recently)

    Are there any more better approaches? What are the pros and cons of each approach?

    Thanks for your contribution. Neel :)  

    Monday, October 28, 2019 8:12 PM

All replies

  • Hi Team, 

    I have a requirement where we get a large JSON (approx 400-500 fields) from API, which needs to be parsed and updated (just 10-20 of fields) based on some business rules and then stored in DB. The architecture is as shown in the image here. I have multiple such JSON files for different products configured which the API will receive. Functionality is similar to create a simple Business Rules Engine using JSON and Azure. 

    I have 2 approaches: 

    1. Use JSON classes / objects in C# to parse and update the JSON in the App Service and use the Azure SQL just to store the updated the JSON. No data manipulation in the Azure SQL Stored Proc. (Traditional) 
    2. Use Azure SQL JSON capabilities to parse and update the JSON in Azure SQL Stored Proc and use the C# just to call the Stored Proc. (Something I learnt recently)

    Are there any more better approaches? What are the pros and cons of each approach?

    Thanks for your contribution. Neel :)  

    Good day <?!?>

    >> approx 400-500 fields

    JSON does not have field. It is one text document which includes only data objects consisting of attribute–value pairs and array data types.

    It is not clear to me what you considered as "field" in JSON. Fields is something that you usually have in forms. I am guessing that by "fields" you mean Objects in the JSON document.

    It can help to understand if you will provide example and not just count on your description. Please provide sample JSON and explain what is your need according to this specific document.

    >> parse and update the JSON in the App Service... parse and update the JSON in Azure SQL...

    No one can advice you using the information you gave us here. Both option can best solution in different cases. Both solution might fit or not.

    In order to answer the question we must fully familiar with your system and the way you use (or want to use) the system.

    >> What are the pros and cons of each approach?

    This fit a full course or a book and it is outside the scope of one message in the forum.

    Moreover, what do you care about all the "pros and cons" if these not relevant your system?!?

    If you can give example and describe your system a lot more and the scenario you need to deal with, then we will be able to give some tips.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Monday, October 28, 2019 11:08 PM
  • Just checking in to see if the above answer(s) helped.

     

    If this answers your query, do click “Mark as Answer” and Up-Vote for the same which might be beneficial to other community members reading this thread .

    And, if you have any further query do let us know. 

    Friday, November 1, 2019 9:00 AM