we have a microservice architecture. There is an API Gateway that acts as entry point for a External System (SAP)

enter image description here

It is clear that SAP should connect with our system using the API Gateway. But, in the case a microservice (Costs API in the diagram) wants to consume some API inside the external system, it's a good choice to allow direct communication to the external system (SAP)?

Other otpion I could see is to reuse the API Gateway for that commmunication too? (acting as a central point in both communication flows) Are there any benefits or drawbacks on that? enter image description here

Many thanks in advance

  • 1
    "It is clear that SAP should connect with our system using the API Gateway.". - Hold on. :) Why is this clear? Are you not using links? Are the individual services not self-sufficient and independent? Is this a legacy thing? Commented Oct 6, 2022 at 10:26
  • @RobertBräutigam we don't let SAP know/be aware of our internal strcuture. We want freedom to change our internal architecture/deployments inside the system
    – X.Otano
    Commented Oct 11, 2022 at 12:00
  • That's what I mean. If you are using links that the clients follow, they will not be aware of any structure and you'll be free to change anything. Commented Oct 11, 2022 at 18:13

1 Answer 1


It's better not to let any internal services communicate with external services directly. I assume that everything is running within a VPC and the API gateway is the only way to talk to the inside/outside world. If the Costs API wants to contact SAP directly, you would need to change your network configuration to allow for that, so you'll weaken the security by increasing the access points. Plus, you will add an extra dependency, since the Costs API is already coupled to the API Gateway, but you'll also couple it to SAP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.