instagram-reddit type app with socket io

so i am making an instagram/reddit type app where its just a bunch of posts and likes/dislikes/comments I want to implement web sockets so that you can see the likes and dislikes for every post updating live instead of having to refresh page so one way i can do that is when each time a person likes/dislikes then the server will emit to all the other clients and update their data but this isn't efficient because I imagine a big app like instagram has thousands of likes and dislikes per minute and the person loading the data isnt actually loading all the posts that exist so how do i only emit for the posts that the person is currently viewing so that his client only updates the likes/dislikes for them and not every post that exists?
2 Replies
test_1
test_1OP2y ago
I was thinking perhaps that each post that comes into the person's viewport will join him to a socket room for that specific post, and in that way i would emit events only to each post's room
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server