0

Currently we are running a NodeJS webApp using serverless. The API Gateway is using a single API endpoint for the entire application and routing is handled internally. So basically single http {Any+} endpoint for entire application.

My question is, 1, Whats the disadvantage of this method?? ( I know lambda is build for FaaS but right now we are handling it as a monolithic function.)

2, How much instance can lambda run at a time if we are following this method? Can it handle a million+ request at single time?

Every help would be appreciated. Thanks!

md-shah
  • 375
  • 4
  • 17
  • You can find the answer to a similar question [here](https://stackoverflow.com/questions/57450146/native-serverless-vs-serverless-express). – Erez Sep 10 '19 at 06:04
  • AWS Lambda Limits https://docs.aws.amazon.com/lambda/latest/dg/limits.html – Paulo Mendonça Sep 10 '19 at 20:11

1 Answers1

0

Disadvantage would be as you say - it's monolithic so you've not modularised your code at all. The idea is that adjusting one function shouldn't affect the rest, but in this case it can.

You can run as many as you like concurrently; you can set limits though (and there are some limits initially for safety which can be removed).

If you are running the function regularly it should also 'warm start' i.e. have a shorter boot time after the first time.

Tobin
  • 1,698
  • 15
  • 24
  • Hi thanks for your feedback. Can you just elaborate why monolithic is not good? Because in Ec2 instances, we cannot scale the hardware as we need right? But by following this (lambda + single endpint) we are building a type of monolithic stack which is auto scalable right? If am wrong, please correct me. – md-shah Sep 10 '19 at 05:33