11
votes

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

2
I don't know the specifics of your project, but a possible use case would be an application that needs heavy processing, but not all the time. Your app server might run on EC2 using Dynamo, and S3 for static content. Wherever your app needs heavy processing, put it on Lambda. You only pay for the time the function is running. Cheaper and faster than auto-scaling your whole stack when the processor gets overloaded. - Stephen C

2 Answers

10
votes

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.

3
votes

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