Choosing the right AWS Compute product
AWS Ec2, Fargate, Lambda, Beanstalk, or EKS? Which cloud solution is the best?
On AWS today, there seems to be so much confusion about what compute platform to pick. AWS seems to have a neutral tone, but this hands-off mentality is causing companies to spend time and effort on the wrong products.
AWS Ec2 is the oldest compute product. AWS Beanstalk was released in 2011. AWS Lambda in 2014. AWS ECS Fargate (Containers) was announced in 2017. AWS EKS (Kubernetes) was announced in 2018.
For a great balance of operationally efficiency and high scalability, an ALB with a Fargate cluster, is the most scalable and easiest to manage solution that I would highly recommend.
Cloud Security Solutions
For an advanced AWS user, EC2 is perfectly fine for security. With EC2, oftentimes people set wide open ingress rules in their security groups. The higher management cost and confusing terminology (Security Group, Route Tables, Public/Private subnets and ACL), can make it challenging operationally to have proper security. It is so confusing.
With Fargate, they use a multi-tenant container system to run your workloads and the container can provide you with some extra security. Open the port on Docker and provide the correct ingress security group rules, and you will be good to go!
Operationally efficient
ECS Fargate is comprised of tasks, which are one or more containers. Containers are ubiquitous so it will be easy to onboard.
With ECS Fargate, you can route logs to a Cloudwatch log group easily, you can enable container insights for fine-grained latency debugging, and it is the state-of-the-art serverless compute product at AWS. There are no kubectl commands you need to know and no kubernetes specific terms or languages to use.
Scalable
Fargate is highly scalable, it is faster to vertically scale resources (just change mem/cpu) and also to horizontally scale (increase the cluster desired task count).
Scale to zero is do-able with Fargate. A user needs to spend some time creating autoscaling policies. Similarly, it is easy to scale out based on a metric. Given the speed of starting containers (and not new ec2 instances), fargate is able to handle load spikes better than ec2 or eks, when configured correctly. Using fargate, a company can run 5000 containers (soft limit) per cluster. This would mean hundreds of thousands of TPS.
AWS Services to avoid
API Gateway → AWS Lambda Architecture
This is a bad option for customer experience. Cold start latency will be 1 to 5 seconds (just go and create a lambda, and execute to see for yourself) and this notion of concurrency is inherently confusing because we (engineers) just want to know memory, vCpu, network bandwidth, and then the concurrency is determined by our runtime decisions (# of threads). Simply put, this should have never garnered the adoption for being ‘serverless’, because it isn’t that scalable and doesnt provide equal customer experience. Any mission critical web service should really avoid this setup.
AWS Beanstalk
This is an old Platform-as-a-service product that gives you less control and flexibility to do things that you want. I doubt it can reach Fargate, Ec2 or EKS levels of TPS load. The other serverless options today are just much better.