Technical Question!

Hi Bubblers,
Quick question please before i start something and regret it after lol.
in my app i am making social posting feature and need advice in storing data logic.
I have two options:

1.when someone reply to a post, i create new data (replies) which has field of the main (post) and field for (text/image) etc.
when i call data to display post replies i will …
Do search for (Replies) > ( post = parent post).

  1. when someone post a reply i do the same, but i have field in (Posts) itself called replies (list). everytime a reply made it is added to that field list.
    when displaying the replies i call …
    This Post’s(Replies).

    which one is better for me for long term, speed and WU.
    Thank you and i hope u understood what i meant lol

Option 1 is the correct way to do this.

1 Like

Thank you, was wondering if option 2 makes it quicker to fetch without (Do search for) However, the database structure will look awful specially if a some posts have 100 replies stored in one field etc.

Yes, it does…

Option 2 makes it faster AND less costly in WU to fetch the replies in the list for a given Post.

But you have to look at the bigger picture when establishing the most performant and efficient way to build an app…

And Option 1 is almost certainly the better way to do this (although, of course, it does depend on a whole load of factors specific to your app and requirements).

1 Like

I totally agree with @adamhholmes that Option 1 is the right choice !
In your case, you can never know how many replies you expect for 1 post and this means that your list will store so many entries while lists shouldn’t be used for more than 20~30 entries for the sake of performance & scalability so definetely Option 1 is the right choice.

1 Like

Thanks Guys!
I’ll go with option 1 then.
Many thanks