61

Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Embed Size (px)

DESCRIPTION

"Java For The Cloud" session at AlphaCSP's JavaEdge 2008 seminar

Citation preview

Page 1: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 2: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Clouds Over Java

© flickr.com/photos/thirnbeck

2

Page 3: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Agenda

• Introduction – The Missing Link

• Solutions Overview

• Drawbacks

• Resources and Links

• Demo!

3

Page 4: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 5: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Back to 1880

• You have built new

electric device

• You’ll probably will

have to build electric

generation system for

it…

5

Page 6: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Back to November 22, 2007

6

Page 7: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Back to November 22, 2007

• JavaEdge 2007 “Breaking The

Clustering Limits” session

• Data and computational grids overview

• Terracotta demo

• Easy – one computer!

7

Page 8: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

• So, you wrote your grid application

• Now you want to deploy it on TWO(!)

machines transparently

• You buy two machines to get fail-over

and some availability

8

“Main Server” “Fail Over”

Page 9: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

• Life’s good – your friends and family play with your application during the weekend

• Your application is kind of slow in those times

• You buy and dropin another box

• It’s easy forgrid application

9

“Main Server” “Fail Over” “Peak Hours”

Page 10: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

• You start to sale – SLA, concerned

customers, responsibility –

“production” peak times

• You can’t afford any slowdown!

• You buy a real grid

10

“Main Server” “Fail Over” “Peak Hours”“Peak Days”

Page 11: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

• Money comes in only to make more

money, it’s time to crazy

advertisement campaign!

• This creates a true hype

• You buy more

machines…

11

“Main Server” “Fail Over” “Peak Hours”“Peak Days” “New Ad Campaign Hype”

Page 12: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

…Two weeks after people start

complaining…

12

Page 13: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

• There are additional costs:

• Network with appropriate bandwidth

• Professional services

• Space

• Etc.

13

Page 14: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

Congratulations, you just built your

own electric plant

14

Page 15: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

• What happens when:

• There is no ad campaign?

• It’s not the peak days?

• It’s not the peak times?

• There is an economic crisis?

• In other words – most of the time?

• The whole bombastic setup is idle

15

Page 16: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Your Application In The Wild

• IDLE == WASTING MONEY

• The setup is idle most of the time

• It wasts A LOT of money

• It’s not only building

your own electric

generation system,

it’s using 10% of

its capacity!

16

Page 17: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Lo

ad

Time

Loss/Loss Situation

Actual Load HW Allocation

Prediction Problem

17

Service

loss

Money

loss

Page 18: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Things “as a Service”

• When you buy a new TV you connect it to electricity service

• That’s instead of buildingor buying or even rent a generator

• When you buy a new mobilephone you connect it to cellular service

• That’s instead of creating yourown communications network

18

Page 19: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Advantages “as a Service”

• Low entry barriers

• How much do you pay to get a SIM?

• No capital expenditure

• You pay only per use

• Massive scalability

• You can turn on all you electric devices, probably it won’t drain the provider’s electricity resources

• Self service

• Yeah, you can turn the TV set on by yourself, big boy

19

Page 20: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Computing as a Service

• Rent computational resources & IT

related capabilities over the Internet

(“The Cloud”)

• Only what you need

• Exactly when you need

• Pay per use

• That’s “Cloud Computing”

20

Page 21: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Cloud Computing

• Pay for what you use

• Use only what you need

• Get it via web UI and/or API

• Self Service

• Built on storage and computing

virtualization technologies

21

Page 22: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Cloud Computing

• Offers SLA

• Available world-wide

• All the customers throughout the world

get the same response time

• Gartner:“Cloud computing heralds an

evolution of business that is no less

influential than e-business”

22

Page 23: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Lo

ad

Time

React Fast & Pay Per Use

Actual Load HW Allocation Cloud Allocation

Prediction Problem

23

Page 24: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Gartner’s 2009 Strategic Technologies

1. Virtualization (#5 previously)

2. Cloud Computing (new)

3. Servers – Beyond Blades (#8 previously)

4. Web-oriented architectures (new)

5. Enterprise mashups (#6 previously)

6. Specialized Systems (new)

7. Social Software & Social Networking (#10 previously)

8. Unified Communications (#2 previously)

9. Business Intelligence (new)

10. Green IT (#1 previously)

24

Page 25: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

•Cloud computing is perfect for

crisis times

• No upfront

investments

• Time-To-Market

• Cost effective

• Fail cheap

25

“Crisis, crisis!” Slide

Page 26: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Agenda

• Introduction – The Missing Link

• Solutions Overview

• Drawbacks

• Resources and Links

• Demo!

26

Page 27: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 28: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Main Types

• Infrastructure as a Service

• Get your own instance with root access

• Amazon

• GoGrid

• AppNexus

• FlexiScale

• Microsoft Azure (not yet)

• Etc

28

Page 29: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Main Types

• Platform as a Service

• Deploy your application on providers’ platform

• Google Application Platform

• Sun’s Network.com & Project Caroline

• Microsoft Azure

• Force.com

• Etc

29

Page 30: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

What to run on IaaS?

• Clustering techniques:

• HTTP Session replication

• Tomcat, Jetty, etc.

• Shared/Clustered Database

• Install clustered DB

• Use service

30

Page 31: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Clustering Tools

• Java MapReduce implementation

• Distributed application server

• Java Spaces implementation

• Network Attached Memory

• Demo is on its way!

• Etc

31

Page 32: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 33: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

AWS – Amazon Web Services

• Collection of remote computing services

• Launched on July 2002

• Simple idea – rent its idle servers

• Implementation – Xen virtualization

• SLA

• Interfaces:

• SOAP and REST

33

Page 34: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Amazon S3 – Simple Storage Service

• Flat hierarchy (named buckets)

• ∞ number of 5 GB files

• CloudFront – content delivery service

• US, EU, Asia

• Price - $0.150 First 50 TB / month

• Interfaces:

• Web – S3Browse, S3Fox addon

• Java – JetS3t, Typica

34

Page 35: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Amazon SimpleDB (Public Beta)

• Query-oriented storage

• Limited to 1 TB

• Price

• $0.17 per GB-month

• Java interface – SimpleJPA

• Not really relational

35

Page 36: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Amazon SQS – Simple Queue Service

• ∞ number of queues

• ∞ number of text messages

• 8 kb each

• Price - $0.01 per 10,000 Requests

• Java interface - Typica

36

Page 37: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Amazon EC2 – Elastic Compute Cloud

• Boot Amazon Machine Image (AMI) on number of virtual instances

• Large number of preconfigured AMIs

• Linux and Windows

• Various machine types

• From 1.7GB RAM single-core to 15 GB RAM and 20 cores

• Availability zones

• US & EU

37

Page 38: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Amazon EC2 – Elastic Compute Cloud

• Elastic Block Store – storage cache

• Price - $0.10/hour for 1.7 GB RAM, 1

core, 160 GB HD

• Java Interface – Typica

• Management – CLI, IntelliJ and

ElasicFox addon

• Custom images support – AMI

(proprietary format)

38

Page 39: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Working With Typica

• Describe Images

39

• Open Connection

• Launch Instances

1 Jec2 ec2 = new Jec2(awsAccessKeyId, secretAccessKey);

1 List<String> params = new ArrayList<String>();

2 List<ImageDescription> images = ec2.describeImages(params);

3 log.info("Available Images");

4 for (ImageDescription img : images) {

5 if ("available".equals(img.getImageState())) {

6 log.info(describeImageAsString());

7 }

8 }

1 LaunchConfiguration config = new LaunchConfiguration(imageDescription.getImageId());

2 config.setKeyName(keyName);

3 config.setInstanceType(InstanceType.DEFAULT);

4 config.setSecurityGroup(asList("default"));

5 ReservationDescription reservationDescription = ec2.runInstances(config);

Page 40: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

ElasticFox

40

Page 41: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Amazon EC2 – Elastic Compute Cloud

• More to come:

• Load balancing

• Auto scaling

• Done already in Java by LifeGuard

• Cloud monitoring

• Management console

• The demo is on its way!

41

Page 42: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Compare!

Name OS JAPI Web UIOffline

Storage

Load

Balance

Custom

ImagesPrice

EC2 P P P

$0.10/hour for 1.7 GB

RAM, 1 core, 160 GB

HD

GoGrid P P P Oas AEC2, free inbound

traffic

AppNexus O O P P P$0.22/hour for 2.83GHz

server

FlexiScale SOAP P P P P£0.15/hour for 1.5GB

Ram, 1 Core

MS Azure O ? ? ? ?

42

Page 43: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 44: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Google App Engine

• Allows to run customer’s application on Google infrastructure

• Only Python is currently supported

• “Sandbox” version

• Other languages are on their way

• Free!

• 500 MB, 3 applications per user, bandwidth and queries limits

• Costs afterwards

44

Page 45: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Compare!

45

Compare!

Provider NameSupported Languages

Price Comments

Google App Engine Python Free

Network.com Any $1/hour not anymore

CarolineJava BC, Python,

Perl ? closed beta

Force.com Apex$25/month/us

erCRM

MS Azure .NET ? closed beta

Page 46: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

More To Come

• Yahoo Cloud Infrastructure

• Working on internal, thinking about

external

• Hadoop

• Dell Cloud Computing

• HP Adaptive Infrastructure as a

Service

46

Page 47: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Agenda

• Introduction – The Missing Link

• Solutions Overview

• Drawbacks

• Resources and Links

• Demo!

47

Page 48: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 49: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Drawbacks

• Price

• Get a used desktop & put it under your table

• Price predictability

• A lot of charges

• EC2 – 7 types of charges per server

• Security

• Your content is somewhere out there

49

Page 50: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Drawbacks

• Physical location

• You are in Israel, your customers are

in Israel, but they are served from US

• Another point of failure

• S3 Beta downtimes of hours on

February and July

• Not in your control

50

Page 51: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Drawbacks - Terms of Use

• Service termination

• Amazon – “for any reason”, “at any time” & “for no reason” too

• Content screening and filtering

• Google – “pre-screen, review, flag, filter, modify, refuse, or remove any or all Content from the Service“

• Amazon – prohibit “discriminatory based on race, sex, religion, nationality, disability, sexual orientation, or age”

51

Page 52: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Agenda

• Introduction – The Missing Link

• Solutions Overview

• Drawbacks

• Resources and Links

• Demo!

52

Page 53: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 54: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Resources &Links

• AlphaCSP –Your Java Experts!

• www.alphacsp.com

• This presentation

• www.javaedge.net

• The Cloud Portal

• http://cloudcomputing.qrimp.com

• Elastic Servers on Demand

• AMI Factory

• www.elasticserver.com

54

Page 55: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

The Demo Blog

55

Page 56: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

The Demo Resources &Links

• The demo blog

• javaedge2008-cloud-demo.blogspot.com

• Typica – Amazon WS Java API

• code.google.com/p/typica

• Lifeguard – Amazon EC2 Java pool

• code.google.com/p/lifeguard

• Programming Amazon Web Services Book (published in March 2008)

• On Amazon.

56

Page 57: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Agenda

• Introduction – The Missing Link

• Solutions Overview

• Resources and links

• Demo!

57

Page 58: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008
Page 59: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Terracotta Architecture

59

© terracotta.org

Page 60: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008

Shared Queue Example

60

Page 61: Java For The Cloud Presentation @ AlphaCSP's JavaEdge 2008