I’m developing the back-end of a real-time Java application, using Hibernate for data modeling, where I want to offer an API to feed the client side, that could be a webpage, mobile app or even a desktop application. The server is updated by RTU’s once in a while, maybe just one or two updates every few minutes, but I want the server to inform the clients with every change produced in real time. So I have made some research about websockets, and it seems to be some controversy about its use. As my application won’t have a big amount of non-requested traffic from server to client, I don’t know if the use of websockets is the best solution. But on the other hand, if I use REST services, I will need some workaround to ensure that clients receive every change produced in server. In this case, what issues could I face developing this application with websockets? Are they the best approach?
Edit: The difference between the websocket vs rest API for real time data? post and mine it's the rate of unrequested traffic from server to client is going to be quite least, because there may pass several minutes between two server updates. As far as I know, websockets are a good choice for applications that need constant updating from server, as online games, but in my case I don't know if the cons of using it would overweigh the pros. This article made me doubt about the suitability of using websockets on my application