Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    It makes less work for them, otherwise they have to support the data request both from the WebSocket and from the web API. I don't think it would necessarily be difficult to set it up to use a common request and response format, but the effort level isn't zero. Commented Jun 13, 2024 at 19:24
  • 1
    @Craig I am afraid I don't understand. It would be less work for them to send notifications with the id's of changed items, and then to support separate api returning data represented by those id's? The complexity of the solution was not mentioned, only performance concerns. Commented Jun 13, 2024 at 20:00
  • 1
    Rest is easier to use out of the box. You may end up creating something similar to rest using web sockets. Commented Jun 13, 2024 at 20:35
  • When Web sockets are used for client notifications only, and REST/Http for data transfer only, it sounds to me there will be a clear separation of concerns, no redundancy. So why not give it a try? Commented Jun 14, 2024 at 4:23
  • 1
    More complicated WebSocket use cases are difficult to do well. Suddenly you have to think about things like errors and content types and caching. This often ends with the WebSocket turning into a custom RPC protocol with some HTTP-ish features. Unless latency is really important, making a separate request using HTTP is going to be much easier for everyone involved. Sending change notifications (without content) is also a common pubsub pattern where bandwidth is constrained or where the full content might not always be needed. Commented Jun 14, 2024 at 15:42