Compute is at the heart of most cloud workloads, and AWS offers a wide range of options to match different application needs. Amazon Elastic Compute Cloud, or EC2, is the foundational service for compute in AWS. It provides resizable virtual servers called instances that can run a variety of operating systems and be customized with different combinations of CPU, memory, storage, and networking capacity. EC2 is well suited to traditional applications, lift-and-shift migrations, and any workload that requires full control over the underlying virtual machine.
EC2 instances are launched from Amazon Machine Images, or AMIs, which are templates containing the operating system, application server, and any data needed to start a fully configured instance. AWS also categorizes instances into families based on their intended use. General Purpose instances, such as the M5 family, balance compute, memory, and networking for everyday workloads. Compute Optimized instances like the C5 family are tuned for CPU-intensive tasks such as batch processing and gaming servers. Memory Optimized families such as R5 are designed for workloads that need large amounts of RAM, including in-memory databases and real-time analytics. Choosing the right instance type is an important step in balancing performance and cost.
Beyond virtual servers, AWS offers serverless and container-based compute models. AWS Lambda runs code in response to events without requiring customers to provision or manage servers, charging only for the compute time actually consumed. This serverless approach removes much of the operational burden of capacity planning, patching, and scaling. For containerized workloads, Amazon Elastic Container Service, or ECS, is a managed service that orchestrates Docker containers using either the Fargate launch type for a fully serverless experience or the EC2 launch type for more control. Amazon Elastic Kubernetes Service, or EKS) similarly manages Kubernetes clusters, integrating with AWS networking, identity, and monitoring services to simplify operations.
To handle variable demand, AWS Auto Scaling automatically adjusts the number of EC2 instances in response to changing load. Scaling policies are typically tied to CloudWatch metrics such as CPU utilization or request counts, allowing capacity to grow during traffic spikes and shrink during quiet periods. Auto Scaling helps optimize cost while maintaining performance and availability, and it works hand in hand with load balancing to distribute traffic across the available instances.