DEV Community


Discussion on: What do you use to create REST APIs with WebSockets?

michelemauro profile image

WebSockets are made to be real-time, and bidirectional. REST is (usually) unidirectional, from the client to the server.

You better isolate on websocket only the use cases that really need those features i.e. server-initiated messages, real-time interaction, presence notification and such.

The two programming models of traditional frameworks and websocket ones (request/response vs. message passing) are different for clear and important reasons; there is little use in trying to avoid the "complications" in websocket use (i.e. everything async) because they are essential characteristics of the medium.