Reputation:
assume having a table of people information and want to add their children as well. so you have two options:
1- you can put child's info in JSON array and store it as a JSON string in people table
2- you can create children table and link it to people table.
which one is better to modify and is faster?
note: the order of children is important
if there's a better way please let me know
Upvotes: 0
Views: 58
Reputation: 51
Surely option 2.
Going with the first option will make you parse/process the JSON everytime you need to retrieve some value or want to add some data.
While Option 2 will not only make the transactions easy but will also add maintainability and scalability.
Happy Coding :)
Upvotes: 1