Pusher for Rails
Modern web apps require tremendous amount of data exchange between client-server side, it needs some architecture that can handle such thing. There are 3 methods that we already implemented to handle real-time sync between front end and back end.
- Push from server using forever loop
- Using Pusher
Push from server looks promising, everything work and CPU Utilization also quite low. But there is a problem after we move to Heroku. Push from server like we did in previous one is quite bad because every single user will create a thread which will terrible if there are, say, 1k user who post at the same time. Luckily Heroku provide adds on called Pusher (actually it is different product with Heroku, and we can use without on Heroku). It is very simple to implement and it seems very scalable because we don’t need to care the pusher server ourself, instead there are 3rd party who we can rely on.