2

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. ?

Comments
  • 5
    KISS, 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
  • 3
    An readonly request should go rest. Websockets are better with rw data with realtime components.
  • 3
    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.
  • 0
    Wrong answers only section:
    Spin up a Kafka cluster and push the data to the client in real time.
  • 3
    If it's unidirectional, then you could use:
    - (long) polling
    - SSE (Server-Sent Events, which seem better for your use case)
    - Webhooks
  • 1
    @Berkmann18 I will definitely take a look at sse even though I finished it with rest already. :)
  • 0
    @blindXfish Okay 😄!
Add Comment