Help Needed with nested Comment Schema

Hey frens. I'm building a stack overflow clone for poultry farmers. For a commenting system, how should I go about modeling comments, and their replies? I watched a great tutorial by MonsterLessons Academy. https://www.youtube.com/watch?v=sjAeLwuezxo Oleksandr doesn't distinguish between comments and replies, but just adds a "parentId " field, which is null if it is just a regular comment.
But when I look at a particular reply from a facebook thread, they provide a reply_comment_id . Which makes me think they have a more intricate model. For additional context, facebook stops after replies-to-replies. www.facebook.com/ groups/123456789/ posts/1234567890/ ? comment_id=123412341234 & reply_comment_id=123456789012345 Should I ... (A) treat all comments the same (whether they're nested or not) and simply add a field to distinguish it as a child ? (B) Or should I add another table just for replies ? I'm sure there's a trade-off for simplicity, scaling, performance etc. ?
9 Replies
Scot
Scot•3y ago
Have a think about data access patterns Ie read vs write scalabaility
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
cdialpha
cdialpha•3y ago
Recommend any search terms for a good article?
cdialpha
cdialpha•3y ago
cdialpha
cdialpha•3y ago
@pacifistbunny
cdialpha
cdialpha•3y ago
This is what you meant by path?
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
cdialpha
cdialpha•3y ago
Obviously I have some reading to do. But would that be something super-difficult to refactor down the road? What do you even call that concept? When you want to change your data schemas/structures for a large existing database / project ? That's the third option this article recommends. 🙏🏼
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server