Book Image

Implementing Cloud Design Patterns for AWS

Book Image

Implementing Cloud Design Patterns for AWS

Overview of this book

Table of Contents (18 chapters)
Implementing Cloud Design Patterns for AWS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

URL rewriting pattern


In the spirit of utilizing previous patterns, as well as AWS-provided services, we might combine the previous examples, which allow uploading files into an instance, with S3 instead of using a shared filesystem such as NFS. One problem with the previous examples is that there exists a single point of failure.

In the clone server pattern, the slaves synchronize files from a non-redundant master instance. In the NFS sharing pattern, all of the instances use a filesystem provided by an instance that is non-redundant as well. From an operations standpoint this adds some theoretical failure points. Instead of pushing the files into these instances, we could use something like S3.

We would do this by rewriting requests for files on-the-fly using Apache's filter module or Nginx's proxy rewrite functionality. For this example, we will assume an Nginx configuration instead of Apache for ease of demonstration.

The PHP files in this chapter will look similar to those in the previous...