Supplemental files and examples for this book can be found at http://examples.oreilly.com/9780596515812/. Please use a standard desktop web browser to access these files, as they may not be accessible from all ereader devices.
All code files or examples referenced in the book will be available online. For physical books that ship with an accompanying disc, whenever possible, weve posted all CD/DVD content. Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to .
Preface
Amazon Web Services (AWS) is the name of a suite of web services made available by Amazon that allow third-party developers to access and build on the companys technology platform. This suite includes a number of infrastructure services that can augment or replace the traditional physical infrastructure required by web applications. These infrastructure services provide storage, computing power, a messaging system, a payment system, and a database that can be accessed by anyone with an Amazon.com account and a credit card. Best of all, with these services you pay only for what you use. Whether you are merely experimenting with the services or using them as a platform for web applications serving thousands of users, you rent only the infrastructure you need and only when you need it.
These services offer a compelling alternative to building your applications on top of standard, physical hardware, because they can provide the scalable, reliable, and cost-effective infrastructure components you need without the expense or effort involved in managing your own hardware. They give you the freedom to concentrate on your application instead of the physical platform it runs on. They also significantly reduce the initial investment required to build and offer a service, while giving you confidence that your application will be able to not only survive any sudden attention it receives, but to grow and thrive in response. By leaving the infrastructure management to Amazon, you can focus on developing your application and growing your business.
With the expense of infrastructure removed from the equation, anyone building web applications can compete and succeed based on their innovation, execution, and ideas instead of being limited by their resources. Jeff Bezos, the CEO of Amazon, has famously referred to IT infrastructure and its attendant setup, management, and expense headaches as muck. In declaring We make muck so you dont have to, Bezos has offered to handle the mucky, infrastructure side of web applications and allow the rest of us to focus on the interesting side. Perhaps you should take him up on the offer.
Whats in This Book?
In this book we explore the set of web services offered by Amazon that provide pay-as-you-go, virtual infrastructure, and we look at the practicalities of designing and building applications to take advantage of Amazons infrastructure services. We will provide detailed sample code that shows how to interact with the services application program interfaces (APIs), and we will discuss how the services can be used individually and in combination to build systems in the real world.
The first two chapters introduce the services we will use in this book and discuss how they work at the HTTP messaging level:
In this chapter, we introduce Amazons infrastructure services and discuss the main advantages and disadvantages of using online services to meet your infrastructure needs. To use Amazons services effectively, you may have to adjust your mindset and expectations: things work differently in the cloud.
To interact with the Amazon Web Services, you will need a communications library to create request messages that are structured to be readable to the services, and authenticated so that only you can access your protected data. You will also need to understand the response messages the services return. In this chapter, we describe how to construct and interpret the HTTP messages used by Amazons API interfaces. We will also provide code that demonstrates exactly how to work with these messages.
The remaining 11 chapters in the book focus on actually using the services through their API interfaces or by building on third-party libraries or services.
We devote seven chapters to explaining the key concepts, data models, behavior, and APIs of Amazons five infrastructure services: S3, EC2, SQS, FPS, and SimpleDB. These chapters describe the features and capabilities of each service and provide an overview of the operations exposed by the service. They also include client implementation code written in Ruby and step-by-step guides to performing tasks with the API operations. You can use our sample code to follow along with the interactive sessions in these chapters and as a starting point for your own applications.
For S3, EC2, and SQS, we have included additional chapters in which we guide you through the process of building fully functional applications based on the services. These applications serve as realistic examples of how to put the infrastructure services to work. In these chapters, we will demonstrate how to use them to perform common tasks, and we will show off some of the many third-party libraries and tools that are available for these services:
How to use Amazons Simple Storage Service (S3) for online data storage.
Use your online data storage space to share large files with others and back up your files. You can also access your storage as if it were a standard Linux block device, or you can create a mediated access system to grant others limited and well-controlled access to your own S3 storage.
How to use Amazons Elastic Compute Cloud (EC2) service for online computing resources.
Learn how virtual Linux server instances operate in the EC2 service and how to create your own instances, customized to work exactly the way you want.