I’m working on a project with two separate backend (BE) services using Java Spring Boot and a frontend built with Angular. There are scenarios where actions in one backend result in changes in the other, necessitating communication between them.
Here are the two approaches I’m considering:
1. Frontend Mediated Communication: The frontend sends requests to both backends independently and manages the responses.
2. Direct Backend-to-Backend Communication: The backends communicate directly with each other using WebClient.
Which approach is generally recommended?
Are there specific scenarios where one approach is clearly superior to the other?
What are the best practices for implementing the chosen approach?