,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
- macOS app: OAuth flow doesn’t start
Hi Appwrite team, I’m integrating the Appwrite Swift SDK into a macOS app and am hitting an environment/runtime issue when starting OAuth. App architecture • ...
- Sites: Auto deploy on wrong github repos...
Hello, I have kinda with UAT(testing env) and prod env. When i pull request from dev -> uat, which stands as pre-prod environment to fully test all functionalit...
- Generate CSR
How do I generate a CSR for my domain host? They are asking me to generate one for my hoosting here on appwrite