Reputation: 5
I have to make a simple family tree that is parent child relation. I will be using API to fetch data so should I make nested objects of json. Or should I make a foreign key in each object, what is preferred way I am very confused. Is it wrong to make too many nested objects in json?
Upvotes: 0
Views: 224
Reputation: 5779
Nested objects are easier and faster to access, but consume a lot of memory. Foreign keys are memory-effective, but in order to access the referenced objects, you need to implement some locating algorithm.
Upvotes: 1