Simplifying entities and removing redundant attributes
Closed this issue · 0 comments
Pranjal-R-Agrawal commented
Comment entity - childrenId
should be removed. The comments already store the id of their parent. As a result, childrenId
is never accessed. Further, it adds unnecessary complexity as you need to modify the parent comment whenever a child comment is created.
Post entity - childrenId
should be removed for the same reasons as above. Comments can be accessed by searching by parentPostId
in the comments table.
User entity - postIDs
and commentIDs
should be removed for the same reasons as above. Posts and comments by a user can be accessed by searching in their respective tables by authorId
.