title: Real-time messaging between PHP backend and JAVA frontend
body: <p>My company has a desktop application which is made in JAVA and is communicating with PHP backend. Now, we have many clients, who are all given with a desktop app, and for each client there are many orders which are coming in. Currently, the desktop app is polling the PHP backend every 30 seconds to check if there is any new order or not, I want to optimize this process by either using a messaging protocol to relay the information as most of the polling requests go empty (900 out of 1000) or by improving polling mechanism.
  I studied about MQTT and XMPP but was unable to understand. Also, I was thinking of using sockets but then someone said that there can be a problem with the port and all.
  Is polling better or push, in this case?
  If polling is better then how can I improve it since it is directly querying DB (which is wrong, it should go through a cache layer) or if push is better then how I can implement it?</p>