Architectually Resilient Environment Discovery Interview
security reliability performance cost optimization operational excellence

Cost Optimization

COST 1 Are you considering cost when you select AWS services for your solution?
  Amazon EC2, Amazon EBS, Amazon S3, etc. are “building-block” AWS services. Managed services such as Amazon RDS, Amazon DynamoDB, etc. are “higher level” AWS services. By selecting the appropriate building-blocks and managed services, you can optimize your architecture for cost. For example, using managed services, you can reduce or remove much of your administrative and operational overhead, freeing you to work on applications and business-related activities.  
Best practices:
  * Select Services for Cost Reduction. Analyze services to see which ones you can use to reduce cost.

  * Optimize for License Costs.

  * Optimize Using Serverless and Container-Based Approach. Use of AWS Lambda, Amazon S3 websites, Amazon DynamoDB, and Amazon ECS to reduce cost.

  * Optimize Using Appropriate Storage Solutions. Use the most cost- effective storage solution based on usage patterns (e.g., Amazon EBS cold storage, Amazon S3 Standard-Infrequent Access, Amazon Glacier, etc.).

  * Optimize Using Appropriate Databases. Use Amazon Relational Database Service (RDS) (Postgres, MySQL, SQL Server, Oracle Server) or Amazon DynamoDB (or other key-value stores, NoSQL alternatives) where it’s appropriate.

  * Optimize Using Other Application-Level Services. Use Amazon Simple Queue Service (SQS), Amazon Simple Notification Service (SNS), and Amazon Simple Email Service (SES) where appropriate.

COST 2 Have you sized your resources to meet your cost targets?
  Ensure that you choose the appropriate AWS resource size for the task at hand. AWS encourages the use of benchmarking assessments to ensure that the type you choose is optimized for its workload.  
Best practices:
  * Metrics Driven Resource Sizing. Leverage performance metrics to select the right size/type to optimize for cost. Appropriately provision throughput, sizing, and storage for services such as Amazon EC2, Amazon DynamoDB, Amazon EBS (provisioned IOPS), Amazon RDS, Amazon EMR, networking, etc.

COST 3 Have you selected the appropriate pricing model to meet your cost targets?
  Use the pricing model that is most appropriate for your workload to minimize expense. The optimal deployment could be fully On-Demand instances, a mix of On-Demand and Reserved Instances, or you might include Spot Instances, where applicable.  
Best practices:
  * Reserved Capacity and Commit Deals. Regularly analyze usage and purchase Reserved Instances accordingly (e.g. Amazon EC2, Amazon DynamoDB, Amazon S3, Amazon CloudFront, etc.).

  * Spot. Use Spot Instances (e.g. Spot block, fleet) for select workloads (e.g., batch, EMR, etc.).

  * Consider Region Cost Factor costs into region selection.

COST 4 How do you make sure your capacity matches but does not substantially exceed what you need?
  For an architecture that is balanced in terms of spend and performance, ensure that everything you pay for is used and avoid significantly underutilizing instances. A skewed utilization metric in either direction will have an adverse impact on your business in either operational costs (degraded performance due to over-utilization) or wasted AWS expenditures (due to over-provisioning).  
Best practices:
  * Demand-Based Approach. Use Auto Scaling to respond to variable demand.

  * Buffer-Based Approach. Buffer work (e.g. using Amazon Kinesis or Amazon Simple Queue Service (SQS)) to defer work until you have sufficient capacity to process it.

  * Time-based approach. Examples of a time-based approach include following the sun, turning off Development and Test instances over the weekend, following quarterly or annual schedules (e.g., Black Friday).

COST 5 Did you consider data-transfer charges when designing your architecture?
  Ensure that you monitor data-transfer charges so that you can make architectural decisions that might alleviate some of these costs. For example, if you are a content provider and have been serving content directly from an Amazon S3 bucket to your end users, you might be able to significantly reduce your costs if you push your content to the Amazon CloudFront content delivery network (CDN). Remember that a small yet effective architectural change can drastically reduce your operational costs.  
Best practices:
  * Optimize. Architect to optimize data transfer (application design, WAN acceleration, Multi-AZ, region selection, etc.).

  * CDN. Use a CDN where applicable.

  * AWS Direct Connect. Analyze the situation and use AWS Direct Connect where applicable.

COST 6 How are you monitoring usage and spending?
  Establish policies and procedures to monitor, control, and appropriately assign your costs. Leverage AWS-provided tools for visibility into who is using what— and at what cost. This will provide you with a deeper understanding of your business needs and your teams’ operations.  
Best practices:
  * Tag all resources. Tag all taggable resources to be able to correlate changes in your bill to changes in our infrastructure and usage.

  * Leverage Billing and Cost Management Tools. Have a standard process to load and interpret the Detailed Billing Reports or Cost Explorer. Monitor usage and spend regularly using Amazon CloudWatch or a third-party provider where applicable (examples: Cloudability, CloudCheckr, CloudHealth).

  * Notifications. Let key members of your team know if your spend moves outside of well-defined limits.

  * Finance Driven Charge Back/Show Back Method. Use this to allocate instances and resources to cost centers (e.g., using tagging).

COST 7 Do you decommission resources that you no longer need or stop resources that are temporarily not needed?
  Implement change control and resource management from project inception to end-of-life so that you can identify necessary process changes or enhancements where appropriate. Work with AWS Support for recommendations on how to optimize your project for your workload: for example, when to use Auto Scaling, AWS OpsWorks, AWS Data Pipeline, or the different Amazon EC2 provisioning approaches or review Trusted Advisor cost optimization recommendations.  
Best practices:
  * Automated. Design your system to gracefully handle resource termination as you identify and decommission non-critical or unrequired resources with low utilization.

  * Defined Process. Have a process in place to identify and decommission orphaned resources.

  * Trigger-Based Actions. Set alarms that cause automated actions to remediate or escalate issues.

COST 8 What access controls and procedures do you have in place to govern AWS usage?
  Establish policies and mechanisms to make sure that appropriate costs are incurred while objectives are achieved. By employing a checks-and-balances approach through tagging and IAM controls, you can innovate without overspending.  
Best practices:
  * Establish Groups and Roles (Example: Dev/Test/Prod). Use governance mechanisms to control who can spin up instances and resources in each group. (This applies to AWS services or third-party solutions.)
  * Track Project Lifecycle. Track, measure, and audit the lifecycle of projects, teams, and environments to avoid using and paying for unnecessary resources.

COST 9 How do you manage and/or consider the adoption of new services?
  As AWS releases new services and features, it is a best practice to review your existing architectural decisions to ensure they continue to be the most cost effective.  
Best practices:
  * Establish a Cost Optimization Function.

  * Review. Have a process for reviewing new services, resource types, and sizes. Re-run performance tests to evaluate any reduction in cost.

Source Information provided on this page is from the AWS Well-Architected Framework Document