With WebSockets, when clients should be notified that data changed, I've seen two approaches:
- the server pushes the data modifications directly within the push;
- or the server pushes no data, and the client, on receipt, triggers an API call to get the updated data.
Which one would you use, and in which case?
In my case, the server does quite a lot of computation before serving data through HTTP endpoints (i.e. it's not just "serialize this database table"), so I think I'll opt for the first approach, so that these computations don't need to be done client-side as well as server-side.
But I would be happy to have your opinions on this before proceeding.