44
Cloud Hybrids and Heroku/EC2 Calculator Marat Zhanikeev [email protected] maratishe.github.io 2014/11/01 Cloudyiizuka

Hybrid Clouds: EC2/Heroku Calculator

Embed Size (px)

DESCRIPTION

Everybody knows heroku, right? Yes, the one that's built entirely on top of EC2. If you do not mind (1) higher price and (2) heroku design rules, then heroku is OK for you. However, there are cases when business migrates back to EC2 after some experience with heroku. This cloudy meeting will discuss a calculator that helps make decisions on heroku < > EC2 migrations.

Citation preview

Page 1: Hybrid Clouds: EC2/Heroku Calculator

Cloud Hybrids and

Heroku/EC2 Calculator

Marat Zhanikeev [email protected]

maratishe.github.io

2014/11/01

Cloudy@iizuka

Page 2: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

What is Cloud?

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 2/44...

2/44

Page 3: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Textbook Definitions

• SaaS: Software As A Service

• PaaS: Platform As A Service

• IaaS: Infrastructure As A Service

• ...

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 3/44...

3/44

Page 4: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Actual Clouds.Cloud is when.........any resouce can be converted into a cloud.

Cloud

• buildings: mostly datacenters (DCs)

• racks, desktops,smarthones: private-publiccloud hybrids

• cities: in frastructurevirtualization

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 4/44...

4/44

Page 5: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Actual Cloud Structure

• Tier 1: physical (buildings, DCs, etc.)• Tier 2: cloud platforms (Amazon ECs,etc.)

• Tier 3: cloud applications

• ...question: which one is heroku?

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 5/44...

5/44

Page 6: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

What is Cloud? Terminology.

Cloud

• cloudization: to convert somethingto a cloud-like usage

• cloudization = virtualization• virtualization = API• API = blackbox

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 6/44...

6/44

Page 7: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Cloud = APIs

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 7/44...

7/44

Page 8: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Anything Cloud is an API

• starting from physical tier, allfunctionality is exported as APIs

• heroku: mostly unknown... built 100%on top of EC2, which means it isnot Tier 2 but Tier 3

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 8/44...

8/44

Page 9: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Some common APIs

• XCP : top 1 popular cloud platform(Xen Cloud Platform)

• EC2 : Elastic Cloud 2 (EC2 = Virtual

Machine = VM)

• S3 : Storage 3 (Amazon Storage

Service)

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 9/44...

9/44

Page 10: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

git : Source Code Management

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 10/44...

10/44

Page 11: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

What is Source Version Management?

• source management=version management• a very important concept in software development• very helpful in multi-user/team environments

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 11/44...

11/44

Page 12: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

git vs **

• CVS : the oldest framework◦ very clumsy, the worst thing that it would create a .cvs folder everywhere in the

source tree

• SVN : relaced CVS, biggest change is web interface◦ got better, but one would still find .svn folder everywhere in the source tree

• GIT : the most popular tool today◦ creates .git folder only at root folder◦ very easy and intuitive commands like push and pull

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 12/44...

12/44

Page 13: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

git design

• repo=repository : a folder atserver side where the keep your stuff

• you can pull (download) and push(upload) your stuff

• development cycle: pull, edit/update/delete some files, then push

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 13/44...

13/44

Page 14: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

GitHub:the Most Popular Git Hosting

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 14/44...

14/44

Page 15: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

GitHub : A small Howto

• First, create a GitHub account (free)◦ to use it over ssh you need to register your public key online

• make a ne wrepository in your account

• work on source code that repo

• you can find commandline references online

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 15/44...

15/44

Page 16: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Cloud Hybrids

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 16/44...

16/44

Page 17: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

What are the Hybrids

• Today one gets 2 or more options, from different tiers, for any technology

• apps: heroku vs EC2 ← today

• storage: S3 vs Heroku Addon vs BigData storage

• Situation 1: select and use a combination of 2 options (hybrid)

• Situation 2: select one of two options for the same technology (migration)

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 17/44...

17/44

Page 18: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Specific EC2/Heroku Decision

• decision when making a new new app• heroku > EC2 migration

• EC2 > heroku migration

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 18/44...

18/44

Page 19: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC2/Heroku places in the Tiers

• you should remember which tiers EC2and heroku come from

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 19/44...

19/44

Page 20: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC2 Basics

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 20/44...

20/44

Page 21: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

AWS Console

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 21/44...

21/44

Page 22: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

AWS/EC2 Console

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 22/44...

22/44

Page 23: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC2 : New VM

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 23/44...

23/44

Page 24: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC2 : New VM Ready!

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 24/44...

24/44

Page 25: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC2 : Run a Web Server

1. Create a new VM in EC2 (you can create one in free account)

2. install PHP (simple mini server)◦ yum remove httpd-* php-*◦ yum install php54

3. in VM firewall open 8001 port for webrequests

4. on VM : create app1 folder and a simpleindex.php inside

5. php -S VM.IP:8001 -t app16. you can find IP via ifconfig

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 25/44...

25/44

Page 26: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC2 : Run Many Web Servers?

• use several ports (8001-800x?) createa web server (port, folder) on each

• why many servers? it is exactly thesame thing that heroku does on EC2VMs

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 26/44...

26/44

Page 27: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Heroku Basics

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 27/44...

27/44

Page 28: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Heroku (on top of EC2)

• heroku uses a container to isolate apps from eachother◦ 1 app = 1 container◦ isolation is not perfect

• how many? containers would you expect heroku tojam into 1 VM?

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 28/44...

28/44

Page 29: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

heroku = git repo

• now you get why we talked git earlier• on heroku, one deploys apps usinggit

• heroku git = sourcemanagement + deployment

• there is a separate heroku commandwhich one can use to manage scale andruntime performance

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 29/44...

29/44

Page 30: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

heroku vs EC2

• heroku app = web app• when heroku app runs, it is already a webserver

• sourcecode of heroku apps is (mostly) builtaround processing GET/POST requests

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 30/44...

30/44

Page 31: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

heroku : web and workers.heroku apps .....

.

are made from web and workerprocesses

• web : gets 1 port for receiving webrequests

• worker : has no incoming ports, butcan send traffic

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 31/44...

31/44

Page 32: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

heroku scale-out.scale out.....

.

... stands for increasingnumber of runninginstances whne necessary • user sets the scale

• heroku dynamically manages the scalebetween 1 and user setting

• in programming, many instances ofthe same app is not a trivialconcept to get used to

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 32/44...

32/44

Page 33: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

heroku scale-out

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 33/44...

33/44

Page 34: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

heroku : let's see a simple app

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 34/44...

34/44

Page 35: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC/Heroku Calculator

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 35/44...

35/44

Page 36: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC/Heroku : Formulation

• Situation 1: where to develop newapps

• Situation 2: when to migrateheroku > EC2

• Situation 3: when to migrate EC2> heroku

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 36/44...

36/44

Page 37: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Heroku Pricing

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 37/44...

37/44

Page 38: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

EC2 Pricing

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 38/44...

38/44

Page 39: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Several Pricing Considerations

1. pricing : diffs in the tables in two slides above

2. migration : does you app need to migrate instances, data, resouces...?

3. programming: is programming easy, conventional?

4. social (crowds): need to consider social structure of your user base?

5. data management : traditional data or need special structure of processing?

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 39/44...

39/44

Page 40: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Metromap of FeaturesAs Cheap

As Possible

MostlyStatic

HeavyProgramming

OK

Few Users

Unusual Data Design

pricing

migration

programming

social (crowds)

data management

CheaperBetter

Price Doesn’t Matter

MigratesOften

Near ZeroProgramming

Volatile User Base(Flash Crowds)

(always)Many Users

Common Data Structures

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 40/44...

40/44

Page 41: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Example: Viber

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 41/44...

41/44

Page 42: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

Viber in the MetromapAs Cheap

As Possible

MostlyStatic

HeavyProgramming

OK

Few Users

Unusual Data Design

pricing

migration

programming

social (crowds)

data management

CheaperBetter

Price Doesn’t Matter

MigratesOften

Near ZeroProgramming

Volatile User Base(Flash Crowds)

(always)Many Users

Common Data Structures

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 42/44...

42/44

Page 43: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

OK, Let's Discuss

• Imagine yourself a business (startup,small/big business, etc.)

• define your app as a new train line goingthrough available stations in themetromap

• it is best if you can present astraightforward (calculator) map fordecision-making

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 43/44...

43/44

Page 44: Hybrid Clouds: EC2/Heroku Calculator

.

maratishe.github.io

That’s all, thank you ...

M.Zhanikeev -- [email protected] Hybrid Clouds: EC2/Heroku Calculator -- bit.do/marat141101 44/44...

44/44