If setInterval
is too short (milliseconds) you start to run the risk of having inconsistencies. Requests may start coming in different orders from those that were executed and this can lead to an outdated data overwriting an updated one. Pooling AJAX works best for longer ranges.
In addition you will have to have a very good infrastructure to handle the volume of requests. Imagine that each user will make 5 requests per second if the range is 200ms for example.
The ideal would be to work with the same WebSockets. You keep a single connection open and only update the client when you receive an event notifying you that a change has occurred.
I do not work with PHP but apparently there are libs that make it easier to adopt WebSockets.