I have a never ending discussion with my manager about the usage of AWS Lambda. I would like to get some help from one of you guys.
I am a bit hesitated to utilize serverless architecture for production level projects yet. First of all, its a bit time-consuming to test what I am building in the local setup. Even if we can test the code through the unit testing, we cannot remove the possiblity of faliure of mocked request and response objects. The fact that I cannot invoke the lambda in my local setup makes me very bored when I am testing my Lambda-written API during the development process. Secondly, as far as I know so far, there is no promised SLA for AWS Lambda for its availability and reliability. This just make me kind of hesitate adopting Lambda to build RESTful API.
So now what I do is to use Lambda only the case when to catch events triggered from AWS. For example, to do something after a user uploaded his profile picture to S3 bucket or to do something after a user registered throuh Cognito.
However, what my manager expects is to mix my Node.js API with AWS Lambda for a single project. From my perspective it totally doesnt make sense. Once we have set up Node API on EC2 instances, I think it will be more productive to think about setting up auto-scaling or how to utilize all the resources running on the current EC2s. But my manager insists me to set up both Node API and Lambda API altogether. For example, the services A and B will be served by Node API and the services C, D, and E by AWS Lambdas.
I tried it before, but it caused a lot of confusion to me. I feel like it will be better to choose either Node API or AWS Lambda API when building an API instead of mixing them together.
I don't want to say that my manager is totally false and I am right. I want to just have a clear answer in this case. I would really appreciate any comment and answers on this situation.
Just adding some thoughts on the previous answers:
For sure you can build, test and simulate a Lambda Invoke in your local environment, it's just a new paradigm and there's some tools to help you out.
AWS Lambda operates on the AWS "compute layer" infrastructure, so I believe if they face an issue on the compute layer, for sure your EC2 instances will also face an outage.
I don't think so. The serverless stack scales with zero effort, you don't need to manage infrastructure.
Welcome to micro and decoupled services! Where developing the service is easy, but managing the whole infrastructure is hard.
Another thing to keep in mind when talking to managers about architecture: Cost
It's hard to argue and makes every manager's eyes shine when they see the possibility of running their businesses with a low cost. And having your service running with a serverless stack is really cheap.
Bottom line:
No, it's not a bad idea to mix resources as your manager wants.
Yes, it's easier to just get a framework to write the api, setup an EC2 instance and a auto-scaling group.
Yes, there's a heavy lift when decoupling services, but it pays its price when running in production.