
,I'm creating a social media app using react Native I'm wondering what would be the best approach to store things like "like" and "follow" ? I heard that it's better to be on its own collection but is it really? also, thought about stroing basic things like doing that and also adding an attribute on the posts collection called "likesCount" whick reflects the count only, an Int, and keep the likes on its own collection, so that for time line view it will only get a count, not do another db request to get the likes collection, what do you guys think?

For count, I think it's better to have the number in an attribute since it's never a good idea counting everything unless it's a small number

Respect likes in a collection, It's a good idea since that way you can query them

So you don't get all likes a post has, for example, you only get the ones from your friends or from your account to check if you liked it or not

Or just paginate tem

so you reckon, this approach is good? the posts are 5k+ and of course will grow, and I'm also using tanstack query to use some caching and get things to make sense, especially that I have a twitter-like "explore" where it basically gets 40 posts, doing infinite scrolling etc, so it's not from a specific friend or smth, so this neads to be heavily optimized for performance
Recommended threads
- Problem with login using Retool
I am using the Appwrite rest api to create an email session from Retool. My next api call is to create JWT. The call is failing because Retool is a closed envir...
- Appwrite sites 404
Hello ! When I add a subdomain to a deployed website, it gives me a 404 error on said domain thus making the SSL processus not working and im not able to acces...
- I'm facing an issue with the magic link ...
When a user requests a magic link, I can see on the Resend dashboard that the email is sent immediately to the recipient. However, the user actually receives th...
