9

I have several backend services (REST+SOAP) that have to be consumed by a SPA (Single Page Angular2 App).

As JWT (JSON Web Token) is not feasible for me for the moment, security is done using CAS Central Authentication Service ( single sign-on protocol ).

In order to avoid CORS (Cross-Origin Resource Sharing) and to have security in one place, I am thinking of creating a layer that will be accessible directly by the client and from that layer make each REST call. Something like a proxy that will just pass through the client requests.

This, I see as a custom API Gateway pattern implementation as I am not using an API Management tool.

Do you see any disadvantages to this solution?

3

2 Answers 2

0

In the case the question is still relevant, generally I would not implement a custom API gateway as it firstly would introduce a single point of failure to your system, i.e. your proxy service fails, the entire app is broken. Not to mention the potentially high overhead of mapping the proxy APIs to your SOAP and REST services, and of course the implementation cost itself. Finally do not underestimate the complexity of implementing a highly responsive API proxy - in general in needs to be around the order of 10x faster than your backend services, for the overhead to not be noticed.

Having said that, if you cannot go around it, as it seems to be the case in this question, then at least go for a tried and tested solution. For example, Kong has been a choice for many people who deploy their apps in k8s, but it all depends on your specific use-case.

-1

Let me preface this by saying that, I would not recommend reinventing the wheel when it comes to API Gateways as there are many options to choose from (paid & open source) that are tried and tested. This is one of those architecture concerns which appears almost trivial on its face but upon closer examination becomes quite a complex endeavor.

With the brief disclaimer out of the way, here are several of the reasons why you might want to adopt a pattern such as 'API Gateway' from a ten-thousand foot view...


General Benefits of Implementing the API Gateway Pattern

  • Decoupling the front-facing public API surface from the back-end services
  • Eliminating an excess of round-trip request/response traffic between services which are not contributing to said traffic, only forwarding it on.
  • Simplified security as you have a much smaller public facing API surface to keep secure.
  • Aggregating your miscellaneous cross-cutting concerns into a single service

For further reading I would highly recommend digging into some of the Architecture Documentation (API Gateway Pattern) which Microsoft has so charitably provided free of cost to us all!

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.