advertisement

The Future is Now: Leveraging the Cloud with Ruby

67 %
33 %
advertisement
Information about The Future is Now: Leveraging the Cloud with Ruby

Published on August 7, 2008

Author: robertdempsey

Source: slideshare.net

Description

My presentation from the Ruby Hoedown on cloud computing and how Ruby developers can take advantage of cloud services to build scalable web applications.
advertisement

 

The Future is Now Leveraging the Cloud with Ruby Robert Dempsey Atlantic Dominion Solutions

CEO, Atlantic Dominion Solutions Founder, Rails For All Chair, acts_as_conference Co-chair, doterati Membership BA, Computer Science, Rollins MBA Candidate 2009 CSM in-training Robert Dempsey

CEO, Atlantic Dominion Solutions

Founder, Rails For All

Chair, acts_as_conference

Co-chair, doterati Membership

BA, Computer Science, Rollins

MBA Candidate 2009

CSM in-training

I’m angry

Like mad cow angry

If I hear this one more time… Rails can’t scale

There will be trouble!

Ruby on Rails can scale… … if you understand how to scale it.

Rails MVC Architecture http://wiki.rubyonrails.org/rails/pages/UnderstandingRailsMVC

Rails MVC Overview http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/

 

Where the cloud comes in http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/

I want to… Not have to buy anything Not have to think about resources Servers Storage Easily scale my application

Not have to buy anything

Not have to think about resources

Servers

Storage

Easily scale my application

What is scalability? “…ability to either handle growing amounts of work in a graceful manner, or to be readily enlarged.” “…it can refer to the capability of a system to increase total throughput under an increased load when resources (typically hardware) are added.” http://en.wikipedia.org/wiki/Scalability

“…ability to either handle growing amounts of work in a graceful manner, or to be readily enlarged.”

“…it can refer to the capability of a system to increase total throughput under an increased load when resources (typically hardware) are added.”

Let’s add to that An application and the resources it uses grow as demand increases.

What I need… Servers Storage Access to other utilities Do it all without buying anything upfront Do it all with Ruby The cloud!

Servers

Storage

Access to other utilities

Do it all without buying anything upfront

Do it all with Ruby

The cloud!

Clusters High-availability (HA) Load-balancing (LB) Grids Life Before The Cloud

Clusters

High-availability (HA)

Load-balancing (LB)

Grids

High-availability cluster

Load balancing cluster

Grid

You can’t buy it on your personal credit card They are trying to sell you hardware There is no API You need to rearchitect your systems for it It takes more than 10 minutes to provision You need to specify the number of machines you want upfront You own all the hardware It’s not a cloud if… http://www.redmonk.com/jgovernor/2008/03/13/15-ways-to-tell-its-not-cloud-computing/

You can’t buy it on your personal credit card

They are trying to sell you hardware

There is no API

You need to rearchitect your systems for it

It takes more than 10 minutes to provision

You need to specify the number of machines you want upfront

You own all the hardware

Compute resources packaged as a utility Can use clusters and grids Pay-as-you-go model Examples Amazon Web Services - EC2, S3 HP Utility Computing Services Sun Microsystems’ Network.com Utility computing

Compute resources packaged as a utility

Can use clusters and grids

Pay-as-you-go model

Examples

Amazon Web Services - EC2, S3

HP Utility Computing Services

Sun Microsystems’ Network.com

Cloud computing, defined http://www.infoworld.com/article/08/04/07/15FE-cloud-computing-reality_1.html “ A way to increase capacity or add capabilities on the fly without investing in new infrastructure, training new personnel, or licensing new software.” - InfoWorld, April 2008

The cloud is all encompassing SaaS Utility computing Web services in the cloud Platform as a services (PaaS) Managed service providers (MSP) Service commerce platforms Internet integration

SaaS

Utility computing

Web services in the cloud

Platform as a services (PaaS)

Managed service providers (MSP)

Service commerce platforms

Internet integration

Why is this important? "By 2011, early technology adopters will forgo capital expenditures and instead purchase 40 percent of their IT infrastructure as a service. Increased high-speed bandwidth makes it practical to locate infrastructure at other sites and still receive the same response times. Enterprises believe that as service-oriented architecture (SOA) becomes common, 'cloud computing' will take off, thus untying applications from specific infrastructure.” - Gartner Group

No hardware to buy No infrastructure to support Add capability with minimal coding Advantages

No hardware to buy

No infrastructure to support

Add capability with minimal coding

Options and Pricing Standard EC2 Deployment Recommendations Code Wrap-up Agenda

Options and Pricing

Standard EC2 Deployment

Recommendations

Code

Wrap-up

Amazon Web Services Mor.ph RightScale Heroku Joyent Accelerator Vertebra – Engine Yard (Coming Soon) What do we have to work with?

Amazon Web Services

Mor.ph

RightScale

Heroku

Joyent Accelerator

Vertebra – Engine Yard (Coming Soon)

PoolParty Scalr ElasticRails WeoCEO DIY Clouds

PoolParty

Scalr

ElasticRails

WeoCEO

Amazon EC2 $0.10 - $0.80 / compute hour + transfer costs Amazon S3 $0.15 / GB + transfer costs Amazon SQS $0.01 / 10K requests + transfer costs Amazon SimpleDB $0.14 / machine hour + $1.50/GB/month storage + transfer costs Amazon Web Services

Amazon EC2

$0.10 - $0.80 / compute hour + transfer costs

Amazon S3

$0.15 / GB + transfer costs

Amazon SQS

$0.01 / 10K requests + transfer costs

Amazon SimpleDB

$0.14 / machine hour + $1.50/GB/month storage + transfer costs

Pros Pay-as-you-go Use one or many No infrastructure purchases Third-party service providers Cons Need to build reliability yourself Configuration overhead with EC2 Amazon Web Services

Pros

Pay-as-you-go

Use one or many

No infrastructure purchases

Third-party service providers

Cons

Need to build reliability yourself

Configuration overhead with EC2

Morph

Pros Pay-as-you-go 10 minutes sign-up to launch, near 0 configuration One click scaling Fully managed and backed-up, HW load balancing Migrations run on deploy Cons No SSH or file-level access Morph

Pros

Pay-as-you-go

10 minutes sign-up to launch, near 0 configuration

One click scaling

Fully managed and backed-up, HW load balancing

Migrations run on deploy

Cons

No SSH or file-level access

RightSite $2500 setup and $500/month RightGrid $2500 setup and $500/month RightScale Premium $2500 setup and $750/month AWS fees RightScale

RightSite

$2500 setup and $500/month

RightGrid

$2500 setup and $500/month

RightScale Premium

$2500 setup and $750/month

AWS fees

Pros Multitude of configuration options Scale-on-demand capability One-click multi-server deployments Manage everything AWS from single interface Cons Expensive A lot of up-front configuration RightScale

Pros

Multitude of configuration options

Scale-on-demand capability

One-click multi-server deployments

Manage everything AWS from single interface

Cons

Expensive

A lot of up-front configuration

Free (for now) Later Based on “work” Ask them ;) Heroku

Free (for now)

Later

Based on “work”

Ask them ;)

Pros Do everything via the browser Automatic scaling Work locally then deploy Cons Heroku.com domain name Choices are made for you Heroku

Pros

Do everything via the browser

Automatic scaling

Work locally then deploy

Cons

Heroku.com domain name

Choices are made for you

½ GiB $75/month 1/8 CPU, 512 MB RAM, 10 GB storage 1 GB $125/month ½ CPU, 1 GB RAM, 15 GB storage 2 GB $250/month 1 CPU, 2 GB RAM, 25GB storage Joyent Accelerator

½ GiB

$75/month

1/8 CPU, 512 MB RAM, 10 GB storage

1 GB

$125/month

½ CPU, 1 GB RAM, 15 GB storage

2 GB

$250/month

1 CPU, 2 GB RAM, 25GB storage

Pros Pay-as-you-go Solid hardware ZFS = scalable storage Cons Call in to scale your app OpenSolaris is fun Not really cloud computing Joyent Accelerator

Pros

Pay-as-you-go

Solid hardware

ZFS = scalable storage

Cons

Call in to scale your app

OpenSolaris is fun

Not really cloud computing

Free (Ruby gem) + AWS PoolParty

Free (Ruby gem) + AWS

Pros Easy configuration and deployment Highly configurable EC2 instances Cons Lacking documentation Supports only Ubuntu EC2 AMIs Not production ready (June 20) PoolParty

Pros

Easy configuration and deployment

Highly configurable EC2 instances

Cons

Lacking documentation

Supports only Ubuntu EC2 AMIs

Not production ready (June 20)

Free (Google code) + AWS $50/month + AWS Scalr

Free (Google code) + AWS

$50/month + AWS

Pros Free for base code Configurable auto-scaling of everything Configurable automatic db backups Cons Have to use their base AMI Scalr

Pros

Free for base code

Configurable auto-scaling of everything

Configurable automatic db backups

Cons

Have to use their base AMI

Free Community Edition + AWS $10/month Personal Edition + AWS ElasticRails

Free Community Edition + AWS

$10/month Personal Edition + AWS

Pros Save VM for a virtual environment (VMware) Build a custom bundle and deploy to EC2 GUI management console Cons Elastic server = application stack Community edition = non-commercial use Rails 2.0.2 is the latest ElasticRails

Pros

Save VM for a virtual environment (VMware)

Build a custom bundle and deploy to EC2

GUI management console

Cons

Elastic server = application stack

Community edition = non-commercial use

Rails 2.0.2 is the latest

Free + AWS WeoCEO

Free + AWS

Pros Automatic load balancing Automatic scaling Set min and max servers Cons Command-line setup No specific documentation on using Rails WeoCEO

Pros

Automatic load balancing

Automatic scaling

Set min and max servers

Cons

Command-line setup

No specific documentation on using Rails

Options and Pricing Standard EC2 Deployment Recommendations Code Wrap-up Agenda

Options and Pricing

Standard EC2 Deployment

Recommendations

Code

Wrap-up

Standard EC2 Deploy

Standard EC2 Deploy Small instance: $2.40/day 2 x LB $144 2 x HTTP $144 2 x DB $144 Total $432/month

Small instance: $2.40/day

2 x LB $144

2 x HTTP $144

2 x DB $144

Total $432/month

Options and Pricing Standard EC2 Deployment Recommendations Code Wrap-up Agenda

Options and Pricing

Standard EC2 Deployment

Recommendations

Code

Wrap-up

Developer or sys admin? Pay for it… Morph Scalr RightScale Recommendations

Developer or sys admin?

Pay for it…

Morph

Scalr

RightScale

Options and Pricing Standard EC2 Deployment Recommendations Code Books Articles Gems Plugins Code Wrap-up Agenda

Options and Pricing

Standard EC2 Deployment

Recommendations

Code

Books

Articles

Gems

Plugins

Code

Wrap-up

Books

AWS Articles Introduction to AWS for Ruby Developers Economical Use of Amazon S3 with Ruby on Rails Using Amazon S3, EC2, SQS, Lucene, and Ruby for Web Spidering Sample Applications in Ruby for Amazon FPS

Introduction to AWS for Ruby Developers

Economical Use of Amazon S3 with Ruby on Rails

Using Amazon S3, EC2, SQS, Lucene, and Ruby for Web Spidering

Sample Applications in Ruby for Amazon FPS

Gems right_aws EC2, S3, SQS, SimpleDB right_http_connection remit poolparty

right_aws

EC2, S3, SQS, SimpleDB

right_http_connection

remit

poolparty

Plugins S3 paperclip attachment_fu backup_fu SimpleDB AWS SDB Proxy SQS ActiveMessaging

S3

paperclip

attachment_fu

backup_fu

SimpleDB

AWS SDB Proxy

SQS

ActiveMessaging

S3: Using Paperclip right_aws right_http_connection Gems to use

S3: Using Paperclip class Product < ActiveRecord::Base has_attached_file :photo, :styles => { :medium => “300x300”, :thumb => “100x100” }, :storage => :s3, :s3_credentials => “#{RAILS_ROOT}/config/s3.yml”, :path => “:attachment/:id/:style.:extension”, :bucket => ‘introtoruby_development’ end app/models/product.rb

SQS sqs Gems to use

SQS Require ‘rubygems’ Require ‘sqs’ SQS.access_key_id = ‘YOUR_ACCESS_KEY_ID’ SQS.secret_access_key = ‘YOUR_SECRET_ACCESS_KEY’ config/environment.rb

SQS # Get an SQS queue q = SQS.get_queue ”my_sqs_queue_name” # Send a message made up of the job id q.send_message “#{self.id}” # Grab a job from the queue message = queue.receive_message # Delete the job from the queue message.delete app/models/job.rb

SQS: right_aws gem # Create a queue sqs = RightAws::SqsGen2.new(aws_access_key_id, aws_secret_access_key) queue1 = sqs.queue('my_awesome_queue') # Create a second queue queue2 = RightAws::SqsGen2::Queue.create(sqs, ‘ my_cool_queue’, true) puts queue2.size Gems used: right_aws, right_http_connection

SQS: right_aws gem # Pull a message from the queue and make it invisible message1 = queue2.receive message1.visibility = 0 puts message1 # Clear the queue, add a message, delete first accessible msg queue2.clear(true) queue2.send_message(‘Ola-la!’) message2 = queue2.pop

SimpleDB: right_aws gem # Create an instance of the SDB interface sdb = RightAws::SdbInterface.new( :server => ‘sdb.amazonaws.com’ :port => 443 :protocol => ‘https’ :signature_version => '0’ :multi_thread => true|false :logger => Logger Object) Gems used: right_aws, right_http_connection

SimpleDB: right_aws gem # Create a new domain sdb.create_domain(‘toys’) # Delete a domain Sdb.delete_domain(‘toys’) # Create and save attributes for Jon and Silvia attributes = {} attributes['Jon'] = %w{ car beer } attributes['Silvia'] = %w{ beetle rolling_pin kids } sdb.put_attributes ‘family’, ‘toys’

SimpleDB: right_aws gem # Get attributes sdb.get_attributes(‘family’, ‘toys’) # Get attributes only for cat sdb.get_attributes(‘family’, ‘toys’, ‘cat’) # Query query = ”[‘cat’ = ‘claw’]” sdb.query(‘family’, query) # Query returning 10 items sdb.query(‘family’, query, 10)

Options and Pricing Standard EC2 Deployment Recommendations Code Wrap-up Agenda

Options and Pricing

Standard EC2 Deployment

Recommendations

Code

Wrap-up

 

THANK YOU

Questions? ADS http ://www.techcfl.com Blog http://rorblog.techcfl.com Twitter http://www.twitter.com/rdempsey LinkedIn http://www.linkedin.com/in/techcfl

Add a comment

Related pages

The Future is Now - Technology Solutions Group, Inc.

The Future is Now: Leveraging the Right Technology Solution to Create the ... a Cloud solution, on ... the way to the future and how much it will cost ...
Read more

The Future is Now: Leveraging the Right Technology ...

Leveraging the Right Technology Solution to Create the ... “The Future is Now: ... and provides real-world examples of the benefits of cloud ...
Read more

What is Cloud - The Future of Cloud Computing - YouTube

What is cloud computing and how can it ... the focus has now shifted to leveraging and taking ... A Forum on the Future of ...
Read more

The Future Is Now: Hybrid Data Centers Go Mainstream ...

The Future Is Now: Hybrid Data Centers Go Mainstream. ... shut down data centers while leveraging more extensive cloud ... The future will be a ...
Read more

Leveraging the Cloud: IBM’s ... - Cloud Computing Expo

... IBM's Mike Hill provided a perspective on cloud computing's future ... now widely used in cloud computing ... cloud storage and cloud computing ...
Read more

Healthcare IT and the Cloud | @CloudExpo

Healthcare IT and the Cloud. ... Of importance here is that when it comes to leveraging the cloud ecosystem for healthcare segments, ...
Read more

Leveraging - snia.org

Leveraging Traditional ... Joyent, Inc. SNIA Winter Symposium 2009. Cloud Hype Cloud is marketing hype ... Rode closely behind the Ruby on Rails marketing hype
Read more

Case Study: Leveraging the Workday Integration Cloud ...

Case Study: Leveraging the Workday Integration Cloud. ... but with those integration platforms housed in a newly unveiled Workday Integration Cloud.
Read more

CenturyLink Cloud Developer Center Blog - ctl.io

Cloud & Developer industry perspectives and product news from CenturyLink Cloud. Toggle navigation. Blog; ... By now that isn't news to anyone. Leveraging ...
Read more