Cache distribution pattern in a three-tier web architecture

Traditional web hosting architecture implements a standard three-tier web application model that separates the architecture into the presentation, application, and persistence layers. As shown in the following architecture diagram, caching is applied at the presentation, persistence, and application layers:

Cache distribution pattern architecture

One of the ways you can offload your web page is through caching. In caching patterns, your goal is to try to hit the backend as little as possible. You can write an application where you can cache images, JavaScript, or even full pages to provide a better experience for your users. As shown in the preceding diagram, caching is applied to the various layers of architecture:

  • Amazon Route 53 provides DNS services to simplify domain management and to help cache DNS-to-IP mapping.
  • Amazon S3 stores all static content such as high-resolution images and videos.
  • Amazon CloudFront provides edge caching for high-volume content. It also uses these cache-control headers to determine how frequently it needs to check the origin for an updated version of that file.
  • Amazon DynamoDB is used for session stores in which web applications cache to handle user sessions.
  • Elastic Load Balancing spreads traffic to web server Auto Scaling groups in this diagram.
  • Amazon ElastiCache provides caching services for the app, which removes the load from the database tier.

In general, you only cache static content; however, dynamic or unique content affects the performance of your application. Depending on the demand, you might still get some performance gain by caching the dynamic or unique content. Let's take a look at a more specific pattern.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.41.214