
,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
- Need help on Flutter OAuth2
Am trying to use Appwrite OAuth (google, apple and facebook), am been on it for sometimes now which have tried many things but still not able to make it work: ...
- How to detect user disconnection?
I'm creating a 1v1 challenge using realtime and i want to trigger a function when the user disconnect... how to make this using Appwrite Realtime? i searched i...
- Custom domain issue
Hello following another post I'm creating dedicated post according to my project ID: 67ffbd800010958ae104 I deployed for debug my React Native app in web, chrom...
