실시간 정보 모바일 앱을 만들기로 했다. 1초에 한번씩 오는 수많은 정보를 모바일 앱으로 보내기 위해 Spring으로 서버를 만들기로 했다. 실시간 정보임으로 처음에는 WebSocket-React를 사용하려고 했는데, RSocket이라는 게 있다고 한다.
WebSocket vs RSocket하기 전에 위부터 짚고 넘어가는게 (나한테) 좋을 것 같다.
가장 큰 차이는 spring-mvc(Servlet)은 스레드 풀을 사용하고 spring-webflux(React)는 이벤트-루프를 사용한다고 한다.
Servlet은 동기-블로킹 방식을 사용, React는 비동기-논블로킹 방식이다. 블로킹 방식을 사용하면 Servlet을, 블로킹을 사용하지 않고 빠르게-계속 값을 받아야 한다면 React가 좋다고 한다.

차이를 알아보기 위해 검색하다가 아래와 같은 글을 찾았다.
WebSocket is a low level communication protocol layered over TCP. It defines how a stream of bytes is transformed into frames. But WebSocket message itself does not have instructions about how to route or process it. Therefore, we need messaging protocols that operate on top of websocket, at application level, to achieve two-way communication.
RSocket is a fully reactive application level protocol which runs over byte stream transports such as TCP, WebSocket, UDP or other. It provides application flow control over the network to prevent outages and increase resiliency. RSocket employs the idea of asynchronous stream processing with non-blocking back-pressure, in which a failing component will, rather than simply dropping traffic, communicate its stress to upstream components, getting them to reduce the load.
low level communication은 주고받는 데이터의 물리적인 부분-데이터 그 자체를 다루고, high level communication은 데이터의 논리적인 부분-제어, 초기화 등을 다룬다.
WebSocket은 데이터만을 다루고, 그러기 위해서는 messaging protocol이 필요하다. RSocket은 모든 level을 다뤄 제어까지 가능하다는 것 같다.
다만 RSocket 스트리밍을 자동으로 닫지 않기 때문에 메모리 누수가 생길 수 있다고 한다.
더불어 RSocket은 자료 양도 적고 지원하지 않는 기술이 많다고 한다... 나는 데이터만 보내면 되므로 Websocket을 사용하기로 했다.

출처