Designing Cost-Optimized Architectures on AWS: Right Sizing, Serverless, Storage Tiering, Network Savings and Real Examples

AWS Solutions Architect 45 min min read Updated: Nov 17, 2026 Advanced
Designing Cost-Optimized Architectures on AWS: Right Sizing, Serverless, Storage Tiering, Network Savings and Real Examples
Advanced Topic 3 of 3

Cost Is a Design Decision

Most savings do not come from discounts. They come from architecture choices: the right service, the right size, the right time, the right storage tier and the right network path. A cost-optimized design meets the requirement at the lowest price, not just the lowest price.

Cost leverQuestion to ask
Service choiceIs there a managed or serverless option that removes idle cost and operations?
SizeIs the capacity close to actual need?
TimeDoes it need to run 24x7?
Pricing modelCan the baseline be committed and the rest be Spot or On-Demand?
DataIs it in the cheapest suitable storage class, kept only as long as needed?
NetworkDoes traffic avoid NAT, cross-AZ and internet egress where possible?

Compute Optimization

TechniqueDetails
Right-sizeUse Compute Optimizer. Many instances run below 20 percent CPU. Move to a smaller size or family
Graviton (arm64)Often up to ~20 to 40 percent better price/performance for supported software (EC2, RDS, Lambda, Fargate, ElastiCache)
Auto ScalingScale in at night and weekends. Scale on demand metrics
SpotFor stateless, batch, CI, EMR task nodes, containers. Diversify types and AZs, use capacity-optimized allocation
SchedulesStop dev/test outside working hours (can cut ~65 percent of the hours)
Savings PlansFor the always-on baseline
Burstable TCheap for low steady CPU. Watch credits
ContainersPack many tasks on fewer instances; Fargate Spot for tolerant tasks
bash # EventBridge Scheduler rule idea: stop tagged dev instances at 20:00 on weekdays aws scheduler create-schedule --name stop-dev-nights --schedule-expression "cron(0 20 ? * MON-FRI *)" --schedule-expression-timezone Asia/Kolkata \ --flexible-time-window Mode=OFF \ --target '{"Arn":"arn:aws:scheduler:::aws-sdk:ec2:stopInstances","RoleArn":"arn:aws:iam::123456789012:role/scheduler-ec2","Input":"{\"InstanceIds\":[\"i-0abc123\"]}"}'

Serverless vs Containers vs EC2: Economics

WorkloadCheapest usuallyWhy
Low or spiky traffic API, many idle hoursLambda + API Gateway/ALBPay only per request, zero cost when idle
Steady 24x7 high trafficEC2 or ECS on EC2 with Savings PlansPer-request pricing becomes more than a busy server
Variable web app, small teamECS/Fargate (+ Fargate Spot where possible)No node management, scale to demand
Nightly batchLambda, Fargate, or Spot via AWS BatchRun only when needed
Always-on small utilities**Graviton t4g or a small Fargate task**Low fixed cost
Break-even idea: Compare cost per million requests on Lambda at your memory and duration against the monthly cost of the instances needed for the same load. The crossing point depends on your numbers. Calculate before deciding.

Storage Optimization

TechniqueDetails
S3 lifecycleStandard → Standard-IA (30 days) → Glacier (90+) → Deep Archive; expire old versions and logs
Intelligent-TieringUnknown access patterns, no retrieval fees
Delete incomplete multipart uploadsLifecycle rule AbortIncompleteMultipartUpload
EBSgp3 instead of gp2, right-size volumes, delete unattached volumes, lifecycle snapshots, snapshot archive
EFSLifecycle to IA/Archive; One Zone classes for non-critical data
Compression and columnar formatsParquet + Snappy shrinks storage and query cost
CloudWatch LogsRetention, Infrequent Access class, export to S3
Data retention policyDelete what the business does not need

Database Optimization

  • Right-size instances using Performance Insights and CloudWatch
  • Reserved instances for steady RDS/ElastiCache/Redshift/OpenSearch
  • Aurora Serverless v2 for variable load, stop dev databases or snapshot-and-delete
  • DynamoDB: on-demand for spiky, provisioned with auto scaling for steady, Standard-IA table class for rarely read data, TTL to delete old items
  • Use read replicas or cache instead of scaling the primary up
  • Redshift Serverless or pause clusters when idle; use S3 + Athena for rarely used data
  • Choose Single-AZ for dev, Multi-AZ for production

Network Optimization

Cost sourceSavings
NAT Gateway (hourly + per GB)Add S3 and DynamoDB gateway endpoints (free); interface endpoints for heavy AWS API traffic; avoid routing big downloads through NAT; one NAT per AZ only in production; consider IPv6 and egress-only IGW
Internet egressPut CloudFront in front (lower per-GB price, caching), compress, keep data in the user's Region
Cross-AZ trafficKeep chatty components in the same AZ where availability allows; use zone-aware routing; prefer AZ-local replicas
Cross-Region transferReplicate only what you need, compress, schedule
Public IPv4 addresses (billed)Remove unused public IPs, use ALB/NLB shared addresses, IPv6, private connectivity
Transit Gateway data processingUse peering for a few large flows if suitable

Example 1: Reduce a Web Application's Bill

BeforeAfterEffect
12 x m5.xlarge On-Demand 24x7, 20 percent CPUAuto Scaling 4 to 8 x m7g.large, Compute Savings Plan on the baselineFewer, smaller, cheaper chips, big reduction
All images served from EC2 and S3 over the internetCloudFront caching in frontLower egress and origin load
NAT Gateway carries all S3 trafficS3 gateway endpointNAT data cost drops sharply
Dev and test run all nightScheduler stops them 20:00 to 08:00About 50 to 65 percent fewer hours
gp2 volumes and 3 years of snapshotsgp3 and 60-day snapshot policyLower storage cost

Example 2: Data Pipeline

BeforeAfter
Always-on large EMR cluster for a 2-hour nightly jobTransient EMR (or EMR Serverless/Glue) started per run, Spot task nodes
CSV in S3 Standard queried by Athena (full scans)Parquet + partitions, older partitions to IA
Logs in CloudWatch forever30-day retention, export to S3 with lifecycle
Redshift 24x7 for a monthly reportRedshift Serverless or Athena

Example 3: Low-Traffic Internal Tool

text Before: 2 x m5.large in 2 AZs + ALB + RDS Multi-AZ = about a few hundred dollars a month for 20 users After : S3 + CloudFront static front end, API Gateway + Lambda, DynamoDB on-demand = a few dollars a month, no servers to patch, still multi-AZ

Cost-Aware Design Rules

  1. Prefer managed and serverless when the workload is spiky or small
  2. Commit to the baseline, flex above it
  3. Delete data and resources on a schedule: lifecycle, TTL, stack deletion
  4. Use cheapest class that meets the retrieval need
  5. Measure cost per unit of business value (per order, per user)
  6. Tag, budget and review every month
  7. Do not sacrifice required reliability or security to save money: match the cost to the requirement

Practice Tasks

  1. Take a sample architecture (ALB, 6 EC2, RDS Multi-AZ, S3, NAT) and list 6 cost reductions with their risks
  2. Estimate Lambda versus a t4g.small for 5 million requests a month at 200 ms and 512 MB
  3. Add S3 and DynamoDB gateway endpoints and show the NAT route is not used for them
  4. Create a lifecycle rule for logs: IA at 30 days, Glacier at 90, delete at 400
  5. Write a schedule that stops the dev environment at night and starts it in the morning

Conclusion

Optimize cost by design: right-size and use Graviton, commit to the baseline and flex with Spot and Auto Scaling, choose serverless for spiky loads, tier and expire storage, cut NAT, cross-AZ and egress charges with endpoints, CloudFront and co-location, and schedule non-production. Never reduce reliability or security below what the requirement needs.

Quick Summary: cost levers; compute techniques + scheduler; serverless/containers/EC2 economics; storage/db/network tables; three before/after examples; design rules.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators