Backend & systems·API and interface design
you upgrade the connection once and then push messages in both directions without a new request each time.
WebSocket
A persistent, bidirectional connection over a single upgraded HTTP connection. It is the right choice when the server must push frequently or the client must send continuously. It costs you statefulness: connections pin clients to instances, so deploys, scaling and load balancing all become harder than with stateless requests.