Cloud bills have a habit of growing faster than the business. Resources are created for a test and never deleted, instances are sized for a peak that never comes, and data transfer charges appear that nobody predicted. The good news is that most cloud waste comes from a handful of predictable causes, and fixing them does not require re-architecting your product.
This article covers the cost optimisation practices we apply on AWS and Azure projects, in roughly the order we recommend tackling them. It is written for CTOs, founders, and engineering leads who want to reduce spend without risking reliability.
Step 1: Make costs visible
You cannot reduce what you cannot see. Before changing anything:
- Tag every resource with at least the environment (production, staging, development), the product or service, and an owner. Enforce tagging with policies so untagged resources are flagged.
- Turn on cost reporting in AWS Cost Explorer or Azure Cost Management, grouped by tag and service.
- Set budgets and alerts at the account and project level, so unexpected increases are noticed in days, not at the end of the month.
- Assign ownership. Every significant cost line should have a person responsible for it.
Many teams find their first savings in this step alone, simply by discovering resources nobody knew were running.
Step 2: Remove waste
Look for resources that cost money and deliver nothing:
- Unattached storage volumes and old snapshots.
- Idle load balancers, unused public IP addresses, and forgotten NAT gateways.
- Development and test environments running around the clock.
- Old container images and log data retained indefinitely.
- Databases created for experiments and never deleted.
Schedule non-production environments to shut down outside working hours. Because a week has 168 hours and a working week has far fewer, scheduling can remove a large share of non-production compute cost. Use infrastructure as code so environments can be destroyed and recreated reliably instead of being left running "just in case".
Step 3: Right-size
Compare what each resource is provisioned for with what it actually uses. Instances running at low CPU and memory for weeks are candidates for a smaller size. Both AWS (Compute Optimizer) and Azure (Advisor) provide right-sizing recommendations based on utilisation.
Right-size carefully:
- Look at peaks as well as averages, over at least a few weeks.
- Change one thing at a time and watch performance and error metrics afterwards.
- Consider newer instance generations, which often deliver better performance per unit of cost, including ARM-based options such as AWS Graviton where your software supports it.
Databases deserve particular attention. A slow query fixed with an index is often a better answer than a larger database instance.
Step 4: Scale with demand
Fixed capacity sized for peak traffic wastes money the rest of the time. Use auto-scaling for stateless application servers and containers, so capacity follows demand. For workloads that run occasionally, such as scheduled jobs, webhooks, and image processing, serverless functions or container jobs charge only for the time they run.
Auto-scaling requires an application that is stateless and starts quickly, which is another reason to design for it from the beginning. Our article on SaaS architecture best practices covers this in more detail.
Step 5: Commit for steady workloads
Once usage is right-sized and predictable, commit to it. AWS Savings Plans and Reserved Instances, and Azure Reservations and Savings Plans, offer significant discounts compared with on-demand pricing in exchange for a one- or three-year commitment. Commit only to the baseline you are confident will remain, and leave variable demand on demand or spot capacity.
Spot instances (AWS) and spot virtual machines (Azure) offer spare capacity at deep discounts, with the catch that they can be reclaimed at short notice. They suit batch processing, CI runners, and fault-tolerant workloads, not single-instance production databases.
Check current pricing and discount terms on the providers' official pricing pages before committing, as they change over time.
Step 6: Optimise storage and data transfer
- Storage tiers. Move infrequently accessed data to cheaper tiers with lifecycle policies, for example S3 Infrequent Access or Glacier, or Azure Cool and Archive tiers.
- Log retention. Keep detailed logs for as long as you need them for debugging and compliance, then expire or archive them.
- Data transfer. Traffic leaving the cloud, and in some cases between regions or availability zones, is charged. Use a CDN for static assets and media, keep chatty services in the same zone where resilience allows, and review NAT gateway traffic, which is a common surprise.
- Images and assets. Serving compressed, correctly sized images in modern formats reduces bandwidth and makes the site faster.
Step 7: Choose managed services wisely
Managed databases, queues, and container platforms cost more per unit than running the software yourself, but they remove patching, backups, and failover work. For most small and medium teams, managed services are cheaper overall once engineering time is counted. Revisit the decision only when a service becomes a large share of the bill and you have the operational capacity to run the alternative well.
Step 8: Make it a habit
Cost optimisation is not a one-off project. Build it into normal work:
- Review the cost dashboard monthly with the engineering team.
- Include expected cost impact in architecture decisions and pull requests that add infrastructure.
- Track cost per customer or per transaction, not just the total, so growth and efficiency can be separated.
- Celebrate savings the same way you celebrate features.
This practice is often called FinOps: shared responsibility for cloud spending between engineering, finance, and product.
Cost per environment: a practical example
A typical small SaaS product has production, staging, and one or more development environments. A common pattern is for staging to be a full copy of production, with the same instance sizes, a multi-zone database, and the same number of containers, running all month. Staging rarely needs that. Smaller instances, a single-zone database, fewer replicas, and a schedule that switches it off at night and at weekends usually provide the same testing value at a fraction of the cost. Keep the configuration identical in shape to production, so deployments are tested realistically, but not in size.
Development environments can often be created on demand for a pull request and destroyed automatically when it is merged. That gives developers realistic environments without paying for them when nobody is using them.
What not to do
- Do not cut redundancy from production to save money without understanding the risk. A cheaper outage is not a saving.
- Do not buy long-term commitments before right-sizing, or you will lock in waste.
- Do not chase small savings that cost more engineering time than they save.
- Do not rely on one-time clean-ups. Without tagging, budgets, and ownership, waste returns.
A quick checklist
- Tag resources and set up cost reports, budgets, and alerts.
- Delete unused resources and schedule non-production environments.
- Right-size instances and databases using real utilisation data.
- Use auto-scaling and serverless where workloads vary.
- Commit to steady baseline usage with savings plans or reservations.
- Apply storage lifecycle policies and reduce data transfer.
- Review costs monthly and include them in design decisions.
How we can help
Alpha Infotech sets up and manages AWS and Azure infrastructure, CI/CD pipelines, containers, and monitoring for product teams in the USA, the UK, Canada, and Saudi Arabia. Our DevOps and cloud service includes cost reviews as part of ongoing work. Contact us if you would like a review of your current cloud setup.