36
Running Your Startup on Amazon Web Services Alex Iskold Founder/CEO AdaptiveBlue Feature Writer ReadWriteWeb

How to run your startup on Amazon Web Services, by Alex Iskold

Embed Size (px)

DESCRIPTION

A detailed overview of the benefits and technology behind Amazon Web Services stack. The presentation discusses general and specific use cases for each web service.

Citation preview

Page 1: How to run your startup on Amazon Web Services, by Alex Iskold

Running Your Startup onAmazon Web Services

Alex IskoldFounder/CEO AdaptiveBlue

Feature Writer ReadWriteWeb

Page 2: How to run your startup on Amazon Web Services, by Alex Iskold

Amazon Web Services (AWS) -robust, scalable and affordable

infrastructure for cloud computing.

This session is about:

Page 3: How to run your startup on Amazon Web Services, by Alex Iskold

We will cover:

The Basics of Cloud Computing The Benefits of Using Amazon Web Services Amazon Web Services Stack How AdaptiveBlue is using AWS How you can get started using AWS

Page 4: How to run your startup on Amazon Web Services, by Alex Iskold

Basics of Cloud Computing

Page 5: How to run your startup on Amazon Web Services, by Alex Iskold

Basics of Cloud Computing

Scalable Hardware Layer

Page 6: How to run your startup on Amazon Web Services, by Alex Iskold

Basics of Cloud Computing

Scalable Hardware Layer

Software Infrastructure LayerGrid

ServiceStorageService

Queue Service

Page 7: How to run your startup on Amazon Web Services, by Alex Iskold

Example: Storage Service

StorageService

StorageService

StorageService

StorageService

New Server

The data is automaticallyre-partitioned/re-balanced totake advantage of the new server

Page 8: How to run your startup on Amazon Web Services, by Alex Iskold

5 Benefits of UsingAmazon Web Services

Page 9: How to run your startup on Amazon Web Services, by Alex Iskold

1. Pay-per use model

You are only charged for disk space,CPU time and bandwidth that you use.

Page 10: How to run your startup on Amazon Web Services, by Alex Iskold

2. Instant scalability

Your Service automaticallyscales on AWS stack.

Page 11: How to run your startup on Amazon Web Services, by Alex Iskold

3. Reliable/Redundant/Secure

Infrequent outages (so far).Data is redundant in the cloud.

All services have built-in security.

* Soon will add Comprehensive to the list.

Page 12: How to run your startup on Amazon Web Services, by Alex Iskold

4. Most services accessed via simpleREST/SOAP API

Libraries are available in all major languages.Minimal learning curve.

Page 13: How to run your startup on Amazon Web Services, by Alex Iskold

5. Amazon - Experience &Commitment

Amazon has been doing this for ~15 years. Company-wide commitment to AWS.

Page 14: How to run your startup on Amazon Web Services, by Alex Iskold

Amazon Web Services Stack

Page 15: How to run your startup on Amazon Web Services, by Alex Iskold

Simple DatabaseService (SimpleDB)

Elastic Cloud Service (EC2)

Simple StorageService (S3)

Simple QueueService (SQS)

Page 16: How to run your startup on Amazon Web Services, by Alex Iskold

Elastic Compute Cloud (EC2)

On-demand grid

Page 17: How to run your startup on Amazon Web Services, by Alex Iskold

EC2 in a Nutshell

MachineImage

(OS + Apps)

Usage:

• Create Machine Image• Deploy the image to S3• Start 1 or more instances• Use it as regular machine(s)

Main Options:

• Dynamic/Static IPS• Choose cores• Choose locations• Persistence via EBS

Page 18: How to run your startup on Amazon Web Services, by Alex Iskold

Sample EC2 Use CasesBatch Processing

All instances are configured with the same code. Each instance operates on a subset of data. Partitions are specified in configuration file.

Web Service

All instances are configured with the same code. One or more instances are configured as load balancers

(HAProxy for example). DNS Server distributes requests between load balancers.

Page 19: How to run your startup on Amazon Web Services, by Alex Iskold

EC2 vs. Web Hosting Company

Good

Instantly add new instances Full-control over the machines and choice of the environment Likely cheaper (but depends on your exact situation)

Bad

Need to put the images together and manage instances No dedicated technical support(but there is premium support and RightScale solutions)

Page 20: How to run your startup on Amazon Web Services, by Alex Iskold

Simple Storage Service (S3)

Large media and everything else storage.

Page 21: How to run your startup on Amazon Web Services, by Alex Iskold

S3 in a Nutshell

Client

Idea:

Put/Get objects into bucketsbased on unique keys.

Main Features:

• Public/Private access.• Support for large objects.

Amazon S3

Bucket 1 Bucket N…

Put object Get object

Page 22: How to run your startup on Amazon Web Services, by Alex Iskold

Sample S3 Use CasesImage/Video storage

Put your media once on S3 and then serve it up Reads are 10 times cheaper than writes!

Serialize your Java Objects

Define unique key based on the object attributes Write out binary serialized version to a stream Write bytes to S3 Read them back when needed

Page 23: How to run your startup on Amazon Web Services, by Alex Iskold

Simple Database Service (SimpleDB)

Basic database and indexing service

Page 24: How to run your startup on Amazon Web Services, by Alex Iskold

Simple DB in a Nutshell

Client

Idea:

Create flat database with auto-indexed tables.

Main Features:

• Each attribute is indexed.• Record structure is flexible.• Basic operators in queries• Supports sorting.

Simple DB DomainRecord 1

Put recordGet recordQuery records

Key1 Attributes: A1,A2…

Record NKey2 Attributes: A1,A2…

Page 25: How to run your startup on Amazon Web Services, by Alex Iskold

Sample SimpleDB Use Cases

Index Media files stored on S3

Use the same key as on S3 Write the record with each metadata element as attribute

Store flat objects

Use SimpleDB as a storage for non-nested data

Page 26: How to run your startup on Amazon Web Services, by Alex Iskold

Simple Queue Service (SQS)

Infinite Asynchronous Queue

Page 27: How to run your startup on Amazon Web Services, by Alex Iskold

SQS in a Nutshell

Writer

Idea:

Create an infinite asynchronous queue.

Main Features:

• Multiple queues• Upto 4K messages• Message Locking

SQS QueueMessage 1

SendMessage

ReceiveMessage

Message N

Reader

Page 28: How to run your startup on Amazon Web Services, by Alex Iskold

Sample SQS Use Cases

Twitter Friend Update

For each update generate a task to update friends Process updates in order

Publish/Subscribe

Post messages to the queue to inform multiple subscribers

Process Pipeline

Use different queues to put, for example, and order through a pipeline.

Page 29: How to run your startup on Amazon Web Services, by Alex Iskold

How AdaptiveBlue usesAmazon Web Services

Page 30: How to run your startup on Amazon Web Services, by Alex Iskold

AdaptiveBlue Overview

We develop browser enhancement technologies thatdeliver contextual relevant information into the usercurrent page:

1. What did your friends and other people think about it?

2. How popular is this book right now?

3. What are additional relevant links for this book?

Page 31: How to run your startup on Amazon Web Services, by Alex Iskold

AdaptiveBlue & AWSBackground

One of the first companies to use AWS Started with using S3 Now using S3, SimpleDB, EC2 and Commerce Service

Page 32: How to run your startup on Amazon Web Services, by Alex Iskold

AdaptiveBlue AWS Architecture

Web Browser 1 Web Browser N…

SimpleDB

EC2

S3

WS1

LB

WSn WS1

LB

WSn

Page 33: How to run your startup on Amazon Web Services, by Alex Iskold

AdaptiveBlue & AWS

On EC2: We are running web service and load balancers

On S3: We are storing XML representation of books, music,

movies, stocks, wines, etc. as well as XML of user profiles.

On SimpleDB: Records of interactions between users and things they are

looking at, liking or commenting. Records that map user ids to other services Records that map between our internal object keys and

URLs for this object around the web.

Page 34: How to run your startup on Amazon Web Services, by Alex Iskold

Noteworthy usage

We turn SimpleDB into relational database via redundancy.

We have person and object domains. Each time when the userinteracts with an object we write a record withUSERNAME/OBJECT_KEY pair into 2 domains - one objectdomain, one person domain.

This way we can instantly retrieve recent objects for a personand recent people for each object.

Page 35: How to run your startup on Amazon Web Services, by Alex Iskold

AdaptiveBlueRecommends AWS

We love Amazon Web Services and couldn’t have built AdaptiveBluewithout them.

Thanks to AWS we scale today to hundreds of thousands of users .

Amazon team has been nothing less than outstanding in supporting us andhelping us architect correct solutions.

We recommend AWS to everyone who asks, because we believe that itoffers unprecedented head start, scalability and savings.

Page 36: How to run your startup on Amazon Web Services, by Alex Iskold

Amazon Web Services Resources

All you need - basic info, gettingstarted, pricing, tutorials, code,

forums - all on AWS home page:

http://tinyurl.com/ynfsn6