Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Lambda vs Elastic Beanstalk

Im new to aws.

I am going to develop a REST full app which is going host on aws.

I decided to use

  • Amazon S3 for static contents
  • Amazon Cognito User Pool for Authentication
  • Amazon DynamoDB as db

I am confused on where my app is going to be hosted. I have 2 ideas for that.

  1. AWS Lambda Function + api gateway

Can I implement entire app on it ?

  1. Elastic Beanstalk

Can i integrate all the above aws services with it ? (Backend on .net core web api 2.0)

Please guid me

like image 395
Sanuja Ariyapperuma Avatar asked Sep 09 '18 05:09

Sanuja Ariyapperuma


People also ask

What is the difference between AWS Lambda and Elastic Beanstalk?

Lambda can handle infrequent, asynchronous code, such as event handlers that call other cloud services for heavy-duty processing, while Elastic Beanstalk underpins how developers build, deploy and manage the custom back-end services for the application.

Is Lambda cheaper than Elastic Beanstalk?

Lambda is simpler and less expensive, while Elastic Beanstalk lets you run full applications and gives you control over their environment. Understanding each one's strengths will let you make an informed choice between these AWS services.

Is Elastic Beanstalk considered serverless?

Serverless Plugin Elastic BeanstalkA serverless plugin to deploy applications to AWS ElasticBeanstalk.

Is Elastic Beanstalk still relevant?

Elastic Beanstalk Is Outdated, Stay Away From It. Elastic Beanstalk used to be a nice alternative to bare EC2 (Amazon Elastic Compute Cloud) or even Heroku for some time. But today, in times of docker clusters, it is clear that it stayed far behind its competition.


2 Answers

Since you might not be interested in managing the underlying system, you should opt for AWS Lambda + API Gateway.

like image 152
Taha Avatar answered Sep 28 '22 01:09

Taha


As the experience of working with cloud, after 1y 6m I can give a proper answer for my own question.

Yes. There is a possibility to use API Gateway + Lambda for the entire app as the back end. But you have to manage your most of the app logic from the front end. On there you have to get a risk because the source code can be viewed by the public.

Keeping your all business logic in the client code is not a good practice. And keeping all the logic in the Lambda also not easy or cost effective. The reason is when you making a real world app, you will need thousands of functions. To do one task, you will have to call many functions (Then its a function run time). So it will be very expensive.

Best solution is hosting the backend on Elastic Beanstalk and front end on S3. If you have any heavy task ? then you can make Lambda functions for that.

Lambda is best for CPU bounded functions. But not to have all the application logic on it.

like image 28
Sanuja Ariyapperuma Avatar answered Sep 27 '22 23:09

Sanuja Ariyapperuma