Help with social media app

I’m making a social media app, i want to know if my method is viable or no in the long run.

This is how my structure for every post looks like

what i’m doing is calling every post’s tag and their values and storing them in a dictionary at the start of the app.
and as the user scrolls posts are created and the info is taken from the dictionary.

but i want to know if this will be helpful in the long run, if the number of posts increases.
i tried with 50 posts it takes less than .5 sec to load every value of each post

To make it more reliable, use UID(Generated by Firebase Auth) as your parent node and then store everything inside that node.

Also, storing URL as your node name is not a good idea. Hope you got my idea.

Storing isnt the problem, everything is working fine.
I have used the URL as the node for a reason

My question is in the app’s code… Calling every value at the start of the application

Yeah. It’ll be helpful in the long run. Does not matter how many posts you have. If you are loading the posts as user scrolls, then your app may not have any problem. That’s the best way to load if you have too many posts. :slight_smile:

Also, you can follow this guide to get post from Firebase as user scrolls so that there will be no need to store them in the dictionary.

1 Like

I have no issues with my current structure neither loading posts as the user scrolls, everything is working perfectly fine. Thank you for your suggestion though but i’m already using UIDs as tags somewhere else.

I just want to know whether it is viable to call every value and then store the values in a dictionary as the app starts or should i call the values as the user scrolls.

2nd option
“Never waste Resources”
Your user may not even see the whole thing + Time required to load whole thing + Burden on database(I donno if it will be serious though)

1 Like