They can use one souce of infirmation. For example, you can store authentication infirmation in Redis and all APIs will connect to this Redis server and got the infirmation from it. I think, it will work faster than you will make curl request.
MicroAPI communication
I'm looking for some advice on best practices where possible.
I have a rather large API, and am considering the benefits of splitting this into multiple MicroAPIs. However, I'm not sure how I'd go about communication between these services.
Let's assume I have the following APIs or services.
- authentication
- articles
- notifications
Someone posting to the articles API would need to authenticate. They could obtain their token from the authentication API and include this token in all requests to the articles API, but how would the articles API ensure the authentication is correct, should I do a curl request to the authentication API, verifying the token
Equally, when an article is posted, I'd like the articles API to create notifications on the notifications API. Would this be a similar process?
Currently these services reside on the same server, but I would like to consider the possibility of splitting them.
Please or to participate in this conversation.