I have a Rails application that uses GetStream to implement a newsfeed functionality. Everytime a user logs in, the user follows every single location they have access to. The only issue is that a user could possibly belong to 1000+ stores making performance a huge issue.
After setting up the user the first time (the longest time because all follows need to be created), what would be the correct way to prevent duplicate follows? Would it be to set a boolean flag on the user to not follow everytime they log in and only create a new follow each time the user is given access to a new location?
Or maybe GetStream is already smart enough to notice duplicates so it doesn't write each time it receives the same information?