dimanche 19 mars 2023

Backend for Frontend in Microservices. HTTP or RPC with RabbitMQ for communication?

I'm implementing a microservice architecture and I need the use of Backend for Frontends, but I have doubts about how to implement its communication with microservices.

What do you do think about use RabbitMQ RPC to communicate a backend to frontend with all microservices?

I see these advantages:

  • It maybe offers better performance than REST.
  • Good scalability and native load balance.
  • It's easy to implement without the overhead of define types like with GRPC.

But these drawbacks:

  • It's a single point of failure. If RabbitMQ crashes, all microservices will be inaccessible, losing all microservice's independence.
  • It's based on asynchronous communication and in that case we are using it synchronously.

Would you use RabbitMQ RPC in that scenario or only for internal asynchronous communications between microservices? Based on your experience, what type of communication do you recommend for a backend for frontend?

Thanks!

HTTP:

enter image description here

RPC:

enter image description here

Aucun commentaire:

Enregistrer un commentaire