Crash course on AWS for Web Developers

Post on 15-Jan-2015

166 views 2 download

Tags:

description

Crash Course on AWS for Web Developers Slides used at the Flux7 Webinar August 12th, 2014

Transcript of Crash course on AWS for Web Developers

Preamble: Intro to Cloud Computing

Presented by:Aater Suleman, PhD

Flux7 Webinar: August 12th, 2014

Cloud Computing has turned computing into a Utility.

Changes to Computer Thinking - Stephen Fry Explains Cloud Computing -

A Must Watch!

Pay-per-use Dynamically scale processing, storage and

memory

No more guessing work on the hardware

requirements

Compliance Security Reliability Scalability

is as a package available to any business - irrespective of its type and size!

“Friends don't let their friends build data centers”-Charles Phillips, CEO of Infor

AWS Summit 2014

A Crash Course on AWS for Web Developers

Who am I?Aater Suleman

Geek, Architect, Developer, Ops ⇒ DevOps Co-founder & CEO Flux7 Part-time UT Austin Professor

Flux7: Cloud and DevOps Solutions

Cloud and Devops for Web teamsEnterprise DevOps management

Clients:

★ Front-end HTML/JS developers★ Backend developers★ Operations folks ★ DevOps★ Managers/executives

Quick Poll

HOW MANY?

★ Enterprise ( > 1B in cap )★ Mid-tier ★ SMBs

Quick Poll

HOW MANY?

AWS (or any cloud) changes

How to architect?

How to develop?

How to manage?

Architecting for AWS

AWS Evolution in 3-steps

Sample Web-app

DB App Web

MemCache Varnish

Static storage DNS QueueNoSQL

DB

Worry List

DB backup

Assets backup

Uptime of Web

Uptime of App

Uptime of DB

Uptime of static hosting

Traffic spikes

DoS attacks

Security breaches

0. Get AWS servers and setup

DB App Web

MemCache Varnish

Static storage DNS QueueNoSQL

DB

DB backup

Assets backup

Uptime of Web

Uptime of App

Uptime of DB

Uptime of static hosting

Traffic spikes

DoS attacks

Security breaches

Worry List

1. Replace tiers with AWS Services

DB App Web

MemCache Varnish

Static storage DNS QueueNoSQL

DB

Queue

1. Replace tiers with AWS Services

DNS

App Web

DynamoDB SQS

RDS

Elasticache CloudFront

S3

Servers aka. Instances

Amazon EC2

AMIs aka. Images Volumes and Snapshots

Traditional DB as a service.

Amazon RDS

Fast

Geographically distributed

Ability to cache static and dynamic content

Amazon CloudFront

Caching layer (Think Varnish!)

In-memory caching tier for your application

Spin up with a single click and start using

Redis and Memcached are available

Amazon Elasticache

Object storage:

High Availability (99.99%)

High Durability (99.999999999%)

Fast

Amazon S3

Amazon DynamoDB

NoSQL DB as a service

Create a new Column-based NoSQL in minutes

Other Services

Route53 :

Amazon’s DNS servers

SNS :

For server-to-server and server-to-man communication

SQS :

On-demand queuing service

SWF :

Simple Workflow

DB backup

Assets backup

Uptime of Web

Uptime of App

Uptime of DB

Uptime of static hosting

Traffic spikes

DoS attacks

Security breaches

Worry List

Whether or not to replace a tier

What is the availability requirement?

Can i achieve the uptime using EC2 servers? Will it be cheaper?

Will I save in terms of code changes?

2. Secure

DNS

App Web

DynamoDB SQS

RDS

Elasticache CloudFront

S3

Security Groups

Security Group

VPC

Security Services

2. Secure

DNS

App Web

DynamoDB SQS

RDS

ElasticacheCloudFront

S3

VPC

Subnet

Subnet

Subnet

Subnet

3. Leverage Elasticity

DNS

AppWeb

DynamoDB SQS

RDS

ElasticacheCloudFront

S3

VPC

Subnet

Subnet

Subnet

Subnet

AppApp WebWeb

Auto-scaling Groups

Scaling Services

Elastic BeanStalk OpsWorks

Separate stateful services from stateless services

Do not rely on server IP addresses being fixed

Bake your server’s images

Auto-scaling Checklist

DB backup

Assets backup

Uptime of Web

Uptime of App

Uptime of DB

Uptime static hosting

Traffic spikes

DoS attacks

Security breaches

Worry List

DNS

AppWeb

DynamoDB SQS

RDS

ElasticacheCloudFront

S3

VPC

Subnet

Subnet

Subnet

Subnet

AppApp WebWeb

How to code?

New technologies are only valuable if you drop the rules that

were designed to overcome the issues with the old technology

Goldratt’s Questions about Technology

1. What is the power of new technology?

2. What current limitation or barrier does the new technology (or product) eliminate or vastly reduce?

3. What usage rules, patterns and behaviors exist today that consider the limitation?

4. What rules, patterns and behaviors need to be changed to get the benefits of the new technology?

5. What is the application of the new technology that will enable the above change without causing resistance?

6. How to build, capitalize and sustain the business?

Cattle, not pets!

Have numbers assigned

Are usually identical

Replaced when not in good health

You need more, you buy more

Has a personalized name

Unique, Special and Cared for

Taken care when ill

Src: Gavin McCance from CERN

Servers are cattle, don’t use IP addresses and host name in code

Use an existing service whenever possible

Don’t mix stateful and stateless services

Script application deployment or use configuration management

Setup local developer environments

Five Take Aways

CloudFormation

Infrastructure as code (can use version control)

Build AWS resources with one click

Push updates to the stack conveniently

How to code?

Developer Local Test QA Production

Least expensive but most executed

Most expensive but least executed

AppWeb

DB

LogStashMem

$

HTTP

SSH

Virtualbox VM

App Code and Logs

Laptop

devenv.sh for interacting with

the setup

Docker Containers

Redis

Src: Using Docker to Improve Web Developer Productivity

How to manage?

How to manage?

How to deploy code to an auto-scaling group?

How to configure the servers in this dynamic environment?

How to create/re-create environments on failure?

How to deploy code to an auto scaling group ?

Don’t deploy new code to a server

Make a new server and replace the old one with it

Read More on the 6 deployment methods here

How do I manage and patch my servers?

Don’t. Create deployment scripts and just create a new image

How to create/re-create environments on failure?

Automate the process of creating the entire environment using AWS CloudFormation templates.

Create a new environment with one click.

Other Lessons

Configuration management

Setup CI/CD

Thank You!

Twitter: @Flux7Labs

Blog: blog.flux7.com