
3 Ws and H story of AWS containerization in AppMod
Container Services for App Modernization
Published Oct 7, 2024
There is a belief in me that everyone follows the trend. And the trend is to write, play, experiment with AI/ML, GenAI. But my roots are still with application development, and that's what I enjoy the most.
While I struggled to pen down and finish my last blog on GenAI and AI (Thanks to lost access of GitHub) - I want to bring back everyone to the real world where 70% people are still struggling with Application modernization, move to cloud and adapting to the newer ways post Generative AI storm.
So with 2 of my most favorite technological things (Application Development and AWS) in mind, I thought to write a blog about containers and the variety of services AWS offers. And you know, remind people that the world still needs application modernization, cloud migration etc. - so don't leave your basics.
I don't need to tell my smart readers that AWS offers comprehensive services that can cater to any kind of containerization needs. All the services is designed to meet certain specific criteria and use cases. From managed solutions to highly customizable container orchestration platforms.
Now let me back the above sentence with some proof... ;-)

For the context of this blog, I'll first compare AWS’s popular containerization services (that I have used, that is... ;-) ), here they are:
- Amazon Elastic Container Service (ECS)
- Amazon Elastic Kubernetes Service (EKS),
- AWS Fargate
- Amazon Lightsail Containers.
Let's now dive into 3 Wives and a Husband (so many jokes comes to my mind - not the time and place.) that might arise during Migration or Modernization journey. I may add very simple fixes - but I am very confident that simple fixes are never applicable in real world - so please contact or write to me your unique problem, I will surely try and help out as much as I can.
Criteria | Amazon ECS | Amazon EKS | AWS Fargate | Amazon Lightsail Containers |
---|---|---|---|---|
Infrastructure Management | Managed (with EC2 or Fargate options) | Managed control plane, self-managed EC2 or Fargate nodes | Fully serverless, no infrastructure management | Fully serverless, no infrastructure management |
Orchestration System | AWS-native container orchestration | Kubernetes | Serverless execution, ECS/EKS integrated | Lightweight orchestration |
DevOps Complexity | Low | High (requires Kubernetes expertise) | Very Low (no server management) | Minimal (very basic dev-friendly setup) |
Scalability | ||||
Scalability | ||||
CI/CD Integration | Excellent (integrates well with CodePipeline, Jenkins, etc.) | Complex (requires Kubernetes-native tools, Helm, etc.) | Seamless integration with CodePipeline, CodeBuild | Basic integration, more developer focused |
Auto Scaling | Supported (Manual for EC2) | Supported | Auto | Auto with pre-defined limits |
Multi-cloud Compatibility | Limited to AWS | Excellent for Cross Cloud, Hybrid Cloud and Multi Cloud | Tightly coupled with AWS | Tightly coupled with AWS |
Migration Complexity | From AWS to AWS - Easy, But from AWS to other - Moderate to high. | Low if you know k8s | From AWS to AWS - Less but from AWS to other - high | Very High |
Security & Networking | All AWS Managed Services can be leveraged | All AWS Managed Services can be leveraged but still needs something additional from Kubernetes standpoint | Fully Managed | Fully Managed |
Large/Long running apps | Well Suited specially with EC2 and its reserved instance setup | Yes - for all enterprise/large scale needs | No - best for short/on-demand tasks or jobs | No - only good for light weigh applications and tasks |
Operation Complexity | Low with Fargate, Moderate with EC2 | Moderate to High - if you have decent understanding of Kubernetes | Low - Mostly Serverless but so is the application built on it. Not made for high workloads | Low - but same as Fargate. Best suited for light weight / small scale applications and tasks. |
Long Term Results | Excellent - specially with EC2 | Excellent - for all kinds of enterprises | Excellent - for serverless app but not for enterprises | Moderately good - for small / light applications. |
Monitoring & Logging | CloudWatch, CloudTrail, ECS task logs, VPC Flow logs etc.. | Best suited for Cloud native products like Prometheus etc.. | CloudWatch (Basic) | CloudWatch (Basic) |
Learning Curve | Less | Steep - Not made for faint-hearted... :D | Low | Low |
Best Use Cases | AWS-centric microservices | Enterprise App Modernization | Simple AWS-centric microservices | Prototyping or MVE (Minimum viable experimentation) products. |
Amazon ECS is a fully managed container orchestration service that integrates closely with other AWS services, offering a simplified way to run and scale containerized applications.
- Tight AWS Integration: If your infrastructure is AWS-centric, ECS is a natural choice because it integrates seamlessly with services like Amazon CloudWatch, IAM, VPC, and ALB (Application Load Balancer).
- Simplicity: ECS abstracts much of the complexity associated with container orchestration. It’s easier to use compared to Kubernetes for teams that don't require Kubernetes’s level of customization.
- Support for Multiple Launch Types: ECS supports EC2 for managing underlying instances or Fargate for serverless containers.
- Granular IAM Role Management: ECS allows per-task IAM roles, offering more fine-grained permissions.
- Define a task definition JSON:
- Register the task definition:
- Create an ECS service to run the task:
- Cluster Auto Scaling: Unlike EKS, ECS does not come with auto-scaling groups out of the box. You need to configure this manually if using the EC2 launch type.
- Limited Flexibility: ECS is easier to use but less flexible than EKS, which may limit its use in complex, multi-cloud environments.
- Use AWS Auto Scaling: Use ECS’s integration with AWS Auto Scaling to ensure tasks and EC2 instances scale appropriately based on load.
- Use Fargate for Less Management: If managing instances becomes cumbersome, migrate workloads to Fargate.
Amazon EKS is AWS's managed Kubernetes offering, allowing you to use Kubernetes for container orchestration. It’s ideal for teams already familiar with Kubernetes or those working in hybrid/multi-cloud environments.
- Kubernetes Compatibility: If you already use Kubernetes on-premises or in other clouds, EKS allows you to migrate without changing your workflow.
- Highly Customizable: Kubernetes offers much more customization compared to ECS. This is useful for highly complex applications or those needing a specific configuration.
- Multi-Cloud & Hybrid-Cloud: EKS is a strong choice when deploying across multiple clouds or in hybrid environments where consistency between on-premises and cloud is key.
- Create an EKS Cluster:
- Deploy an application on the cluster using kubectl:
- Expose the deployment to the internet:
- Learning Curve: Kubernetes has a steep learning curve and a complex operational model, which might delay migrations.
- Management Overhead: Although EKS is managed, you are still responsible for scaling, security patches, and control plane configuration.
- Cluster Auto-Scaling: Setting up Kubernetes cluster auto-scaling can be complex.
- Leverage EKS Blueprints: Use EKS Blueprints (Terraform or AWS CloudFormation templates) to set up clusters faster with best practices.
- Managed Node Groups: Use managed node groups, which automatically take care of patching and updating EC2 instances in your Kubernetes cluster.
AWS Fargate is a serverless compute engine for containers that works with both ECS and EKS. It eliminates the need to manage servers, making it a perfect choice for teams wanting a "no infrastructure" container solution.
- Serverless: No need to manage or provision EC2 instances. AWS automatically handles everything for you.
- Cost-Effective for Small Workloads: For applications that don’t require constant uptime, Fargate can be more cost-effective than running EC2 instances.
- Seamless Scaling: Fargate automatically scales your containers up and down based on demand.
- Define a task definition for Fargate:
- Run the task:
- Cold Start Latency: Fargate tasks can experience longer start times compared to ECS or EKS on EC2, particularly for the first start after a period of inactivity.
- Cost Scaling: For long-running, high-throughput applications, Fargate might be more expensive than EC2-based ECS or EKS clusters.
- Use Fargate Spot Instances: Leverage Fargate Spot for fault-tolerant applications to reduce costs by up to 70%.
- Optimize Container Start Times: Pre-warm containers by scheduling regular task invocations during low-traffic periods.
Lightsail Containers is AWS’s simplified service for developers who want to deploy lightweight containerized applications without diving deep into infrastructure management.
- Easy to Use: Lightsail is designed for developers who need to get applications up and running quickly.
- Great for Prototyping: Ideal for smaller applications, testing, or development environments where ease of use matters more than fine-grained control.
- Create a container service:
- Deploy a container:
- Limited Customization: Lightsail is designed for simplicity, which can be limiting for advanced use cases requiring fine-grained control.
- Scaling Limitations: While Lightsail supports scaling, it’s not designed for massive enterprise-scale applications.
- Migrate to ECS/Fargate: Once the application outgrows Lightsail, you have to migrate to ECS or Fargate for more flexibility and scalability.
Your use case matters alot when making decisions as Architect but below is a little summary helpful guide or above story:
- Choose ECS for AWS-centric workloads and simplicity.
- Choose EKS if you need Kubernetes or operate in a multi-cloud environment.
- Choose Fargate when you prefer a serverless solution without infrastructure management.
- Choose Lightsail for lightweight applications or quick deployments.
As with any cloud journey, there are gotchas, but with careful planning, automation, and optimization, these can be mitigated.
Ah yes - I forgot - Generative AI and Tools developed using it will have a huge say in this area going forward. Small application migrations can very easily be automated upto 50% using these tools.
More info on how GenAI will have a say - may be next time... This already has become a long blog.. :D