Perl in Teh Cloud
 What do you mean, “no wires”?
Scope
•   Amazon Web Services Infrastructure products

    •   EC2, S3, EBS (SimpleDB, SQS, Elastic MapReduce N/A)

•   Wh...
What’s in EC2?

•   On-demand compute power

•   Controlled via a web service

•   Free-form machines created with very li...
S3 - Simple Storage Service


•   Storage accessible through web services

•   Highly replicated

•   Free data transfer w...
EBS - Elastic Block Service
•   A hard disk, somewhere

•   Format it however you like

•   Attach to and mount on an inst...
The Problem

•   Instances can drop out of the sky at any time

    •   Although this doesn’t happen often, *it will happe...
Solutions


•   Machine images

•   Ye Olde Tarball

•   EBS and snapshots
Solution - Machine Images

•   Canonical machines

•   Planning ahead

•   Not very flexible

•   Time-consuming
Solution - Tarball

•   Hosted in S3

•   Fetched and uncompressed on launch

•   Set-up scripts written in whatever langu...
Solution - EBS

•   Permanent storage

•   One volume for one machine

•   Snapshot it and create extra volumes on launch
...
A Note About local::lib
•   Oh look, code!

•   Or perhaps not

•   Each project can easily have its own $PERL5LIB

    • ...
A Note About local::lib

•   Sinopsys
    use local::lib; # sets up a local lib at ~/perl5

    use local::lib '~/foo'; # ...
A Note About local::lib

•   And to easily install stuff where you want it:
    # Install LWP and it's missing dependencie...
Use Cases

•   Testing and staging

•   Scaling applications

•   Disaster recovery

•   No data center is a good data cen...
Use Case - Testing & Staging

•   Machines are guaranteed to be exact replicas of production

•   Never forget to update t...
Use Case - Scaling


•   Grow when you need to grow, shrink when you’re wasting resources

•   Automated provisioning and ...
Use Case - Disaster Recovery

•   Your main database went down

•   A web server crashed

•   Data replication

•   Forget...
Use Case - Data Center

•   There isn’t one

•   Stop paying for services you don’t use

    •   Aircon, racks, connectivi...
Net::Amazon::*

•   Net::Amazon::S3

    •   Net::Amazon::S3::ACL

    •   Net::Amazon::S3::Tools

•   Net::Amazon::Simple...
See Also

•   Bootstrapping local::lib
    http://www.simplicidade.org/notes/archives/2009/05/locallib_bootst.html


•   R...
Q&A


•   me@pedrofigueiredo.org

•   http://www.slideshare.net/pfig/perl-in-teh-cloud

•   http://groups.google.com/group...
Upcoming SlideShare
Loading in...5
×

Perl in Teh Cloud

2,006

Published on

With more businesses moving to cloud-based solutions everyday, we must re-think the strategies used to deploy Perl applications and related libraries, given the volatile aspects of the cloud and its constraints.

In this talk I go over the challenges posed by virtualised environments, and consider several solutions to them. The use cases are all related to Amazon's EC2, but will easily be adapted for GoGrid, Mosso, and others.

Published in: Technology, Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,006
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Perl in Teh Cloud

  1. 1. Perl in Teh Cloud What do you mean, “no wires”?
  2. 2. Scope • Amazon Web Services Infrastructure products • EC2, S3, EBS (SimpleDB, SQS, Elastic MapReduce N/A) • What do you get from AWS? What don’t you get? • Software packaging and deployment • Use cases • No code to see here, move along
  3. 3. What’s in EC2? • On-demand compute power • Controlled via a web service • Free-form machines created with very little effort • Computers without the metal bits
  4. 4. S3 - Simple Storage Service • Storage accessible through web services • Highly replicated • Free data transfer within EC2
  5. 5. EBS - Elastic Block Service • A hard disk, somewhere • Format it however you like • Attach to and mount on an instance • Excellent random access performance • As opposed to an instance’s storage, which is good for sequential operations, like table scans.
  6. 6. The Problem • Instances can drop out of the sky at any time • Although this doesn’t happen often, *it will happen* • An instance’s storage isn’t persistent across launches • Machines are built from scratch on launch
  7. 7. Solutions • Machine images • Ye Olde Tarball • EBS and snapshots
  8. 8. Solution - Machine Images • Canonical machines • Planning ahead • Not very flexible • Time-consuming
  9. 9. Solution - Tarball • Hosted in S3 • Fetched and uncompressed on launch • Set-up scripts written in whatever language you want • local::lib
  10. 10. Solution - EBS • Permanent storage • One volume for one machine • Snapshot it and create extra volumes on launch • local::lib • Easy to screw up
  11. 11. A Note About local::lib • Oh look, code! • Or perhaps not • Each project can easily have its own $PERL5LIB • No interference from other projects • You can change the system-wide installation without fear of maiming a project
  12. 12. A Note About local::lib • Sinopsys use local::lib; # sets up a local lib at ~/perl5 use local::lib '~/foo'; # same, but ~/foo # Or... use FindBin; use local::lib "$FindBin::Bin/../support"; # app-local support library
  13. 13. A Note About local::lib • And to easily install stuff where you want it: # Install LWP and it's missing dependencies to the 'my_lwp' directory perl -MCPAN -Mlocal::lib=my_lwp -e 'CPAN::install(LWP)' # Install LWP and *all non-core* dependencies to the 'my_lwp' directory perl -MCPAN -Mlocal::lib=--self-contained,my_lwp -e 'CPAN::install(LWP)'
  14. 14. Use Cases • Testing and staging • Scaling applications • Disaster recovery • No data center is a good data center
  15. 15. Use Case - Testing & Staging • Machines are guaranteed to be exact replicas of production • Never forget to update that module again • Fire it up, do your thing, and shut it down • Lead time measured in minutes
  16. 16. Use Case - Scaling • Grow when you need to grow, shrink when you’re wasting resources • Automated provisioning and de-commissioning • Did I mention the lead time?
  17. 17. Use Case - Disaster Recovery • Your main database went down • A web server crashed • Data replication • Forget about lead times :)
  18. 18. Use Case - Data Center • There isn’t one • Stop paying for services you don’t use • Aircon, racks, connectivity, power • Remember when you forgot your ID or keys to the rack?
  19. 19. Net::Amazon::* • Net::Amazon::S3 • Net::Amazon::S3::ACL • Net::Amazon::S3::Tools • Net::Amazon::SimpleQueue
  20. 20. See Also • Bootstrapping local::lib http://www.simplicidade.org/notes/archives/2009/05/locallib_bootst.html • RightScale http://rightscale.com/ • AWS for Eclipse
  21. 21. Q&A • me@pedrofigueiredo.org • http://www.slideshare.net/pfig/perl-in-teh-cloud • http://groups.google.com/group/aws-cloud-user-group
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×