Let's step back to the original issue of managing a web application that contains dynamic data. We have covered a few different patterns in this chapter that optimize the redundancy at the file level, from distributed filesystems, to master-slave replication, and finally through the S3 offload of uploaded data.
While all of these aim to solve the problem from an operational perspective, we have not touched heavily on optimization to the end user, which is arguably the most important factor. Some patterns introduce delay in retrieval, and discrepancies in the form of data not persisting through subsequent HTTP requests. The best optimization to the end user, and the easiest to demonstrate, is retrieval optimization. This could be done through a CDN as we have discussed earlier in some static data processing patterns, but that does not work well with dynamic data.
The problem with dynamic data and a CDN is delay through replication. CloudFront takes an arguably long amount...