Background: I've worked with EC2 and RDS. Recently I received a query from a client in which he wants to develop both mobile and web applications using Amazon Web Services, and need advice on which service he should go with?
- Elastic Beanstalk
- Lambda
- Elastic Container Service (ECS) or Elastic Container Registry (ECR)
Also, I've gone through several tutorials on YouTube and Google to understand these services, but still I'm unable to figure out with which service he should go with.
Problem: I don't have any proper knowledge and experience working with the above mentioned services. Therefore, I want advice from the people who have experience working with them.
Please explain with advantages and disadvantages of using specific service so it will be easier for me to advice.
Elastic Beanstalk is your traditional hosting - you can upload a PHP or Java or whatever application, say Wordpress, configure a database, etc, and go. There are some smarts for scaling, recovery, etc, but it’s still very much a traditional hosting platform.
ECS Containers can still run your traditional app but there are some more specifics - most notably the containers don’t have persistent storage and are ephemeral, they can come and go and be restarted at any time. Which means they have to be built and ready to run without manual configuration / intervention. There are ways to provide persistent storage for containers but if you can avoid it it’s better. Design your application in a way that it stores all its data in a database and all its files in S3 for example. BTW ECR (Elastic Container Registry) is only a storage for your containers. It's to be used with ECS.
Lambda is a cloud-native serverless concept where the app is split into small functions that serve the various API requests. The website frontend is typically built for example in React or Vue or similar and is served from S3 / CloudFront. Then it makes API calls to the Lambdas through API gateway.
Serverless apps and Containers can typically scale better than traditional apps if they are done right. On the other hand building your first serverless app will be quite a learning curve as some concepts are different from what you may be used to do.
It is a very brief overview. This topic can be discussed for hours :)
Try to google something like “serverless apps design best practice” or “containerised apps design best practices” if you want to go that way.
Hope that helps :)
Adding to the previous answer - Elastic Beanstalk is more of a Pet platform while Docker (ECS) and Lambda are Cattles. That also means that Docker and Lambda are stateless which means they don't (must not) store any state locally, everything is in a database, in a memcache cluster, and in S3. Beanstalk on the other hand can store local state but it's discouraged with modern applications as it complicates scaling.
Have a look here if you're not familiar with the Pet and Cattle concept.