title: Real time communication between clients via websocket server on Google App Engine
body: <p><a href="https://medium.com/@martin.sikora/node-js-websocket-simple-chat-tutorial-2def3a841b61" rel="nofollow noreferrer">This</a> article describes how a websocket server for a chat application can look. We are planning to implement something similar; when a message is sent to the server it is sent to the correct recipient based on an authentication token and the message gets saved in a mysql database.</p>
  <p>We will eventually host the server on Google App Engine, and I suspect that that will cause some issues with the above described approach, since that depends on all clients being connected to the same server, and that probably won't be the case since multiple instances will be created as needed. Is there a way to connect all instances so that this won't be a problem (Pub/Sub maybe? (That will cause additional costs though)), or should we find a different solution?</p>
  <p>One idea I had was to use <a href="https://www.npmjs.com/package/mysql-events" rel="nofollow noreferrer">mysql-events</a> to monitor the binlog from the websocket server for the creation of new rows in the messages table, but I read somewhere that that wasn't recommend. But I can't find where I read that, and maybe that is the best solution.</p>