a crash course on aws for app developers

48
Preamble: Intro to Cloud Computing Presented by: Aater Suleman, PhD Bleeding Edge Web Meetup, Austin: May 28th, 2014

Upload: flux7

Post on 26-Jan-2015

106 views

Category:

Technology


1 download

DESCRIPTION

Talk give by Flux7's CEO, Aater Suleman, at the Bleeding Edge Web Meetup, Austin on May 28th 2014. The talk covers the following: 1. Quick introduction to Cloud Computing 2. Why AWS? How a traditional web-app can be run on AWS - the services and changes needed 3. A walk-through of AWS services 4. Web Developer Productivity 5. Lessons Learnt

TRANSCRIPT

Page 1: A Crash Course on AWS  for App Developers

Preamble: Intro to Cloud Computing

Presented by:Aater Suleman, PhD

Bleeding Edge Web Meetup, Austin: May 28th, 2014

Page 2: A Crash Course on AWS  for App Developers

Cloud Computing has turned computing into a Utility.

Changes to Computer Thinking - Stephen Fry Explains Cloud Computing -

A Must Watch!

Page 3: A Crash Course on AWS  for App Developers

Pay-per-use Dynamically scale processing, storage and

memory

No more guessing work on the hardware

requirements

Page 4: A Crash Course on AWS  for App Developers

Compliance Security Reliability Scalability

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

Page 5: A Crash Course on AWS  for App Developers

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

AWS Summit 2014

Page 7: A Crash Course on AWS  for App Developers

A Crash Course on AWS for App Developers

Page 8: A Crash Course on AWS  for App 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:

Page 9: A Crash Course on AWS  for App Developers

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

Quick Poll

HOW MANY?

Page 10: A Crash Course on AWS  for App Developers

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

Quick Poll

HOW MANY?

Page 11: A Crash Course on AWS  for App Developers

AWS (or any cloud) changes

How to architect?

How to develop?

How to manage?

Page 12: A Crash Course on AWS  for App Developers

Architecting for AWS

Page 13: A Crash Course on AWS  for App Developers

AWS Evolution in 3-steps

Page 14: A Crash Course on AWS  for App Developers

Sample Web-app

DB App Web

MemCache Varnish

Static storage DNS QueueNoSQL

DB

Page 15: A Crash Course on AWS  for App Developers

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

Page 16: A Crash Course on AWS  for App Developers

0. Get AWS servers and setup

DB App Web

MemCache Varnish

Static storage DNS QueueNoSQL

DB

Page 17: A Crash Course on AWS  for App Developers

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

Page 18: A Crash Course on AWS  for App Developers

1. Replace tiers with AWS Services

DB App Web

MemCache Varnish

Static storage DNS QueueNoSQL

DB

Queue

Page 19: A Crash Course on AWS  for App Developers

1. Replace tiers with AWS Services

DNS

App Web

DynamoDB SQS

RDS

Elasticache CloudFront

S3

Page 20: A Crash Course on AWS  for App Developers

Servers aka. Instances

Amazon EC2

AMIs aka. Images Volumes and Snapshots

Page 21: A Crash Course on AWS  for App Developers

Traditional DB as a service.

Amazon RDS

Page 22: A Crash Course on AWS  for App Developers

Fast

Geographically distributed

Ability to cache static and dynamic content

Amazon CloudFront

Caching layer (Think Varnish!)

Page 23: A Crash Course on AWS  for App Developers

In-memory caching tier for your application

Spin up with a single click and start using

Redis and Memcached are available

Amazon Elasticache

Page 24: A Crash Course on AWS  for App Developers

Object storage:

High Availability (99.99%)

High Durability (99.999999999%)

Fast

Amazon S3

Page 25: A Crash Course on AWS  for App Developers

Amazon DynamoDB

NoSQL DB as a service

Create a new Column-based NoSQL in minutes

Page 26: A Crash Course on AWS  for App Developers

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

Page 27: A Crash Course on AWS  for App Developers

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

Page 28: A Crash Course on AWS  for App Developers

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?

Page 29: A Crash Course on AWS  for App Developers

2. Secure

DNS

App Web

DynamoDB SQS

RDS

Elasticache CloudFront

S3

Page 30: A Crash Course on AWS  for App Developers

Security Groups

Security Group

VPC

Security Services

Page 31: A Crash Course on AWS  for App Developers

2. Secure

DNS

App Web

DynamoDB SQS

RDS

ElasticacheCloudFront

S3

VPC

Subnet

Subnet

Subnet

Subnet

Page 32: A Crash Course on AWS  for App Developers

3. Leverage Elasticity

DNS

AppWeb

DynamoDB SQS

RDS

ElasticacheCloudFront

S3

VPC

Subnet

Subnet

Subnet

Subnet

AppApp WebWeb

Page 33: A Crash Course on AWS  for App Developers

Auto-scaling Groups

Scaling Services

Elastic BeanStalk OpsWorks

Page 34: A Crash Course on AWS  for App Developers

Separate stateful services from stateless services

Do not rely on server IP addresses being fixed

Bake your server’s images

Auto-scaling Checklist

Page 35: A Crash Course on AWS  for App Developers

DB backup

Assets backup

Uptime of Web

Uptime of App

Uptime of DB

Uptime static hosting

Traffic spikes

DoS attacks

Security breaches

Worry List

Page 36: A Crash Course on AWS  for App Developers

DNS

AppWeb

DynamoDB SQS

RDS

ElasticacheCloudFront

S3

VPC

Subnet

Subnet

Subnet

Subnet

AppApp WebWeb

Page 37: A Crash Course on AWS  for App Developers

How to code?

Page 38: A Crash Course on AWS  for App Developers

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

Page 39: A Crash Course on AWS  for App Developers

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

Page 40: A Crash Course on AWS  for App Developers

How to code?

Developer Local Test QA Production

Least expensive but most executed

Most expensive but least executed

Page 41: A Crash Course on AWS  for App Developers

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

Page 42: A Crash Course on AWS  for App Developers

How to manage?

Page 43: A Crash Course on AWS  for App Developers

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?

Page 44: A Crash Course on AWS  for App Developers

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

Page 45: A Crash Course on AWS  for App Developers

How do I manage and patch my servers?

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

Page 46: A Crash Course on AWS  for App Developers

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.

Page 47: A Crash Course on AWS  for App Developers

Other Lessons

Configuration management

Setup CI/CD

Page 48: A Crash Course on AWS  for App Developers

Thank You!

Twitter: @Flux7Labs

Website: www.flux7.com