1. Trang chủ
  2. » Công Nghệ Thông Tin

OReilly programming amazon web services s3 EC2 SQS FPS and SimpleDB mar 2008 ISBN 0596515812

1,3K 130 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1.297
Dung lượng 4,31 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

This bookdemonstrates how developers working with small- to mid-sizedcompanies can take advantage of Amazon Web Services AWSsuch as the Simple Storage Service S3, Elastic Compute CloudEC

Trang 1

by James Murty

Publisher: O'Reilly Pub Date: March 15, 2008 Print ISBN-13: 978-0-59-651581-2 Pages: 600

Table of Contents | Index

Overview

Building on the success of its storefront and fulfillment services,Amazon now allows businesses to "rent" computing power, datastorage and bandwidth on its vast network platform This bookdemonstrates how developers working with small- to mid-sizedcompanies can take advantage of Amazon Web Services (AWS)such as the Simple Storage Service (S3), Elastic Compute Cloud(EC2), Simple Queue Service (SQS), Flexible Payments Service(FPS), and SimpleDB to build web-scale business applications.With AWS, Amazon offers a new paradigm for IT infrastructure:use what you need, as you need it, and pay as you go

Programming Web Services explains how you can access

Amazon's open APIs to store and run applications, rather thanspend precious time and resources building your own With thisbook, you'll learn all the technical details you need to:

Store and retrieve any amount of data using applicationservers, unlimited data storage, and bandwidth with theAmazon S3 service

Buy computing time using Amazon EC2's interface to

requisition machines, load them with an application

environment, manage access permissions, and run yourimage using as many or few systems as needed

Use Amazon's web-scale messaging infrastructure to storemessages as they travel between computers with Amazon

Trang 2

Leverage the Amazon FPS service to structure payment

instructions and allow the movement of money between anytwo entities, humans or computers

Create and store multiple data sets, query your data easily,and return the results using Amazon SimpleDB

Scale up or down at a moment's notice, using these

services to employ as much time and space as you need

Whether you're starting a new online business, need to ramp upexisting services, or require an offsite backup for your home,

Programming Web Services gives you the background and the

practical knowledge you need to start using AWS Other booksexplain how to build web services This book teaches businesseshow to take make use of existing services from an establishedtechnology leader

Trang 3

Section 1.4 Interfaces: REST and Query Versus SOAPChapter 2 Interacting with Amazon Web Services

Trang 5

Section 9.1 Messaging Simulator

Section 9.2 Distributed Application Services with BOTOSection 9.3 Automated Management of EC2 Instance Poolswith Lifeguard

Trang 6

Section A.4 Third-Party AWS Solutions

Appendix B AWS API Error Codes

Section B.1 S3: Simple Storage ServiceSection B.2 EC2: Elastic Compute CloudSection B.3 SQS: Simple Queue ServiceSection B.4 FPS: Flexible Payments ServiceSection B.5 SimpleDB

Colophon

Index

Trang 7

Copyright © 2008, James Murty All rights reserved

Printed in the United States of America

Published by O'Reilly Media, Inc., 1005 Gravenstein HighwayNorth, Sebastopol, CA 95472

O'Reilly books may be purchased for educational, business, orsales promotional use Online editions are also available for

most titles (http://safari.oreilly.com) For more information,contact our corporate/institutional sales department: (800)

Many of the designations uses by manufacturers and sellers todistinguish their products are claimed as trademarks Wherethose designations appear in this book, and O'Reilly Media, Inc.was aware of a trademark claim, the designations have beenprinted in caps or initial caps

While every precaution has been taken in the preparation of thisbook, the publisher and author assume no responsibility for

errors or omissions, or for damages resulting from the use ofthe information contained herein

Trang 8

For Bec

Trang 9

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 company's technologyplatform This suite includes a number of infrastructure servicesthat can augment or replace the traditional physical

infrastructure required by web applications These infrastructureservices 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 creditcard Best of all, with these services you pay only for what youuse Whether you are merely experimenting with the services orusing them as a platform for web applications serving

thousands of users, you rent only the infrastructure you needand only when you need it

These services offer a compelling alternative to building yourapplications on top of standard, physical hardware, becausethey can provide the scalable, reliable, and cost-effective

infrastructure components you need without the expense oreffort involved in managing your own hardware They give youthe freedom to concentrate on your application instead of thephysical platform it runs on They also significantly reduce theinitial investment required to build and offer a service, whilegiving you confidence that your application will be able to notonly survive any sudden attention it receives, but to grow andthrive in response By leaving the infrastructure management toAmazon, 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 beinglimited by their resources Jeff Bezos, the CEO of Amazon, hasfamously referred to IT infrastructure and its attendant setup,management, and expense headaches as "muck." In declaring

"We make muck so you don't have to," Bezos has offered to

Trang 10

In this chapter, we introduce Amazon's infrastructure

services and discuss the main advantages and

disadvantages of using online services to meet your

infrastructure needs To use Amazon's services effectively,you may have to adjust your mindset and expectations:things work differently in the cloud

Chapter 2

To interact with the Amazon Web Services, you will need acommunications library to create request messages that arestructured to be readable to the services, and authenticated

so that only you can access your protected data You willalso need to understand the response messages the

services return In this chapter, we describe how to

construct and interpret the HTTP messages used by

Trang 11

demonstrates exactly how to work with these messages

The remaining 11 chapters in the book focus on actually usingthe services through their API interfaces or by building on third-party libraries or services

We devote seven chapters to explaining the key concepts, datamodels, behavior, and APIs of Amazon's five infrastructure

services: S3, EC2, SQS, FPS, and SimpleDB These chaptersdescribe 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 Rubyand step-by-step guides to performing tasks with the API

operations You can use our sample code to follow along withthe interactive sessions in these chapters and as a starting

point for your own applications

For S3, EC2, and SQS, we have included additional chapters inwhich we guide you through the process of building fully

functional applications based on the services These applicationsserve as realistic examples of how to put the infrastructure

services to work In these chapters, we will demonstrate how touse them to perform common tasks, and we will show off some

of the many third-party libraries and tools that are available forthese services:

Trang 12

Chapter 5

How to use Amazon's Elastic Compute Cloud (EC2) servicefor online computing resources

Chapter 6

Learn how virtual Linux server instances operate in the EC2service and how to create your own instances, customized

to work exactly the way you want

Chapter 7

Use virtual servers to create an on-demand, secure VPN forprotecting your network traffic, or to host a web site

Trang 13

Chapter 10, Chapter 11, and Chapter 12

How to use Amazon's Flexible Payments Service (FPS) forfinancial transactions FPS is big and complicated enough toneed three chapters

Chapter 13

How to use Amazon's SimpleDB service as an online

database This chapter includes two simple examples thatdemonstrate how to load stock price data into your

database, and how to implement a local data cache to helpspeed up your SimpleDB applications

P.2 Ruby and Interactive Examples

We have written the vast majority of our example code in theRuby language Ruby has two powerful features that make itideally suited to our purposes in this book First, Ruby code islovely: it is concise, succinct, and relatively easy to follow, evenfor developers who are not familiar with the language Rubycode can be almost as brief as pseudo-code, and yet it is

entirely functional Second, Ruby is an interpreted languagethat allows you to write, rewrite, and run code in an interactivesession The code in this book was written to work with Rubyversions 1.8.6 and later

We will take advantage of Ruby's support for interactive

sessions as we build the service API implementations that willallow us to communicate with AWS services We will add

functionality piece by piece, communicating with the live service

at each step to test the newly implemented API operations Thisapproach allows us to show exactly how the services behave,

Trang 14

irb>

If you downloaded the sample code for this book from the

O'Reilly web site, you will be able to load the code modules byputting them in a directory in Ruby's load path, or the currentdirectory, and issuing the require command in your irb

session:

# Load the Ruby code file called 'AWS.rb'

irb> require 'AWS'

If you are typing Ruby code into files as you read through thisbook, you will load a code file in the same way initially, but youneed to use a different command to reload a file whose

contents have changed:

# Reload the changed Ruby code file 'AWS.rb'

irb> load 'AWS.rb'

Trang 15

Constant width

Indicates commands, options, variables, attributes, keys,functions, classes, methods, modules, properties,

Trang 16

This icon indicates a warning or caution

P.4 Using Code Examples

This book is here to help you get your job done In general, youmay use the code in this book in your programs and

documentation You do not need to contact us for permissionunless you are reproducing a significant portion of the code Forexample, writing a program that uses several chunks of codefrom this book does not require permission Selling or

distributing a CD-ROM of examples from O'Reilly books doesrequire permission Answering a question by citing this bookand quoting example code does not require permission

Incorporating a significant amount of example code from thisbook into your product's documentation does require

permission

We appreciate, but do not require, attribution An attributionusually includes the title, author, publisher, and ISBN For

example: "Programming Amazon Web Services: S3, EC2, SQS, FPS, and SimpleDB by James Murty Copyright 2008 James

Murty, 978-0-596-51581-2."

If you feel your use of code examples falls outside fair use orthe permission given here, feel free to contact us at

permissions@oreilly.com

P.5 Safari® Enabled

Trang 17

Please address comments and questions concerning this book tothe publisher:

http://www.oreilly.com/catalog/9780596515812

To comment or ask technical questions about this book, sendemail to:

bookquestions@oreilly.com

For more information about our books, conferences, ResourceCenters, and the O'Reilly Network, see our web site at:

Trang 18

P.7 Acknowledgments

This book would not have been possible without the help andexcellent advice given by my editor Michael Loukides

Many others contributed to this book directly or indirectly

Special thanks go to Lucas Carlson, Leonard Richardson,

Christopher Mylonas, and Jack Truong for their helpful feedback.The community of developers and Amazon staff in the AWS

Developer forums has been an invaluable resource for

researching the technical details of the Amazon Web Servicesand understanding how best to use them in the real world

To the extent that this book provides an accurate and usefulreference for developers or users of Amazon Web Services, Iowe a debt of gratitude to everyone mentioned above Any

faults, errors, or omissions in this book are my own

Trang 19

The World Wide Web has grown quickly over the last couple ofdecades to become an invaluable resource for communication,research, and entertainment The Web has also become an

open platform on which powerful services and applications can

be built by established companies and newcomers alike It is avery accessible platform that allows even small companies tocreate web applications and build a business without requiringthe backing of a large enterprise A person or group with someexpertise, some time, and a good enough idea can create a webapplication that competes with the offerings of larger

corporations—or even carves out an entirely new market Onthe Web, the size and marketing clout of a large corporationdoes not guarantee it a monopoly on the attention and

patronage of a global audience

The Web is full of opportunities for companies both large andsmall, but the smaller companies face a difficult problem:

infrastructure

Web applications that are popular and have thousands of usersrequire significant infrastructure to provide the high

performance and smooth experience that users demand

Industrial-strength infrastructure is very expensive to buy andmaintain, so smaller companies with fewer users are often

forced to do without Yet in today's world of web publicity flashstorms caused by sites such as Slashdot and Digg, the

difference between a web application serving a few dozen usersand serving thousands may be no more than a glowing articleand a few hours' time

Although this kind of attention may be exactly what you hopefor, unless you have invested heavily in infrastructure, your

application may not survive the onslaught On the other hand, ifyou spend too much money on servers, bandwidth, hosting, andthe management of all this infrastructure, there will be little left

to develop the application itself A dilemma facing many small

Trang 20

Amazon offers a new and compelling solution to this dilemma inthe form of infrastructure web services These services allowapplication developers to avoid altogether the burden of buyingand maintaining physical infrastructure by making it possible torent virtual infrastructure instead In this book we will show youhow you can build your applications on top of Amazon's servicesand effectively outsource your infrastructure

1.1 Amazon Web Services for

Infrastructure

In this book, we will examine four offerings from Amazon WebServices (AWS) that provide flexible and affordable

strength web applications

infrastructure components on which you can build industrial-Amazon Simple Storage Service: S3

Amazon Simple Storage Service (S3) offers secure onlinestorage space for any kind of data, providing an alternative

to building, maintaining, and backing-up your own storagesystems It makes your data accessible to any other

applications or individuals you allow from anywhere on theWeb There are no limits on how much data you can store inthe service, how long you can store it, or on how much

bandwidth you can use to transfer or publish it

S3 is a scalable, distributed system that stores your

information reliably across multiple Amazon data centers,and it is able to serve it quickly to massive audiences Itsstorage application programming interface (API) is

deliberately simple and makes no assumptions about thenature of the data you are storing This simplicity meansyou can maintain complete control over how your data is

Trang 21

Amazon Elastic Compute Cloud: EC2 (beta)

Amazon Elastic Compute Cloud (EC2) makes it possible torun multiple virtual Linux servers on demand, providing asmany computers as you need to process your data or runyour web application without having to purchase or rentphysical machines In EC2 you have full control over eachserver with root access to the operating system (the rootuser is the ultimate system administrator on Linux

machines), a configurable firewall to manage network

access, and the freedom to install any software you please.Once you have set up an EC2 server the way you like it, youcan save it permanently as a server image You can thenlaunch new servers from this image to create virtual

machines that are preconfigured and ready to do your

bidding

The EC2 service offers computing resources that are veryflexible You can run as many servers as you need for aslong as you need them, and you can shut them all downwhen they have served their purpose The service offers anAPI to start and stop server instances, apply access andnetworking permissions, and manage your server images.You manage each individual server using standard Linuxtools over a secure shell session

NOTE

At the time of this writing, the EC2 service is still in

beta This means that the service's features are stillevolving quickly, and there is an increased risk of

problems that may make the service unsuitable for

use in production systems

Trang 22

Amazon Simple Queue Service (SQS) delivers short

messages between any computers or systems with access

to the Internet, allowing the components of your distributedweb applications to communicate reliably without you

having to build or maintain your own messaging system.With SQS you can send an unlimited number of messagesvia an unlimited number of message queues, and you canconfigure the performance characteristics and access

permissions for each queue The service uses a messagelocking and timeout mechanism that helps prevent

messages from being delivered more than once, while stillensuring they will be delivered despite any component

failures or network dropouts

SQS is implemented as a distributed application within

Amazon Your messages are stored redundantly across

multiple servers and data centers The service's API allowsyou to send and receive messages, and to control their fulllife cycle

Flexible Payments Service: FPS (Beta)

Amazon Flexible Payments Service (FPS) transfers moneybetween individuals or companies that have Amazon

Payments accounts, allowing you to build applications thatprovide an online store or that implement a marketplacebetween customers and third-party vendors With FPS youcan make payments from traditional sources, such as creditcards and bank accounts, or from sources internal to

Amazon Payments accounts that have lower fees and aredesigned to make micro-payment transactions feasible

All transactions need to be authorized by everyone involved

in the transaction The parties involved can impose detailed

Trang 23

transactions can be performed, how much money can betransferred, and who can send and receive the funds

Customers interact with your FPS application through anAmazon Payments gateway using their Amazon.com

account Because the transactions are mediated by Amazon,your customers are not required to provide you with theirpersonal banking information, and you do not have the

maintain

SimpleDB is designed to minimize the complexity and

administrative overhead involved in managing your data Itdoes not require a pre-defined schema so you can alter the

Trang 24

to It indexes every piece of information you store so allyour queries run quickly And it stores your data securely,redundantly and safely within Amazon's network of datacenters

or how little you use the service There are no initial costs tojoin, no long-term subscription payments, and the usage feesare attractively low The services are highly scalable,

performing equally well in modest or massively demanding

usage scenarios This means that the applications built on themcan be similarly scalable and are able to grow rapidly at shortnotice without hitting limits imposed by insufficient

infrastructure One significant feature is that all the services aredesigned to be highly reliable and fault-tolerant: the servicesand data resources are distributed across multiple servers anddata centers within Amazon's infrastructure, and they are

store, you can associate your AWS membership with this

Trang 25

Create a new AWS account at the AWS home page

—http://www.aws.amazon.com This is where you can manageyour AWS account, sign up for services, view your service

access its API To sign up for a service, visit the home page forthat service and click on the button "Sign Up For This Web

Trang 26

Figure 1-2 Screenshot of the AWS Access Identifiers

page

Trang 27

You will be billed monthly for your usage of AWS, at which timeAmazon will automatically debit your usage fees from the creditcard associated with your AWS account All service charges andpayments are in U.S dollars.

Trang 28

The World Wide Web has grown quickly over the last couple ofdecades to become an invaluable resource for communication,research, and entertainment The Web has also become an

open platform on which powerful services and applications can

be built by established companies and newcomers alike It is avery accessible platform that allows even small companies tocreate web applications and build a business without requiringthe backing of a large enterprise A person or group with someexpertise, some time, and a good enough idea can create a webapplication that competes with the offerings of larger

corporations—or even carves out an entirely new market Onthe Web, the size and marketing clout of a large corporationdoes not guarantee it a monopoly on the attention and

patronage of a global audience

The Web is full of opportunities for companies both large andsmall, but the smaller companies face a difficult problem:

infrastructure

Web applications that are popular and have thousands of usersrequire significant infrastructure to provide the high

performance and smooth experience that users demand

Industrial-strength infrastructure is very expensive to buy andmaintain, so smaller companies with fewer users are often

forced to do without Yet in today's world of web publicity flashstorms caused by sites such as Slashdot and Digg, the

difference between a web application serving a few dozen usersand serving thousands may be no more than a glowing articleand a few hours' time

Although this kind of attention may be exactly what you hopefor, unless you have invested heavily in infrastructure, your

application may not survive the onslaught On the other hand, ifyou spend too much money on servers, bandwidth, hosting, andthe management of all this infrastructure, there will be little left

to develop the application itself A dilemma facing many small

Trang 29

Amazon offers a new and compelling solution to this dilemma inthe form of infrastructure web services These services allowapplication developers to avoid altogether the burden of buyingand maintaining physical infrastructure by making it possible torent virtual infrastructure instead In this book we will show youhow you can build your applications on top of Amazon's servicesand effectively outsource your infrastructure

1.1 Amazon Web Services for

Infrastructure

In this book, we will examine four offerings from Amazon WebServices (AWS) that provide flexible and affordable

strength web applications

infrastructure components on which you can build industrial-Amazon Simple Storage Service: S3

Amazon Simple Storage Service (S3) offers secure onlinestorage space for any kind of data, providing an alternative

to building, maintaining, and backing-up your own storagesystems It makes your data accessible to any other

applications or individuals you allow from anywhere on theWeb There are no limits on how much data you can store inthe service, how long you can store it, or on how much

bandwidth you can use to transfer or publish it

S3 is a scalable, distributed system that stores your

information reliably across multiple Amazon data centers,and it is able to serve it quickly to massive audiences Itsstorage application programming interface (API) is

deliberately simple and makes no assumptions about thenature of the data you are storing This simplicity meansyou can maintain complete control over how your data is

Trang 30

Amazon Elastic Compute Cloud: EC2 (beta)

Amazon Elastic Compute Cloud (EC2) makes it possible torun multiple virtual Linux servers on demand, providing asmany computers as you need to process your data or runyour web application without having to purchase or rentphysical machines In EC2 you have full control over eachserver with root access to the operating system (the rootuser is the ultimate system administrator on Linux

machines), a configurable firewall to manage network

access, and the freedom to install any software you please.Once you have set up an EC2 server the way you like it, youcan save it permanently as a server image You can thenlaunch new servers from this image to create virtual

machines that are preconfigured and ready to do your

bidding

The EC2 service offers computing resources that are veryflexible You can run as many servers as you need for aslong as you need them, and you can shut them all downwhen they have served their purpose The service offers anAPI to start and stop server instances, apply access andnetworking permissions, and manage your server images.You manage each individual server using standard Linuxtools over a secure shell session

NOTE

At the time of this writing, the EC2 service is still in

beta This means that the service's features are stillevolving quickly, and there is an increased risk of

problems that may make the service unsuitable for

use in production systems

Trang 31

Amazon Simple Queue Service (SQS) delivers short

messages between any computers or systems with access

to the Internet, allowing the components of your distributedweb applications to communicate reliably without you

having to build or maintain your own messaging system.With SQS you can send an unlimited number of messagesvia an unlimited number of message queues, and you canconfigure the performance characteristics and access

permissions for each queue The service uses a messagelocking and timeout mechanism that helps prevent

messages from being delivered more than once, while stillensuring they will be delivered despite any component

failures or network dropouts

SQS is implemented as a distributed application within

Amazon Your messages are stored redundantly across

multiple servers and data centers The service's API allowsyou to send and receive messages, and to control their fulllife cycle

Flexible Payments Service: FPS (Beta)

Amazon Flexible Payments Service (FPS) transfers moneybetween individuals or companies that have Amazon

Payments accounts, allowing you to build applications thatprovide an online store or that implement a marketplacebetween customers and third-party vendors With FPS youcan make payments from traditional sources, such as creditcards and bank accounts, or from sources internal to

Amazon Payments accounts that have lower fees and aredesigned to make micro-payment transactions feasible

All transactions need to be authorized by everyone involved

in the transaction The parties involved can impose detailed

Trang 32

transactions can be performed, how much money can betransferred, and who can send and receive the funds

Customers interact with your FPS application through anAmazon Payments gateway using their Amazon.com

account Because the transactions are mediated by Amazon,your customers are not required to provide you with theirpersonal banking information, and you do not have the

maintain

SimpleDB is designed to minimize the complexity and

administrative overhead involved in managing your data Itdoes not require a pre-defined schema so you can alter the

Trang 33

to It indexes every piece of information you store so allyour queries run quickly And it stores your data securely,redundantly and safely within Amazon's network of datacenters

or how little you use the service There are no initial costs tojoin, no long-term subscription payments, and the usage feesare attractively low The services are highly scalable,

performing equally well in modest or massively demanding

usage scenarios This means that the applications built on themcan be similarly scalable and are able to grow rapidly at shortnotice without hitting limits imposed by insufficient

infrastructure One significant feature is that all the services aredesigned to be highly reliable and fault-tolerant: the servicesand data resources are distributed across multiple servers anddata centers within Amazon's infrastructure, and they are

store, you can associate your AWS membership with this

Trang 34

Create a new AWS account at the AWS home page

—http://www.aws.amazon.com This is where you can manageyour AWS account, sign up for services, view your service

access its API To sign up for a service, visit the home page forthat service and click on the button "Sign Up For This Web

Trang 35

Figure 1-2 Screenshot of the AWS Access Identifiers

page

Trang 36

You will be billed monthly for your usage of AWS, at which timeAmazon will automatically debit your usage fees from the creditcard associated with your AWS account All service charges andpayments are in U.S dollars.

Trang 37

Before you start building applications based on AWS, it is

worthwhile to consider the thinking behind these services Whatwere the key goals that lead Amazon to build the services in thefirst place? And how did these goals influence the design andimplementation of the services?

Initially, the AWS infrastructure services were not conceived asproducts to be sold to developers external to Amazon but wereinstead designed to meet specific needs within Amazon's owninternal systems It was only later that these services were

opened up to the public The key implementation details of theservices are therefore intended primarily to serve Amazon'sneeds and will not necessarily use the methodologies or

techniques common in the rest of the industry Appreciating thereasoning behind the architectural decisions and their

implementation details can help you to adjust your expectationsfor the services This, in turn, will make it easier to design

applications that work well with the services' capabilities

Amazon's services are designed to power the Amazon.com website and related partner applications The services operate assmall component cogs in a large service-oriented architecture(SOA) Each service performs a specific task as simply and

efficiently as possible, while the strengths of many differentservices are combined as required to perform complex

processes and build the rich Amazon.com web pages with which

we are familiar Amazon's SOA has been developed over manyyears of hard-won experience to be highly scalable to meet

growing demand and be highly reliable despite the inevitablehardware and network failures that will occur in such an

environment

The AWS infrastructure services we will examine in this bookwere designed to fulfill specific tasks in this SOA environment.You will gain the most from the services with the fewest

headaches if you design your applications to work like

Trang 38

a system with the expectation that everything will work as

expected all the time, and that problems will be so rare that youcan deal with them as an afterthought, you need to accept fromthe start that failures will occur, and you should design yourapplication to deal with them For example, you should aim tobuild application components that can recover from temporarynetwork glitches, gracefully handle error conditions, and restartquickly Try to avoid creating architectural bottlenecks that aresingle points of failure Instead, share the work burden betweenmultiple components in a service pool that can be expanded orcontracted in response to demand, and ensure that each

component in the group can be easily replaced

With the right mindset, you can take full advantage of the AWSinfrastructure and build your own applications that, like

Amazon's, are scalable, reliable, and cheap to run If you do notembrace this chaotic and contingency-based approach, or if

your application simply does not fit this model, you may end upfighting the AWS infrastructure every step of the way

Trang 39

It should go without saying that the infrastructure services

provided by AWS will not be suitable for every circumstance orapplication There are a number of things you need to considercarefully before deciding whether a full or partial move to

Amazon's virtual infrastructure is appropriate in your situation

In this section we will briefly discuss some of the common

objections to making such a move and suggest counter-arguments to these objections Our aim is not to persuade youone way or another, but to raise the issues you need to considerbefore you make up your own mind

1.3.1 Web Services Are Dependent on a Reliable Network

The infrastructure provided by AWS is only available when youhave a working Internet connection and a clear network path tothe services It is vital to have a high-speed Internet

connection If you have an intermittent or slow connection tothe Internet, these services will not be a practical option Evenwith a fast connection, with the fragility of networking hardwareand the vagaries of Internet traffic routing, it is likely that

sooner or later you will be unable to reach AWS for a brief

period of time If your application is completely dependent onAWS, this could result in downtime for your application and

disruption for your customers With these kinds of issues, itmay not be possible for Amazon to help, especially if the

problem is caused by network resources outside its control

Amazon seeks to be resistant to traffic routing problems by

making its services accessible multiple data center locations.These data centers are generally located in the United States,though S3 is also available from data centers located in Europe.Overall, for any web-based resource, there is always the

possibility of losing connectivity, and you need to take this riskinto account when planning your application

Trang 40

to accept Even for groups or individuals without such strict

requirements, the lack of an SLA can be disquieting, becauseAmazon generally only promises "best-effort" service In

addition to this, the AWS Terms and Conditions agreement

permits the termination of AWS accounts at the sole discretion

of Amazon In legal terms, there does not seem to be a strongcommitment by Amazon to providing high-quality service toAWS customers

Looking at the AWS offering from a nonlegal perspective,

Ngày đăng: 26/03/2019, 17:06

TỪ KHÓA LIÊN QUAN