2

I am currently working on a project made of many microservices that will asynchronously broadcast data to many possible client applications.

Additionally, client applications will be able to communicate with the system (i.e. the set of microservices) via a ReST Open-API

For broadcasting the data, my first consideration was to use a MOM (Message Oriented Middleware) such as AMQ.

However, I am asked to reconsider this solution and to prefer a ReST endpoint (over HTTP) in order to provide an API more "Open-API oriented".

I am not a big specialist of HTTP but it seems to me that main technologies to send asynchronous data from server to client are:

  • WebSocket
  • SSE

I am opening this discussion I order to get advices/feedback from other developers to help me to measure the pros & cons of this new solution. Among that:

  • is an HTTP technology such as SSE/WebSocket relevant for my needs

For additional information, here are a few metrics regarding the amount of data to broadcast

  • considerable amount of messages per seconde
  • responsiveness
  • more than 100 clients listening for data

Thank you for your help and contribution

Paul R
  • 208,748
  • 37
  • 389
  • 560
Philippe MESMEUR
  • 737
  • 8
  • 22

1 Answers1

4

There's many different definitions of what people consider REST and not REST, but most people tend to agree that in practical terms and popular best practices REST services expose a data model via HTTP, and limit operations to this data model by either requesting the state of resources (GET), or updating the state of resources (PUT). From that foundation things are stacked on top of that.

What you describe is a pub-sub model. While it might be possible in academic terms to use REST concepts in a pub-sub architecture, I don't think that's really what you're looking for here.

Websocket and SSE are in most real-word situations do not fall under a REST umbrella, but they can augment an existing REST service.

If your goal is to simply create a pub-sub system that uses a technology stack that people are familiar with, Websockets are a really good choice. It's widely available and works in browsers.

Evert
  • 93,428
  • 18
  • 118
  • 189