Serverless Cost Monitoring Best Practices – Cost of Serverless Operation

AWS Certification Exam Microsoft Exams Serverless Cost Estimation

Serverless Cost Monitoring Best Practices

In this section you will learn how to monitor the cost of your serverless application and how to reduce that cost over time as your application evolves. Like serverless security, discussed in Chapter 4, optimizing serverless cost is not a one-time, pre-production activity. Cost optimization must be a continuous process that is part of the fabric of your team.

Creating Cost Awareness in a Serverless Team

The foundation for continuously optimizing cost over the lifetime of your serverless application is to make operational costs a primary concern of the team responsible for building and operating it. Cost should be discussed and considered at every stage of your application’s delivery lifecycle, from the design of its components to operation in production and retrospective analysis of billing (see Figure 9-4).

Figure 9-4. Serverless cost lifecycle

Cost-driven design

Cost estimates should be included in your solution designs (see the solution design template in Appendix C) when designing new features and applications. The engi‐ neers in your team should be aware of the pricing models of the services they use and the cost implications of their architectural decisions and trade-offs.

The architecture diagrams you draw as part of your solution design can be annotated with information pertaining to a cost estimate of the solution. This could include the configuration of a Lambda function or SQS queue and the prices of AWS API requests or resources. You can also include service quotas and resource limits that will support your operations (see Chapter 8). Figure 9-5 shows an example architec‐ ture diagram with cost and operations annotations.

Figure 9-5. Architecture diagram with cost estimates, pricing, and quotas

You build it, you pay for it

The DevOps movement was neatly captured in a phrase coined by Amazon CTO Dr. Werner Vogels in 2006: “You build it, you run it.” The same approach is now being applied to the financial operations related to software engineering. The emergent practice of FinOps is crucial to continued operational and cost efficiency. The cost of operating your application should be monitored in the same way as its performance and health.

Conducting regular AWS Well-Architected Framework reviews as a team, with a focus on the Cost Optimization pillar, can be an effective way of establishing cost awareness in your serverless team.

Leave a Reply

Your email address will not be published. Required fields are marked *