Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
![](/static/devrant/img/pipeless-devrant-banner-white.png)
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Hazarth92593yKISS, so go REST in my opinion.
WS is not worth it for this. The less complex the project the easier to maintain and debug anyway.. less things can break which also means less headaches -
stop68733yAn readonly request should go rest. Websockets are better with rw data with realtime components.
-
Imho i would do ws as you are sending updates to a client vs asking a server to do something. Driving the client via the server.
-
LLAMS37513yWrong answers only section:
Spin up a Kafka cluster and push the data to the client in real time. -
If it's unidirectional, then you could use:
- (long) polling
- SSE (Server-Sent Events, which seem better for your use case)
- Webhooks -
@Berkmann18 I will definitely take a look at sse even though I finished it with rest already. :)
Question.
I have a java app to monitor and send aprox every 3seconds a json with data to a client who will present it on a single fancy display, there will not be other clients ever, only this single one. Shall I go websockets and push the data, and wait for it there or shall I go rest and ask for the data every 3 seconds? Im planning to use node on the client regardless of the solution. ?
question
node.js java websockets rest