2

I am working on a distributed application project where there is need for rate limiting and authentication depending on the client consuming the service on an api gateway. I am wondering the best solution for designing the gateway.

Should I go with Spring cloud gateway or Spring Cloud function/AWS Lambda to create the gateway service?

Abiodun Osinaike
  • 155
  • 1
  • 4
  • 14
  • 1
    The question is not fully clear. Did you mean Amazon API Gateway is in the front of those services that you want to rate limit and authenticate? And what did you mean by "designing the gateway"? Can you please elaborate? – dmahapatro Jun 08 '22 at 23:43
  • By design I mean system design/architecture in relation with other microservices. Yes, the API gateway will be at the front of those services. – Abiodun Osinaike Jun 09 '22 at 09:14
  • Basically, I want to be able defend the choices. I need to understand the use case for the two options – Abiodun Osinaike Jun 09 '22 at 09:26

3 Answers3

6

I'd argue that using AWS API Gateway will make your life easier...

The benefits of using AWS API Gateway are:

  • it will remove all the operational cost of maintaining, configuring, monitoring and operating a Spring Cloud Gateway instance,
  • it will be highly available, with failover,
  • it will give you instant features like rate limiting, api keys, caching, authorization, canary testing, proxying, integration mapping, environments
  • it is very very cheap ($3.50 x MM requests).

The benefits of using Spring Cloud Function:

  • Define your API's as code within the application code itself
  • Leverage the ecosystem integration within Spring, for example, to run it locally on a dev's PC.

Cons of using API Gateway:

  • Deployment of new API's will be harder than using Spring Cloud Gateway (you need to configure each new resource/method)
  • Your costs are now tied to the number of requests... if you have a 900.000.000 millons/months API it could get expensive
  • Vendor lock-in

Cons of using Spring Cloud Function:

  • Operative cost of maintenance
  • Single point of failure
sercasti
  • 550
  • 3
  • 7
1

You can use Amazon API Gateway. For more info on request throttling and quotas, please refer to the docs: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html

Richard
  • 14,427
  • 9
  • 57
  • 85
  • I agree, and the benefit og using Spring Cloud Function is just a way to represent AWS Lambda in a more puristic Java by implementing your functionality as simple Java Function. – Oleg Zhurakousky Jun 09 '22 at 12:38
0

I will rather use Istio gateway Envoy proxy rather than both options if permitted. Keeping my operational and maintenance cost little and no code change.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32316428) – Nol4635 Jul 28 '22 at 00:30