Skip to content
Pablo Rodriguez

Well Architected Framework Caching

Applying the AWS Well-Architected Framework Principles to Caching

Section titled “Applying the AWS Well-Architected Framework Principles to Caching”

AWS Well-Architected Framework Caching Best Practices

Section titled “AWS Well-Architected Framework Caching Best Practices”

The AWS Well-Architected Framework has six pillars, and each pillar includes best practices and a set of questions that you should consider when you architect cloud solutions.

As you make connections between the AWS Well-Architected Framework pillars and caching, consider your role as a cloud architect caching content and the need to know the following information:

  • When to cache content to improve performance and optimize cost
  • How to deal with stale content so that you can balance managing cost with having up-to-date data
  • Why to incorporate a CDN service as an in-memory caching strategy into your architecture designs

Implement Data Access Patterns That Utilize Caching

Section titled “Implement Data Access Patterns That Utilize Caching”

Key Steps:

  1. Identify candidates for caching: Databases, APIs and network services that could benefit from caching. Services that have heavy read workloads, have a high read-to-write ratio, or are expensive to scale are candidates.

  2. Identify appropriate caching strategy: Choose the caching strategy that best fits your access pattern.

  3. Configure cache invalidation strategy: Such as a time-to-live (TTL) for all data that balances freshness of data and reducing pressure on backend datastore.

  4. Monitor cache hit rate: Aim for 80% or higher. Lower values may indicate insufficient cache size or an access pattern that does not benefit from caching.

Storing data in a cache can improve read latency, read throughput, user experience, and overall efficiency, as well as reduce costs. Data caching can be one of the most effective strategies to improve your overall application performance and reduce burden on your underlying primary data sources.

CloudFront Implementation: CloudFront will typically serve cached content from an edge location until the content expires. You can control CloudFront caching behavior with a combination of:

  • CloudFront minimum TTL specifications
  • Maximum TTL specifications
  • Content versioning
  • Cache-control HTTP headers
  • CloudFront invalidation requests

ElastiCache Implementation: In-memory databases are used for applications that require real-time access to data, the lowest latency, and the highest throughput. ElastiCache is a fully managed in-memory data store that is compatible with Redis and Memcached.

Implement Strategies to Improve Query Performance in Data Store

Section titled “Implement Strategies to Improve Query Performance in Data Store”

Optimizing data and query performance results in more efficiency, lower cost, and improved user experience. Data optimization and query tuning are critical aspects of performance efficiency in a data store.

Unoptimized queries can result in greater resource usage and bottlenecks, which reduce the overall efficiency of a data store. One strategy to improve query performance is a distributed caching solution which will improve latency and reduce the number of database I/O operations.

Best Practice Approach: Foundations – Plan Your Network Topology

Section titled “Best Practice Approach: Foundations – Plan Your Network Topology”

Use Highly Available Network Connectivity for Your Workload Public Endpoints

Section titled “Use Highly Available Network Connectivity for Your Workload Public Endpoints”

It is critical to plan, build, and operationalize highly available network connectivity for your public endpoints. If your workload becomes unreachable due to a loss in connectivity, even if your workload is running and available, your customers will see your system as down.

CloudFront Solution: CloudFront provides an API for distributing content with low latency and high data transfer rates by serving requests through a network of edge locations around the world.

Benefits:

  • CDNs serve customers by serving content located or cached at a location near the user
  • Improves the availability of your application because the load for content is shifted away from your servers to CloudFront edge locations
  • Edge locations and Regional edge caches hold cached copies of your content close to your viewers
  • Results in quick retrieval and increases the reachability and availability of your workload
Reliability

CloudFront securely delivers content across the globe and improves application resiliency from DDoS attacks. Caching content by using CloudFront increases the reliability of your customers’ access to your application.

Best Practice Approach: Cost-Effective Resources - Plan for Data Transfer

Section titled “Best Practice Approach: Cost-Effective Resources - Plan for Data Transfer”

Gather requirements and perform data transfer modeling of the workload and each of its components. This identifies the lowest cost point for its current data transfer requirements.

Understand where the data transfer occurs in your workload, the cost of the transfer, and its associated benefit. You can use this information to make an informed decision to modify or accept the architectural decision.

Select Components to Optimize Data Transfer Cost

Section titled “Select Components to Optimize Data Transfer Cost”

Architecting for data transfer helps you minimize data transfer costs. By using the data transfer modeling, focus on where the largest data transfer costs are or where they would be if the workload usage changes.

Look for alternative architectures or additional components that remove or reduce the need for data transfer or lower its cost. This may involve using CDNs to locate data closer to users.

Implement Services to Reduce Data Transfer Costs

Section titled “Implement Services to Reduce Data Transfer Costs”

Edge Locations

Use edge locations or CDNs to deliver content to end users or build caching layers in front of your application servers or databases.

CloudFront Benefits

CloudFront caches data at edge locations across the world, which reduces the load on your resources and administrative effort to deliver content globally.

Security Savings Bundle

Can help you save up to 30 percent on your CloudFront usage if you plan to grow your usage over time.

Cost Optimization with Caching: One way to optimize costs with caching is by controlling how long content is cached. You can control CloudFront caching behavior with a combination of CloudFront minimum TTL specifications, maximum TTL specifications, content versioning, cache-control HTTP headers, and CloudFront invalidation requests.

  • Make selection choices based on data characteristics and available options
  • Implement caching patterns that match your workload’s access patterns
  • Monitor and optimize cache performance metrics
  • Use highly available network connectivity for your public endpoints
  • Implement redundancy through edge locations and Regional edge caches
  • Design for fault tolerance and automatic recovery
  • Implement services to reduce data transfer costs
  • Optimize caching strategies to balance cost and performance
  • Monitor and analyze data transfer patterns for cost optimization opportunities

Applying the AWS Well-Architected Framework principles to caching ensures that your caching strategy aligns with best practices for performance, reliability, security, cost optimization, operational excellence, and sustainability.