Im making a social website. When any user updates or creates new content on the site I need any other users viewing the site to see the change update.
I have comments which requite low latency so a subscription is recommended for this.
I also have events but these don't need such a low latency. Updating every 10 seconds would be fine. Should I also user subscriptions for this or would polling be less expensive for the server?
The subscription has been expressly made for this, it is the best option because the server only updates the response when necessary. However, if you use the other option, you will continuously try to refresh the data and you will be wasting resources from your server. I hope I've helped.
Read more about this here: https://www.apollographql.com/docs/react/data/subscriptions/#when-to-use-subscriptions