Engineering Note
A feature can generate revenue and still quietly eat into your margins.
In a growing SaaS application, not every feature consumes infrastructure equally.
Think about a Rails application with:
- Customer dashboards
- File uploads and processing
- Background jobs
- Analytics and reporting
- Third-party API integrations
One feature may generate thousands of database queries.
Another may consume large amounts of S3 storage.
A third may keep Sidekiq workers busy throughout the day.
But when everything runs on shared AWS infrastructure, the monthly bill doesn't tell you which feature is responsible.
This is where cost tagging and attribution become important.
We can start by organising AWS resources using consistent tags:
Environment: Production / Staging
Service: Rails / Sidekiq / Analytics
Owner: Engineering / Platform
Workload: Reporting / File Processing / API
AWS Cost Explorer can then help identify spending patterns across tagged resources.
But there's another challenge.
What about shared RDS instances, load balancers and networking?
Tags alone won't give you feature-level costs.
For those, you need usage metrics and allocation rules.
For example:
- Database queries and execution time
- Background job processing time
- Storage consumed per customer
- API requests per feature
Important learning:
Cloud cost optimisation shouldn't start when the AWS bill becomes uncomfortable.
It should start when you design how infrastructure usage will be measured.
Because engineering teams need to understand not just what a feature costs to build, but what it costs to operate.
Think about a Rails application with:
- Customer dashboards
- File uploads and processing
- Background jobs
- Analytics and reporting
- Third-party API integrations
One feature may generate thousands of database queries.
Another may consume large amounts of S3 storage.
A third may keep Sidekiq workers busy throughout the day.
But when everything runs on shared AWS infrastructure, the monthly bill doesn't tell you which feature is responsible.
This is where cost tagging and attribution become important.
We can start by organising AWS resources using consistent tags:
Environment: Production / Staging
Service: Rails / Sidekiq / Analytics
Owner: Engineering / Platform
Workload: Reporting / File Processing / API
AWS Cost Explorer can then help identify spending patterns across tagged resources.
But there's another challenge.
What about shared RDS instances, load balancers and networking?
Tags alone won't give you feature-level costs.
For those, you need usage metrics and allocation rules.
For example:
- Database queries and execution time
- Background job processing time
- Storage consumed per customer
- API requests per feature
Important learning:
Cloud cost optimisation shouldn't start when the AWS bill becomes uncomfortable.
It should start when you design how infrastructure usage will be measured.
Because engineering teams need to understand not just what a feature costs to build, but what it costs to operate.