Answer the question
In order to leave comments, you need to log in
How to organize interaction between REST backends?
Good afternoon. There are several servers with services that implement the REST API. Some requests in their work from one server must exchange data with other backends. Question - what are the best practices?
It is clear that on the client application it sends requests to the right place and aggregates the result in the browser. But what is the best way to do this if the servers need data from each other? Normal curl requests?
Answer the question
In order to leave comments, you need to log in
It's called SOA : services talking to each other.
Thus, for example, mail is sent - one backend (your server) sends a message to another backend (mail server) using the SMTP protocol.
You can upload files to another server - WebDAV, FTP or CSP protocol.
Your server can post tweets on behalf of another user - this is done via HTTP, with an authorization token. Requests are sent via curl or Guzzle.
In general, curl is the norm.
Regular curl (or better Guzzle) requests inside repository services. Then you will be able to abandon curl in the future and switch to MQ for example or something else ... depends on the task and goals that you are following.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question