
,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
- Adding custom domain to Appwrite project
My app is hosted on Vercel on domain todo.velleb.com. On PC, the OAuth logins like GitHub, Discord and Google work and create the account and log in. On mobile ...
- #support
<#1072905050399191082> any help on that?
- Early Validation of Password Reset Token...
Hey there, I'm dealing with an issue with password reset flow and wondering how you handle this. Right now, when someone clicks an expired/already-used reset ...
