I am creating one application, which requires dynamic store data in a Graph Table (using Nodes and Edges).
Each Table contains one Product information.
| Details | Fix or Dynamic | Description |
|---|---|---|
| Name | Fix | Require for all products |
| Parts | Dynamic | Require parts is based on products. |
| Measue | Dynamic | Mainly use for find profit and other calculations e.g Product 2 contains Discount and Product 3 contains Discount + Tax |
Requiremens
- Need to Store all information in MS SQL Graph Database
- Need to Add Extra Property against Measure like User Name and Date Created etc.
Note: This extra Property in the feature can be added more details like Date Updated etc.
Current Approach:
Currently, we are storing all information in JSON format in SQL server for save and Get.
{
"Product Name":"Bike With 1 Part",
"Part 1":"Steel",
"Sell":"15",
"Cost":"9",
"Profit":"4"
},
{
"Product Name":"Bike With 2 Part",
"Part 1":"Plastic",
"Part 2":"Steel",
"Sell":"12",
"Cost":"9",
"Discount":"2",
"Profit":"1"
},
{
"Product Name":"Bike With 3 Part",
"Part 1":"Plastic",
"Part 2":"Steel",
"Part 2":"Copper",
"Sell":"15",
"Cost":"9",
"Discount":"2",
"Tax":"1",
"Profit":"3"
},
Problem statement :
- Json Format is not fixed as the Part number and measure count can be up and down
- Discount, Tax , Part Number are dynamic (It May be required for a product or not)
- If require information like "Product -> Part 1 -> Profit" that is not possible using JSON Format.
Final Requirement: Create a Graph Node and Edge Tables.
- Instead of Json format need to store all information in MS SQL Graph DB. With node and Edge tables. So Require help on creating a Node and Edge table design.
Note:Fetching of Data can be by Product Name ,Part Number , Profit, etc. using Graph Query Match query.