20,99 €
Everything you need to get running with IaaS for Amazon Web Services Modern businesses rely on Infrastructure-as-a-Service (IaaS)--a setup in which someone else foots the bill to create application environments--and developers are expected to know how to write both platform-specific and IaaS-supported applications. If you're a developer who writes desktop and web applications but have little-to-no experience with cloud development, this book is an essential tool in getting started in the IaaS environment with Amazon Web Services. In Amazon Web Services For Developers For Dummies, you'll quickly and easily get up to speed on which language or platform will work best to meet a specific need, how to work with management consoles, ways you'll interact with services at the command line, how to create applications with the AWS API, and so much more. * Assess development options to produce the kind of result that's actually needed * Use the simplest approach to accomplish any given task * Automate tasks using something as simple as the batch processing features offered by most platforms * Create example applications using JavaScript, Python, and R * Discover how to use the XML files that appear in the management console to fine tune your configuration Making sense of Amazon Web Services doesn't have to be as difficult as it seems--and this book shows you how.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 469
Veröffentlichungsjahr: 2017
AWS® For Developers For Dummies®
Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com
Copyright © 2017 by John Wiley & Sons, Inc., Hoboken, New Jersey
Media and software compilation copyright © 2017 by John Wiley & Sons, Inc. All rights reserved.
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. AWS is a registered trademark of Amazon Technologies, Inc. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit https://hub.wiley.com/community/support/dummies.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2017946597
ISBN: 978-1-119-37184-7
ISBN 978-1-119-37189-2 (ebk); ISBN ePDF 978-1-119-37186-1 (ebk)
Table of Contents
Cover
Introduction
About This Book
Foolish Assumptions
Icons Used in This Book
Beyond the Book
Where to Go from Here
Part 1: Discovering the AWS Development Environment
Chapter 1: Starting Your AWS Adventure
Defining the AWS Cloud
Discovering IaaS
Determining Why You Should Use AWS
Considering the AWS-Supported Platforms
Chapter 2: Obtaining Development Access to Amazon Web Services
Discovering the Limits of Free Services
Considering the Hardware Requirements
Getting Signed Up
Testing Your Setup
Chapter 3: Choosing the Right Services
Getting a Quick Overview of Free-Tier Services
Matching AWS Services to Your Application
Considering AWS Security Issues
Part 2: Starting the Development Process
Chapter 4: Considering AWS Communication Strategies
Defining the Major Communication Standards
Understanding How REST Works
Chapter 5: Creating a Development Environment
Choosing a Platform
Obtaining and Installing Python
Working with the Identity and Access Management Console
Installing the Command Line Interface Software
Configuring S3 Using CLI
Configuring S3 Using Node.js
Configuring S3 Using a Desktop Application
Chapter 6: Creating a Virtual Server Using EC2
Getting to Know the Elastic Compute Cloud (EC2)
Working with Elastic Block Store (EBS) Volumes
Discovering Images and Instances
Part 3: Performing Basic Development Tasks
Chapter 7: Understanding AWS Input/Output
Considering the Input/Output Options
Working with JSON
Working with XML
Working with Amazon API Gateway
Chapter 8: Developing Web Apps Using Elastic Beanstalk
Considering Elastic Beanstalk (EB) Features
Deploying an EB Application
Updating an EB Application
Removing Unneeded Applications
Monitoring Your Application Using Amazon CloudWatch
Chapter 9: Developing Batch Processes and Scripts
Considering the Batch-Processing and Script Options
Performing Batch Processing Locally
Developing Scripts
Using Scripts Locally
Interacting with aws-shell
Chapter 10: Responding to Events with Lambda
Considering the Lambda Features
Starting the Lambda Console
Creating a Basic Lambda Application
Interacting with Simple Queue Services (SQS)
Part 4: Interacting with Databases
Chapter 11: Getting Basic DBMS Using RDS
Considering the Relational Database Service (RDS) Features
Managing RDS
Creating a Database Server
Adding Support to Applications
Configuring Load Balancing and Scaling
Chapter 12: Programming Techniques for AWS and MySQL
Interacting with RDS
Working with MySQL Code
Working with the MySQL/RDS Tables
Performing Data Uploads
Performing Data Downloads
Chapter 13: Gaining NoSQL Access Using DynamoDB
Considering the DynamoDB Features
Downloading a Local Copy of DynamoDB
Creating a Basic DynamoDB Setup
Developing a Basic Database
Performing Queries
Part 5: The Part of Tens
Chapter 14: Ten Ways to Create AWS Applications Quickly
Working at the Console
Using Example Source Code
Combining Trial-and-Error Techniques
Watching the Videos
Attending the Webinars
Discovering Others Efforts
Depending on Peer Support
Working with Blogs
Using Alternative Sources
Going Back to Tutorials
Chapter 15: Ten AWS Tools Every Developer Needs
Obtaining Additional Amazon Offerings
Partnering with a Third Party
Developing New Knowledge
Using Bitnami Developer Tools-
Relying on Device Emulators
About the Author
Connect with Dummies
End User License Agreement
Cover
Table of Contents
Begin Reading
i
ii
iii
iv
v
vi
vii
viii
ix
1
2
3
4
5
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
73
74
75
76
77
78
79
80
81
82
83
84
85
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
373
374
With the availability of cloud-based resources, developers today have an unprecedented opportunity to create amazing applications that previously weren’t possible. Amazon Web Services (AWS) enables developers to interact with the entire world, even when their application supports the smallest of organizations. The access to services in the cloud is amazing enough, but the access to data and other resources is now at mind-boggling levels. Unfortunately, many developers are indeed overawed by the sheer size and scope of cloud-based development, which is why you need AWS For Developers For Dummies.
This book is about making things simple. You don’t have to try to understand the entire cloud or even just AWS in a single sitting; instead, AWS For Developers For Dummies breaks down all the concepts into smaller chunks. If you want to create imaginative applications, this books helps you do so without spending frustrating hours learning the arcane AWS API beforehand. Life is short. With this book, you can create an application in just a few hours and become productive more quickly, freeing you from the drudgery of learning quite a lot to do only a little.
The purpose of AWS For Developers For Dummies is to help you get up and running quickly. You build a test environment and install tools that let you experiment with many of the major services without a lot of effort. The focus of this book is to get you started doing something by using just a few of the services. One of the hardest parts of working with AWS is that so many services are available (more than 100 of them) that a developer might go nuts just trying to figure out where to begin. This book relieves you of that problem.
Most of the book examples focus on three kinds of AWS interaction: through the console, through the Command Line Interface (CLI), and programmatically. In most cases, these are the three ways developers begin working with AWS. The console lets you see how AWS works from an administrative level. Using CLI helps you understand the AWS functionality at a deeper level, plus you can use it to create scripts. Finally, this book uses Python Notebooks to make experimentation very easy. You don’t have to write complete applications to see something happen; just a few lines of code will do. So, in contrast to other programming projects, in which you spent hours writing code just to see the project die because of the smallest typo, this book helps you attain something significant without much typing at all.
To help you absorb the concepts, this book uses the following conventions:
Text that you’re meant to type just as it appears in the book is in
bold
. The exception is when you’re working through a step list: Because each step is bold, the text to type is not bold.
Words for you to type that are also in
italics
are meant as placeholders; you need to replace them with something that works for you. For example, if you see “Type
Your Name
and press Enter,” you need to replace
Your Name
with your actual name.
I also use
italics
for terms I define. This means that you don’t have to rely on other sources to provide the definitions you need.
Web addresses and programming code appear in
monofont
. If you’re reading a digital version of this book on a device connected to the Internet, you can click the live link to visit a website, like this:
http://www.dummies.com
.
When you need to click command sequences, you see them separated by a special arrow, like this: File ⇒ New File, which tells you to click File and then New File.
You might have a hard time believing that I’ve assumed anything about you — after all, I haven’t even met you yet! Although most assumptions are indeed foolish, I made certain assumptions to provide a starting point for the book.
The first assumption is that you’re familiar with the platform you want to use, because the book doesn’t offer any guidance in this regard. This book doesn’t discuss any platform-specific issues. You really do need to know how to install applications, use applications, and generally work with your chosen platform before you begin working with this book.
You also need to be familiar with your browser and understand how to interact with browser-based applications. Sprinkled throughout are numerous references to online material that can enhance your learning experience. In addition, most of the tasks you perform with AWS require that you work in your browser.
This book is largely platform independent. However, none of the procedures are tested using small mobile devices, such as a smartphone (and some are almost guaranteed not to work on a small device). Differences in appearance do emerge when using a smaller device; a control that appears as a button on a larger device may appear as a link or other control on a smaller device. You need access to the sort of setup that a developer will use to create and configure online applications, which means a larger tablet, notebook, or, better yet, a full desktop system. The various people who worked on this book used desktop systems running the Windows, Linux, and Mac OS X platforms and using a number of common browsers.
Because this is a book about application development, you also need to have some understanding of the development process. Knowledge of Python would be nice, but it’s not absolutely necessary because of the way the examples work. You may still need to spend some time with a Python tutorial to understand everything that the examples provide. In addition, you need to know how to work at the command prompt or terminal window. Many of the examples require that you manually type commands rather than work with a GUI. In fact, a few of the examples simply won’t work with a GUI because the options are unavailable. (These examples are clearly marked in the book.)
As you read this book, you encounter icons in the margins that indicate material of special interest (or not, as the case may be!). Here’s what the icons mean:
Tips are nice because they help you save time or perform some task without a lot of extra work. The tips in this book are time-saving techniques or pointers to resources that you should try so that you can get the maximum benefit when performing AWS-related tasks.
I don’t want to sound like an angry parent or some kind of maniac, but you should avoid doing anything that’s marked with a Warning icon. Otherwise, you might find that your configuration fails to work as expected, you get incorrect results from seemingly bulletproof processes, or (in the worst-case scenario) you lose data.
Whenever you see this icon, think advanced tip or technique. You might find these tidbits of useful information just too boring for words, or they could contain the solution you need to get an AWS service running. Skip these bits of information whenever you like.
If you don’t get anything else out of a particular chapter or section, remember the material marked by this icon. This text usually contains an essential process or a bit of information that you must know to work with AWS, or to perform cloud-based-setup tasks successfully.
This book isn’t the end of your AWS learning experience — it’s really just the beginning. I provide online content to make this book more flexible and better able to meet your needs. That way, as I receive email from you, I can address questions and tell you how updates to AWS or its associated add-ons affect book content. In fact, you gain access to these cool additions:
Cheat sheet:
You remember using crib notes in school to make a better mark on a test, don’t you? You do? Well, a cheat sheet is sort of like that. It provides you with some special notes about tasks that you can do with AWS that not every other person knows. To find the cheat sheet for this book, go to
www.dummies.com
and search for
AWS For Developers For Dummies Cheat Sheet.
On the page that appears, scroll down the page until your cursor turns the AWS For Developers For Dummies Cheat Sheet link blue; then click it. The cheat sheet contains really neat information such as figuring out which service you want to use.
Updates: Sometimes changes happen. For example, I might not have seen an upcoming change when I looked into my crystal ball during the writing of this book. In the past, this possibility simply meant that the book became outdated and less useful, but you can now find updates to the book at www.dummies.com.
In addition to these updates, check out the blog posts with answers to reader questions and demonstrations of useful book-related techniques at http://blog.johnmuellerbooks.com/.
Companion files:
Hey! Who really wants to type all the code in the book manually? Most readers prefer to spend their time actually working with Python, performing tasks using AWS, and seeing the interesting things they can do, rather than typing. Fortunately for you, the examples used in the book are available for download, so all you need to do is read the book to learn AWS usage techniques. To get the source code, go to
www.dummies.com
and search
AWS For Developers For Dummies
. Scroll down to the graphic of the book cover and click it. Click the More About This Book box that appears and then the Download tab to find the files.
It’s time to start your AWS adventure! If you’re completely new to AWS, you should start with Chapter 1 and progress through the book at a pace that allows you to absorb as much of the material as possible. Chapter 2 is especially important because it helps you understand what Amazon means by free-tier services. You should also read Chapter 3, even if you have experience with AWS, because it provides information about the services discussed in the book.
Readers who have some exposure to AWS must still work through the latter half of Chapter 2 because it shows how to obtain your developer key. After that, you can move directly to Chapter 4. You can always go back to earlier chapters as necessary when you have questions. However, you do need to understand how each technique works before moving to the next one. Every technique and procedure has important lessons for you, and you can miss vital content if you start skipping too much information.
Part 1
IN THIS PART …
Get started with Amazon Web Services (AWS).
Create a good AWS development environment.
Obtain your developer key.
Understand the AWS free tier.
Consider the security issues.
Chapter 1
IN THIS CHAPTER
Exploring the AWS cloud
Considering Infrastructure as a Service (IaaS)
Defining when, why, and how to use AWS
Ensuring you have a supported platform
There was a time when business development meant creating software for a single machine or for a workgroup. The client-server architecture, with its emphasis on both local and centralized servers, came next. Developers eventually started creating applications for the Internet as well, enabling people to do things like work from home without losing contact with the organization’s database. Browser-based applications actually appear on most desktops today, and you might spend much of your nondevelopment time using one.
As development has moved onward and outward, the tools, techniques, and processes for development have changed as well. Today you deal with the cloud, where the server that holds your application doesn’t even reside on the premises. In many respects, everyone is a remote user today. Of course, organizations have a huge investment in existing hardware and software, so you’re actually more likely to find yourself working in a hybrid environment with one foot on local resources and the other on someone else’s turf. Amazon Web Services (AWS) provides you with a complete development environment, but for many developers, the changes that using AWS require are significant and awkward. This chapter helps you better understand what to expect from AWS and to feel just a little less awkward about the coming changes.
You may also find yourself drowning in a sea of new abbreviations and acronyms. Of course, you can act like you know what all these terms mean, but they’re actually important terms, and knowing what they mean gives you an edge over everyone else. This chapter also helps you understand terms like Infrastructure as a Service (IaaS) and discover just what this new term means to you as a developer. If you already work on the Internet, you could possibly skip this part of the chapter, but if you’ve spent your career working with desktop applications or a local intranet, you definitely want to find out more.
Developers often find that the most frustrating part of creating an application is having the right tool. Development is more than knowing the right procedures and the right function calls — it’s a matter of knowing the most efficient manner in which to use them and determining when the tools already in use won’t do the job. This chapter closes with some essential information about the platforms that AWS supports. Reading this material will help you avoid some serious trouble later because you can avoid the most serious platform issues at the outset.
As a developer, you need to meet end-user demands with the least amount of effort and in the quickest time. Amazon Web Services (AWS) is a huge array of services that affects consumers, small to medium-sized businesses (SMB), and enterprises. Using AWS, you can do everything from creating applications for remote access to organization data to creating a full-fledged IT department in the cloud. The installed base is immense. You can find case studies of companies like Adobe and Netflix that use AWS at https://aws.amazon.com/solutions/case-studies/. (The page also includes a link to create an account, a topic discussed in Chapter 2.) AWS use isn’t just for private companies, either — even the government makes use of its services.
The technologies that make all these services possible are simple in conception. Think of a pair of tin cans attached to each other by a string. Amazon holds one tin can and you hold the other. By talking into one tin can, you can hear what is said at the other end. The implementation, however, relies on details that make communication harder than you might initially think. The following sections give you an overview on how the AWS cloud works.
Service-driven application architectures, sometimes known as Service-Oriented Architectures (SOA), come in many forms. No matter how you view them, service-driven application architectures are extensions of the client-server technologies that you may still use when creating localized applications, in that a client makes a request that a server fulfills by performing an action or sending a response.
The request/response implementation details have changed significantly over the years, however, making modern applications far more reliable, flexible, and less reliant on a specific network configuration. The request and response process can involve multiple levels of granularity, with the term microservice applied to the smallest request and response pairs. Developers often refer to an application that relies on a service-driven application architecture as a composite application because it exists as multiple pieces glued together to form a whole. Service-driven application architectures follow many specific patterns, but in general, they use the following sequence to perform communication tasks:
Create a request on the client using whatever message technology the server requires.
Package the request, adding security or other information as needed.
Send the request using a protocol, such as Simple Object Access Protocol (SOAP), or an architecture, such as REpresentational State Transfer (REST).
No matter what programming language you use, you need to know how to communicate with web services using your programming language of choice. The “Considering the AWS-Supported Platforms” section of this chapter helps you make a good decision about a language choice. You can discover how SOAP works at http://www.w3schools.com/xml/xml:soap.asp and how REST works at http://www.tutorialspoint.com/restful/. Knowledge of both is required when working with AWS as a developer.
Process the request on the server.
Perform an action or return data as required by the request.
When working with data, process the response on the client and present the results to the user (or other recipient).
AWS provides a service-driven application architecture in which you choose a specific service, such as Simple Storage Service (S3), to perform specific tasks, such as to store application data in a remote location. In many cases, you must perform setup steps in addition to simply interacting with the service. For example, if you look at the ten-minute tutorial at http://aws.amazon.com/getting-started/tutorials/backup-files-to-amazon-s3/, you find that you must first create a bucket to store the files you want to upload to Amazon. This additional step makes sense because you have to establish a location from which to retrieve the files later, and you don’t want your files mixed in with files from other people.
Even though many of the processes you perform with AWS require using an app (so that you have a user interface rather than code to work with), the underlying process is the same. The code provided in the app makes requests and then waits for a response. In some cases, the app must determine the success or failure of an action on the server. Rather than reinvent the wheel, a smart developer will use as many of these apps as possible to perform general configuration tasks. Using the AWS apps places the burden of updating the code on Amazon so that you can focus on custom tasks related to your organization.
Local applications require a certain level of interactivity between groups. A database administrator (DBA) may perform database setups before you can write code to interact with the data in that database. However, after the required individuals perform basic local setups, you may not interact with them as much as you do while creating your application code. Usually there is a flurry of activity during testing and again during deployment, but developers are often left alone to do their work otherwise because administrators in other areas give them the control needed to perform tasks.
Things work differently in the cloud. For example, you might find yourself performing some tasks normally associated with other disciplines, such as service configuration. This book helps you through the configuration tasks that developers normally do as part of working with AWS. In addition, you find tips about when you need to work with others to finish tasks. The level of interactivity between disciplines is much higher in the cloud because you have less control over the environment (you’re using someone else’s hardware and underlying software, after all). In addition, the cloud environment can become more complex than the test server setup that you may normally rely on for localized development.
In creating apps to help manage underlying services, AWS also defines workflows. A workflow is an organized method of accomplishing tasks. For example, when you want to save a file to AWS using S3, you must first create a bucket to hold the file. Only after you create a bucket can you save a file to AWS. In addition, you can’t retrieve a file from the bucket until you first save a file there, which makes sense because you can’t grab a file out of thin air. In short, a workflow defines a procedure for working with software, and the concept has been around for a long time. (The first workflows appeared in the mid-1970s with simple office automation prototypes at Xerox Parc and the University of Pennsylvania’s Wharton School of Business.)
Workflows can consist of additional workflows. In addition, workflows manage the interaction between users and underlying services. A process is the aggregation of services managed by workflows into a cohesive whole. The workflows may perform generic tasks, but processes tend to be specific and help users accomplish particular goals. A process-driven workflow is proactive and attempts to circumvent potential problems by
Spotting failure patterns and acting on them
Looking for trends that tend to lead to failures
Locating and extinguishing potential threats
In looking through the tutorials at http://aws.amazon.com/getting-started/tutorials/, you find that they all involve using some type of user interface. The user interface provides the workflow used to manage the underlying services. Each major tutorial step is a workflow that performs a specific task, such as creating a bucket. When you combine these individual workflows into an aggregate, the process can help a user perform tasks such as moving files between the cloud and the user’s system. Creating a cloud file system is an example of a process-driven workflow: The workflow exists to make the process viable. Workflows can become quite complex in large-scale operations, but viewing them helps you understand AWS better. You can find a more detailed discussion of workflows and processes at https://msdn.microsoft.com/library/bb833024.aspx.
A function is the reactive use of services managed by workflows to address specific problems in real time. Even though it would be nice if process-driven workflows worked all the time, the reality is that even with 99.999 percent reliability, the process will fail at some point, and a function-driven workflow must be in place to address that failure. Although process-driven workflows focus on flexible completion of tasks, function-driven workflows focus on procedurally attenuating the effect of a failure. In short, function-driven workflows address needs. The AWS services and workflows also deal with this issue through the user interface, such as by manually restoring a backup to mitigate a system failure.
As a developer, you find yourself involved in a number of tasks that may appear at first to fall outside the realm of development. Development in the cloud isn’t quite the same as development at the desktop or development of applications using a browser strategy. When working through development tasks with AWS, you find yourself performing these kinds of tasks in order to implement workflows:
Configuring the native functionality of AWS using wizards, AWS-driven scripts, or direct API calls through code
Modifying AWS-driven scripts as needed to accomplish specific goals in the least amount of time possible
Defining new configuration scenarios to meet workflow requirements by modifying underlying AWS configuration files, scripts, and code
Using AWS-supplied tools, such as lambda functions (see
https://aws.amazon.com/lambda/
), to perform tasks without resorting to hard coding
Developing applications that rely on API calls to perform tasks
Even though this book frequently refers to virtual environments and services that you can’t physically see, these elements all exist as part of a real computer environment that Amazon hosts on your behalf. You need to understand how these elements work to some extent because they have a physical presence and impact on your personal or business needs. Three technologies enable anyone to create a virtual computer center using AWS:
Infrastructure as a Service (IaaS):
A form of cloud computing that provides virtualized computing resources. You essentially use IaaS to replace physical resources, such as servers, with virtual resources hosted and managed by Amazon.
Software as a Service (SaaS):
A software distribution service that lets you use applications without actually having the applications installed locally. Another term used to describe this service is
software on demand
. The host, Amazon, maintains the software, provides the required licenses, and does all the other work needed to make the software available.
Platform as a Service (PaaS):
A
platform
provides a complete solution for running software in an integrated manner on a particular piece of hardware. For example, Windows is a particular kind of platform. The virtual platform provided by PaaS allows a customer to develop, run, and manage applications of all sorts.
The following sections provide an extended discussion of these three technologies and help you understand how they interact with each other. The point of these sections is that each element performs a different task, yet you need all three to create a complete solution.
The simplest way to view IaaS is as a means of providing access to virtualized computer resources over an Internet connection. IaaS acts as one of three methods of sharing resources over the Internet, alongside SaaS and PaaS. AWS supports IaaS by providing access to virtualized hardware, software, servers, storage, and other infrastructure components. In short, you can use IaaS to replace every physical element in your computing setup except those required to establish and maintain Internet connectivity and those required to provide nonvirtualized services (such as printing). The advantages of IaaS are many, but here are the ones that most people consider essential:
The host handles tasks such as system maintenance, backup, and resiliency planning.
A client can gain immediate access to additional resources when needed and then doesn’t need to worry about getting rid of them when the need has ended.
Detailed administrative tasks are handled by the host, but the client can manage overall administrative tasks, such as deciding how much capacity to use for a particular task.
Users have access to desktop virtualization, which means that their desktop appears on whatever device they happen to use at a given moment.
The use of policy-based services ensures that users must still adhere to company requirements when using computer resources.
All required updates (software and hardware) occur automatically and without any interaction required by the client.
Keep in mind that there is no free lunch. AWS and other IaaS providers are interested in making a profit. They do so by investing in huge quantities of hardware, software, and management personnel to oversee it all. The benefits of scale help create profit, and many businesses simply can’t create the setups they require for less money. However, you must consider the definite disadvantages of IaaS as well:
Billing can become complex because some services are billed at different rates and within different time frames. In addition, billing can include resource usage. The client must ensure that the amount on the bill actually matches real-world usage; paying too much for services that the client didn’t actually use can easily happen.
Systems-management monitoring becomes more difficult. The client loses control over the precise manner in which activities occur.
A lag often occurs between when a change in service is needed and when the host provides it, so the client can find that even though services are more flexible, they aren’t as responsive.
Host downtime can affect a large group of people and prove difficult to fix, which means that a particular client may experience downtime at the worst possible time without any means to resolve it.
Building and testing custom applications can become more difficult. Many experts recommend using in-house equipment for application-development needs to ensure that the environment is both protected and responsive.
IaaS service contracts vary a great deal between vendors. Even though this book focuses on AWS, you need to consider other offerings, including Windows Azure, Google Compute Engine, Rackspace Open Cloud, and IBM SmartCloud Enterprise. In some cases, you might actually find it useful to obtain services from multiple hosts to obtain the best service for a particular need.
SaaS is all about cloud-based applications. Products like online email and office suites are examples of cloud-based applications. A client typically accesses the application using a local application, such as a browser. The browser runs on local hardware, but the application runs on the host hardware. What a client sees is the application running in the browser as if it is working locally. In most cases, the application runs within a browser without any alteration to the local system. However, some applications do require the addition of plug-ins.
The difference between IaaS and SaaS is the level of service. When working with IaaS, a client typically requires detailed support that spans entire solutions. A SaaS solution may include only the application. However, it can also include the following:
Application runtimes
Data access
Middleware
Operating system support
Virtualization
Server access
Data storage
Networking
SaaS typically keeps the host completely in control and doesn’t offer any sort of monitoring. Even though the host keeps the application updated and ensures data security, the client company administrators typically can’t access SaaS solutions in any meaningful way. (SaaS offers application usage, but not necessarily application configuration, and is therefore not as flexible as other alternatives.) In addition, the client company typically accepts the application as is, without any modifications or customizations. Using client-developed applications is out of the question in this scenario.
PaaS is more of a development solution than a production environment solution. A development team typically uses PaaS to create custom solutions or modify existing solutions. The development staff has full control over the application and can perform all development-related tasks, such as debugging and testing. As with the SaaS solution, the host normally maintains control over
Middleware
Operating system support
Virtualization
Server access
Data storage
Networking
In this case, however, the development staff can access the middleware to enhance application development without reinventing the wheel. Writing application code to make the application cloud-ready isn’t necessary because the middleware already contains these features. The development team gains access to cloud-based application features that include the following:
Scalability
High availability
Multitenancy
SaaS enablement
Administrators can also perform monitoring and management tasks within limits when working with a PaaS (depending on the contract the client has with the host). However, realize that PaaS is oriented toward development needs, so the developer takes precedence when it comes to performing some tasks that an administrator might normally perform. In addition, PaaS relates to development, not production setups, so the host may take care of all administration tasks locally.
Even though AWS has a lot to offer, you still need to consider how it answers your specific needs. This consideration goes beyond simply determining whether you really want to move to cloud-based services, but also takes into account other offerings that might serve your needs just as well (if not better). Even though this book is about AWS, you should compare AWS with other cloud services. You may choose to use AWS as part of your solution rather than as the only solution. Of course, this means knowing the areas in which AWS excels. The following sections address both of these possibilities: using cloud services other than AWS, or in addition to it.
You have many ways to compare cloud services. One of the ways in which companies commonly look at services is by the market share they have. A large market share tends to ensure that the cloud service will be around for a long time and that many people find its services both useful and functional. A recent InfoWorld article (http://www.infoworld.com/article/3065842/cloud-computing/beyond-aws-the-clouds-next-stage.html) points out that AWS currently corners 70 to 80 percent of the cloud market. In addition, AWS revenues keep increasing, which lets Amazon continue adding new features while maintaining existing features at peak efficiency.
The cloud services marketplace continues to change at a frantic pace, so you need to keep up-to-date on the various offerings that each provider supplies. In addition, you need to track pricing and other factors that affect your application development process. Your application development needs also change over time, which means that the services you use today may not meet your needs tomorrow. In short, don’t assume that the choices you make are fixed.
Large market share and capital to invest don’t necessarily add up to a cloud service that fulfills your needs. You also need to know that the host can provide the products you need in a form that you can use. The AWS product list appears at http://aws.amazon.com/products/. It includes all the major IaaS, SaaS, and PaaS categories. However, you should compare these products to the major AWS competitors:
Cisco Metapod (
http://www.cisco.com/c/en/us/products/cloud-systems-management/metapod/index.html
)
Google Cloud Platform (
https://cloud.google.com/products/
)
Joyent (
https://www.joyent.com/
)
Microsoft Azure (
https://azure.microsoft.com/
)
Of the competitors listed here, Google Cloud Platform comes closest to offering the same feature set found in AWS. However, in looking at the Google offerings, you should note the prominence of machine learning services that aren’t found in AWS. On the other hand, AWS has more to offer in the way of the Internet of Things (IoT), applications, and mobile services.
Each of the vendors offering these services is different. For example, Joyent offers a simple setup that may appeal more strongly to an SMB that has only a few needs to address and no desire to become involved in a complex service. Microsoft, on the other hand, has strong SQL database-management support as well as the connection with the Windows platform that businesses may want to maintain. The point is that you must look at each of the vendors to determine who can best meet your needs (although, as previously stated, most people are voting with their dollars on AWS).
In looking at the services that AWS provides, you can see that the emphasis is on enterprise productivity. For example, Google Cloud Platform offers four enhanced machine learning services that you could use for analysis purposes, but AWS offers only one. However, Google Cloud Platform can’t match AWS when it comes to mobile service, which is an area that users most definitely want included for accessing applications. Unless your business is heavily involved in analysis tasks, the offerings that AWS provides are significantly better in many ways. Here are the service categories that AWS offers:
Compute
Storage and content delivery
Database
Networking
Analytics
Enterprise applications
Mobile services
IoT
Developer tools
Management tools
Security and identity
Application services
Theoretically, you could create just about any kind of application imaginable using AWS. The difference isn’t in what tasks the application would execute or how the application would manage data — these issues are the same as when working at the desktop. What you need to consider is where the application would execute, which means understanding the capabilities of the underlying cloud environment in order to determine which applications that environment will support. You can divide AWS application types into these areas:
End-user applications that the user accesses directly using a browser.
End-user applications that currently execute within a browser but are augmented by background calls to AWS.
End-user applications that currently execute on the desktop but are augmented by background calls to AWS.
Management applications that interact directly with AWS.
Web-service applications that react to calls from a remote application.
Web-service applications that use a polled publish/subscribe model.
Web-service applications that use a push publish/subscribe model.
You can come up with other application types. This list gives you an idea of what’s possible. The main point is that you still need to know something about the underlying environment. For example, if you want to create browser-based applications, you might rely on the Elastic Beanstalk service, which provides support for these default platforms:
Apache Tomcat for Java applications
Apache HTTP Server for PHP applications
Apache HTTP Server for Python applications
Nginx or Apache HTTP Server for Node.js applications
Passenger or Puma for Ruby applications
Microsoft IIS 7.5, 8.0, and 8.5 for .NET applications
Java SE
Docker
Go
Consequently, the app types that AWS supports best is partly determined by the service that you use and which features you add to that service. However, just as you can extend Elastic Beanstalk to support other languages, you can also modify how the other services work as well. Extending a service necessarily means being able to run other app types. The bottom line is that you need to consider these issues:
Determining which service meets your app needs best directly out of the package.
Defining which service features you need to make the app run as well as, if not better than, the same app when run locally.
Expanding the service as needed to meet custom requirements.
Obtaining third-party package support as needed to allow data and other resources access.
Considering the need to modify application functionality to ensure full service in the cloud environment.
Don’t get the idea, however, that creating an app in the cloud is precisely the same as creating an app on your local system or within a browser environment. The cloud does present challenges (as described throughout the book). For example, when working with the cloud, you must consider latency issues that you might not need to consider when running the app in other environments. After all, you’re still running the app across the Internet. You might also experience outages beyond your control (see the article at http://www.infoworld.com/article/3176098/cloud-computing/aws-outage-proves-one-cloud-isnt-enough.html for details on an 11-hour AWS outage that affected nearly half the Internet). If you have an app that is so critical that it can never go down, you may need to revisit the local data center or rely on multiple cloud products, which means coordinating the feature set of those products, thereby limiting your ability to leverage the flexibility offered by a specific cloud product.
If you haven’t dealt with the cloud yet, you might be tempted to think of platforms as a specific combination of items. For example, when viewing your own local setup, you have a server that runs a specific operating system and has a specific set of hardware resources. The system has a specific Database Management System (DBMS) installed and relies on certain kinds of other software to provide end-user resources. The development platform is specific, too. You use a particular language with a predefined set of libraries to code application in just one way. The cloud doesn’t work this way. When working with the cloud, you have an array of operating systems that can support any of a number of DBMSs and has access to a wide assortment of end-user resource products.
Even the development environment is different. You can code at several different levels, as described in the “Considering the app types that AWS supports best” section, earlier in this chapter. In fact, when using the AWS Lambda service (https://aws.amazon.com/lambda/), you don’t really consider platform or resources in the conventional sense at all. What you’re most interested in is a process for obtaining a particular result given a certain bit of data regardless of the source or output. The environment no longer really matters; what does matter is the process and the result obtained from the process.
With all these caveats and differences in mind, the question becomes one of determining the best way to use particular services rather than what functionality you have available. The following sections give you a quick overview of how to obtain more information about AWS support for specific platform features, given a particular service.
AWS is all about the services. You can see these services divided into categories at https://aws.amazon.com/. A category exists for every need. In just looking at the broad assortment of categories shown in Figure 1-1, you could get overwhelmed quite quickly.
FIGURE 1-1: AWS Services break down into individual categories.
The problem becomes even more obvious when you open one of the categories. For example, Figure 1-2 shows the Compute category, which is the first place you should go to discover what you can access in the way of development platforms.
FIGURE 1-2: Each category has a listing of services that it supports.
To perform most tasks, you create an EC2 virtual server. Drilling down into the EC2 virtual server information, you find a wealth of instance types from which to choose, a few of which fall into the free tier of services. The instance types define things like the number of CPUs, amount of memory, and type of storage supplied for your virtual server. You also need to consider the operating system, which means selecting between a Windows or Linux version, in this case.
An instance type differs from having real hardware in an important way. If you find that your real hardware isn’t supporting a need, you have to buy more physical hardware. Likewise, when the rush is over, you need to get rid of excess hardware. Using a virtual server means that you can change the configuration as needed, including the operating system used. Instead of having to physically reconfigure a setup, you simply define new characteristics for the setup, and AWS takes care of the low-level details for you.
The trade-off can come in the form of cost. When reconfiguration becomes too easy and people find that they can access nearly infinite resources, they tend to waste resources, and applications become less robust and efficient (good for Amazon; bad for your organization). In addition, the ease of changing a configuration can lead to all sorts of design issues and even infighting in the various developer groups. The rest of the book deals with other issues that crop up when using AWS for development; just be aware for now that you can’t always directly equate your localized or web-based development environment with the cloud-based development environment.
By now, you should have the idea that creating an appropriate platform isn’t a matter of finding a set of AWS features to meet your app needs. What it comes down to is finding the set of features that helps you code
With the least effort
In the shortest time
For the least amount of money
The whole issue of cost can become significant with AWS because you quickly find yourself paying all sorts of hidden fees for things that you didn’t know you needed or thought would be free. Although Chapters 2 and 3 do help with the cost considerations, this book doesn’t provide the full treatment of the topic that you can find in AWS For Admins For Dummies, by John Paul Mueller (Wiley 2016). However, you do get enough information to make smart decisions about building a development environment and using that environment to create applications (which obviously is the purpose of this book).
The best way to find an appropriate platform for your development needs is to start slowly, using one of the services at a time and adding services only as you need them, rather than trying to build a complete development environment at the outset. If you attempt to create a complete development environment, you’re almost certain to make serious mistakes with so many different services providing such a great amount of overlapping functionality. As previously mentioned, most developers start with an EC2 setup and possibly add the Lambda service to it to begin experimenting with AWS as a coding platform. AWS also provides access to the developer tools shown in Figure 1-3. The AWS Command Line Interface can prove extremely helpful in getting started with AWS because you get a feel for how things work in an interactive environment.
FIGURE 1-3: Amazon provides a wealth of developer tools to provide development support at a variety of levels.
Use the free-tier services (as outlined in Chapters 2 and 3) as much as possible at the beginning to reduce the cost of experimentation. Only when you see an actual need to modify your configuration to use paid services should you make the change. Relying on this approach will give you a better feel as to how to make your setup efficient and what you can actually expect in the way of performance using less capable setups.
Chapter 2
IN THIS CHAPTER
Considering the limits of the free services of AWS
Knowing what hardware you need to work with AWS
Obtaining your AWS developer account
Checking your setup