AWS Partner Network (APN) Blog
Optimizing the Cost of Your SaaS Environment with the AWS Well-Architected SaaS Lens
By Kevin Mueller, Sr. Partner Solutions Architect – AWS SaaS Factory
By Oren Reuveni, Principal Partner Solutions Architect – AWS SaaS Factory
Capturing, managing, and analyzing costs is an essential part of any software-as-a-service (SaaS) business.
In a multi-tenant environment, where tenant loads are unpredictable and the profile and activity of tenants is changing all the time, it’s critical to understand how these tenants impact the cost footprint of your application.
Without a firm grasp on the cost profile of your SaaS environment, it will be difficult to assess the tiering and pricing models of your solution. In this post, we’ll explore how the Cost Optimization pillar of the AWS Well-Architected SaaS Lens identifies specific best practices that can help you improve the cost profile of a SaaS application.
The SaaS Lens Cost Optimization pillar extends the AWS Well-Architected Framework and focuses on the cost considerations associated with multi-tenant environments. This includes strategies that enable SaaS providers to measure the resource consumption of tenants and correlate this activity with infrastructure costs.
Cost Optimization in SaaS Environments
It’s often difficult to capture and analyze costs in multi-tenant SaaS environments. How tenants consume resources, how you’ve architected your SaaS solution, the AWS services you’re consuming—these factors can make it challenging to attribute specific cost consumption to individual tenants.
In order to create a cost profile of a SaaS solution, you must be able to determine how the cost of your environment is divided among the system’s components and tenants. As part of this effort, you often need to identify the unit metrics that represent the key performance indicators (KPIs) that best reflect and measure efficiencies of your system. The AWS blog post “What is a Unit Metric?” elaborates on this topic.
Our focus here will be on determining how to gather the metrics that will let us calculate cost-per-tenant. This cost data is valuable to engineering teams, and even more important to the business leaders watching out for the health and growth of you company.
You can leverage the unit metric as your system evolves from an initial minimum viable product (MVP) through general availability and beyond to shape architectural decisions, feature roadmaps, and pricing changes.
Correlating with billing data, meanwhile, can be challenging. Start small and iterate as you demonstrated value. The data is informative to multiple stakeholders and can shape your roadmap with tenant visibility. The focus should on creating a metering ability that reflects the general distribution and trend of tenant consumption, rather than focusing on metering every single consumed resource unit.
Having approximations of cost-per-tenant can provide early access to indicators about how your solution may need to evolve. Here are some examples of SaaS cost data points that could be valuable to engineers, operations teams, product owners and business leaders:
- Are tenants in the basic tier imposing higher costs than tenants in the premium tier?
- How do tenant consumption patterns change the cost profile of your environment?
- What is the cost of the resources that support this tenant?
- Which features cost more than others?
- Do we use the optimal pricing model and price offering for our tiers, usage, or features?
More references for how to implement metering SaaS environments can be found in the SaaS Lens whitepaper in the resources section under the Cost pillar section, or on our AWS SaaS Factory Insights Hub.
Cost Optimization Pillar
The SaaS Lens Cost Optimization pillar includes two questions. Each is accompanied by a short summary of the recommended practices for the topic. It includes a Required, Good, and Best set of practices, as well as reference to relevant content that’s related to the discussed topics.
Following is a high-level view of the scope and goals of each question. For more details, please refer to the Reliability pillar section in the SaaS Lens whitepaper and the AWS Well-Architected Tool. Guidance for improving your current posture can be found in the SaaS Lens Improvement Plan within the Well-Architected Tool.
SaaS COST1: How do you measure the resource consumption of individual tenants?
The first question focuses on the collection of metrics and creation of the consumption percentages. The goal is to attribute infrastructure consumption to the individual tenants of your system, and surface metrics that can be used to profile the activity and consumption patterns of tenants.
This enables you to gather enough insight to be able to approximate and calculate the infrastructure footprint of each tenant that is using your SaaS application.
The three best practices, as we graduate from Required to Best, enable you to go from a simple view of consumption to a detailed view that provides more granular insights.
These metrics can have a profound impact on the day-to-day operation of a SaaS business. They also play a direct role in shaping the overall business and architectural models of your SaaS offering.
- Approximate tenant consumption: A simple metric (for example, number of requests) is used to create an approximate allocation of consumption for each tenant. Manual processes are used to correlate this tenant allocation with your AWS bill to arrive at a rough estimate of the cost per tenant.
- Build a rich view of tenant consumption: The consumption of the application’s individual resources is metered and attributed to each tenant. This data is aggregated and used to create a detailed estimate of tenant consumption.
- Use tenant consumption insights to shape operational and architectural efficiency: Tenant consumption data is used to provide actionable insights to operational and architecture teams, enabling them to introduce policies and strategies that can analyze and improve the cost efficiency of a multi-tenant system.
SaaS COST2: How are you correlating tenant consumption with the costs of your infrastructure?
The second question takes the output from COST1 and applies this consumption percentage to your actual AWS cost. The goal is to correlate tenant consumption data with infrastructure costs to calculate the cost-per-tenant.
This provides your business and technology teams with an ongoing view of how tenant load and architecture choices are influencing the overall cost profile of your SaaS application.
The best practices follow the goal of the Well-Architected Framework’s Cost Optimization pillar to optimize over time.
- Manually aggregate and correlate consumption with costs: Tools are used to manually collect and aggregate cost data for a period. The data is summarized for services and manually correlated with a tenant consumption data to calculate a cost-per-tenant.
- Use automation to correlate tenant consumption with AWS costs: An automated mechanism acquires cost data from AWS or third-party tools, and correlates this data with tenant consumption allocations to determine the cost per tenant. The full automation of this experience enables more real-time assessment of cost trends.
In this post, we discussed the importance of the AWS Well-Architected SaaS Lens best practices for Cost Optimization and metering tenant consumption, aligning it with AWS resource usage, and calculating the cost-per-tenant.
These metrics are essential to the formulation of SaaS business and technical strategies. They also play a key role in shaping the operational and scaling experience of your SaaS environment.
The absence of this ability may cause lack of visibility of the actual activity of tenants. This can result in limited ability to align tenant consumption with resource usage, and make it difficult to make related decisions, particularly regarding the cost aspect. You should strive to get good understanding of this aspect from day one of running the SaaS solution.
This post is part of a series about the Well-Architected SaaS Lens:
Get Started with the Well-Architected SaaS Lens
The AWS Well-Architected SaaS Lens focuses on SaaS workloads and is intended to drive critical thinking for developing and operating SaaS solutions. Each question in the lens has a list of best practices, and each best practice has a list of improvement plans and provides guidance on how to implement them.
The lens can be applied to existing or new workloads. You can use it to improve existing applications, or gain better visibility into workloads used by the department or area.
The SaaS Lens is available in all regions where the AWS Well-Architected Tool is offered, as described in the AWS Regional Services List. There are no costs in using the Well-Architected Tool.
If you’re an AWS customer, you have the option of using an AWS Partner to help with conducting a review. To find these partners, explore AWS Well-Architected Partners and AWS SaaS Competency Partners.
About AWS SaaS Factory
AWS SaaS Factory helps organizations at any stage of the SaaS journey. Whether you’re looking to build new products, migrate existing applications, or optimize SaaS solutions on AWS, we can help. Visit the AWS SaaS Factory Insights Hub to discover more technical and business content and best practices.
SaaS builders are encouraged to reach out to their account representative to inquire about engagement models and to work with the AWS SaaS Factory team.
Sign up to stay informed about the latest SaaS on AWS news, resources, and events.