SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
Drupal in the Cloud

           Scaling with Drupal and Amazon
                    Web Services



Northern Virginia Drupal Meetup         3 Dec 2008
Cast of Characters
Eric at The Case
Foundation: The Client
With typical client challenges
   Cost: Spending lots for boxes &
   load balancer in a data center
   Reliability

And some atypical ones
   Scale: Runs big campaigns -- say 48,000 people donating
      6-month grant competition http://miyo.casefoundation.
      org and
      Or a 6-week challenge http://www.parade.
      com/contests/givingchallenge
   Boss likes to send out press releases
Frank at Phase2 Technology :
The Architect
Dealing with Deployment Scenarios
  How many front/back end servers
  What to do about redundancy
  Automating the deployment process
  Aggressive timeline

                    Hurdles
                     No significant deployments on AWS
                     Building site AND deployment scripts
                     Juggling the constellation of
                     services, scripts, servers
Drupal: The CMS

We've done this for Drupal 5 and 6
AWS: The Cloud

Collection of infrastructure services
provided by Amazon
   S3 - Simple Storage Service
       Scalable http read-write storage
       Slow but bulletproof, pay per GB stored and transfered
   EC2 - Elastic Compute Cloud
       Web service that provides resizable computing capacity
       Pay by size of instance, time running, transfer rates
   EBS - Elastic Block Storage for EC2 data
       Fast, perminent until the datacenter burns
   CloudFront: Content delivery network
   SimpleDB: Non-relational db
   Simple Queue Service: A message queue for splitting jobs
   among machines
How does S3 work?


  Upload into buckets via REST/SOAP

  Download like a webserver via HTTP
     http://s2.amazonaws.com/basec/171890/2329706/copytitle.jpg


  Decentralized and fault tolerant
How does EC2 work?

 Virtualized servers across
 Amazon hardware infrastructure
 Commands are executed via
 REST/SOAP
 You can use front end services to ease the pain
 (RightScale)
 Pick your instance size
 Pick your OS
 Build an Amazon Machine Image (AMI) or use a
 stock/contributed AMI
     AMI is a snapshot of a server installation, configured
     packages, etc.
Act 1

How do I save my stuff?
The Cloud is not
like Kansas
EC2 servers are virtual

   They can die at any time
   Disk goes poof
   You don't even know where they are
   You can add more whenever load (or whim) dictates

This means...

   Configuration should be fast/automatic
   Server monitoring, please
   Load balancing, too
   And how do I save my stuff?
So how to save your stuff -- if you're
Google
1. Non-relational database like SimpleDB (or BigTable)
      No tables, just key-value pairs -- a giant hash
      Data is safe, but not necessarily consistent
      No locking, so scales really well
      This is how Google does it
2. But Drupal is tied tightly to the DB
      So this doesn't work
       http://buytaert.net/drupal-in-the-cloud
How to save your stuff -- if
you're Drupal
For the Database:

1. Use EBS for persistent storage of db disk
2. Use master-slave MySQL & backup
      A vendor like RightScale can help with setup

For the Files:

1. Write files to S3
2. Or write them to EBS
Act 2

Configuration
Deployment Architecture

 You must know your deployment architecture before you
 can build it and (more importantly) scale it.
 Build for your worst (best?) case scenario
 Have a scaling strategy & implement acordingly
Single-tier Deployment

  Very easy to setup

  Difficult to scale
Multi-tier Deployment

  More difficult to setup

  Scales easily
Did someone say Pirates?!?!?!?!

  Arrrrrrrrrrr!   Grrrrrrrrrrr!
Getting this show on the road

  Use EC2 command line, ElasticFox, or a provider such as
  RightScale
  Launch your instance
  Configure your instances
     Via shell scripts, RightScripts
     Assign Elastic IP or register dynamic with DNSME
     Mount ESB filesystem(s)
     Restore backups/snapshots as necessary
     Configure webserver
     Deploy Drupal from SVN or S3 (if needed)
     Install cron jobs
     Start services
Sure but HOW?!?!?!?

Using Plain EC2
   Largely manual process
   Write shell scripts to configure server (bash, ruby, perl, etc.)
      Make all variations environment variables
   Create packages of scripts, script runners, and naming
   conventions to order scripts
   Upload scripts to S3 bucket or commit to SVN
   Start an AMI
   Post AMI boot
      Setup environment variables for the instances
      Get scripts on server from S3 or SVN
      Run scripts to configure the server
Wait a minute, Eric says...
Better living thru....

RightScale to the rescue
   More expensive, but great framework to manage your setup
   Automates a great deal
   Create RightScripts
   Create Alerts & Escalations
   Build Server Templates
      Assign AMI
      Assign RightScripts - Boot/Operational/Decommission
      Provide Inputs (env vars)
      Assign Alerts/Escalations
   Bulk of the work is at design time
   Runtime deployments/scaling are button clicks (or
   automated!)
Disaster Planning

It will never happen to me

   Plan for disaster and test for it
      Kill Web or Database instance
      See if you survive and make fixes until you do

   Things that can help you survive
      Master-Slave DB Replication
          Daily S3 backup for Master
          10 minute S3 incremental for Slave
      Filesystem sync to S3
      Even better, ESB for filesystems & ESB to S3 backup

   Test recovery from complete failure of all instances
Other Cloud Providers

 Rackspace/Mosso
   http://mosso.com

 Scalr/EC2
    http://scalr.net

 Google App Engine (Python Only)
   http://code.google.com/appengine/

 Coming Soon to EC2
   Web Based Console
   Built-in Load Balancing
   Auto-Scaling options
   Monitoring
Act 3

Cost and other stats
After all that, Eric saved some money

 Hosting expenses now
 25% of what they were
 Cost now varies with
 what we use
 No more year-long
 hosting agreements
 Rolling out additional
 servers is a 15-minute job
Questions?
Or drop us a note...

Eric Johnson
Director of Web Development
The Case Foundation
ericj@casefoundation.org

Frank Febbraro
CTO
Phase2 Technology
frank@phase2technology.com


Slides will be posted later tonight
    Eric's blog: http://el-studio.com/tag/cloud/
    Phase2 blog: http://agileapproach.com

Weitere ähnliche Inhalte

Kürzlich hochgeladen

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Kürzlich hochgeladen (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Drupal In The Cloud Scaling With Aws

  • 1. Drupal in the Cloud Scaling with Drupal and Amazon Web Services Northern Virginia Drupal Meetup 3 Dec 2008
  • 3. Eric at The Case Foundation: The Client With typical client challenges Cost: Spending lots for boxes & load balancer in a data center Reliability And some atypical ones Scale: Runs big campaigns -- say 48,000 people donating 6-month grant competition http://miyo.casefoundation. org and Or a 6-week challenge http://www.parade. com/contests/givingchallenge Boss likes to send out press releases
  • 4. Frank at Phase2 Technology : The Architect Dealing with Deployment Scenarios How many front/back end servers What to do about redundancy Automating the deployment process Aggressive timeline Hurdles No significant deployments on AWS Building site AND deployment scripts Juggling the constellation of services, scripts, servers
  • 5. Drupal: The CMS We've done this for Drupal 5 and 6
  • 6. AWS: The Cloud Collection of infrastructure services provided by Amazon S3 - Simple Storage Service Scalable http read-write storage Slow but bulletproof, pay per GB stored and transfered EC2 - Elastic Compute Cloud Web service that provides resizable computing capacity Pay by size of instance, time running, transfer rates EBS - Elastic Block Storage for EC2 data Fast, perminent until the datacenter burns CloudFront: Content delivery network SimpleDB: Non-relational db Simple Queue Service: A message queue for splitting jobs among machines
  • 7. How does S3 work? Upload into buckets via REST/SOAP Download like a webserver via HTTP http://s2.amazonaws.com/basec/171890/2329706/copytitle.jpg Decentralized and fault tolerant
  • 8. How does EC2 work? Virtualized servers across Amazon hardware infrastructure Commands are executed via REST/SOAP You can use front end services to ease the pain (RightScale) Pick your instance size Pick your OS Build an Amazon Machine Image (AMI) or use a stock/contributed AMI AMI is a snapshot of a server installation, configured packages, etc.
  • 9. Act 1 How do I save my stuff?
  • 10. The Cloud is not like Kansas EC2 servers are virtual They can die at any time Disk goes poof You don't even know where they are You can add more whenever load (or whim) dictates This means... Configuration should be fast/automatic Server monitoring, please Load balancing, too And how do I save my stuff?
  • 11. So how to save your stuff -- if you're Google 1. Non-relational database like SimpleDB (or BigTable) No tables, just key-value pairs -- a giant hash Data is safe, but not necessarily consistent No locking, so scales really well This is how Google does it 2. But Drupal is tied tightly to the DB So this doesn't work http://buytaert.net/drupal-in-the-cloud
  • 12. How to save your stuff -- if you're Drupal For the Database: 1. Use EBS for persistent storage of db disk 2. Use master-slave MySQL & backup A vendor like RightScale can help with setup For the Files: 1. Write files to S3 2. Or write them to EBS
  • 14. Deployment Architecture You must know your deployment architecture before you can build it and (more importantly) scale it. Build for your worst (best?) case scenario Have a scaling strategy & implement acordingly
  • 15. Single-tier Deployment Very easy to setup Difficult to scale
  • 16. Multi-tier Deployment More difficult to setup Scales easily
  • 17. Did someone say Pirates?!?!?!?! Arrrrrrrrrrr! Grrrrrrrrrrr!
  • 18. Getting this show on the road Use EC2 command line, ElasticFox, or a provider such as RightScale Launch your instance Configure your instances Via shell scripts, RightScripts Assign Elastic IP or register dynamic with DNSME Mount ESB filesystem(s) Restore backups/snapshots as necessary Configure webserver Deploy Drupal from SVN or S3 (if needed) Install cron jobs Start services
  • 19. Sure but HOW?!?!?!? Using Plain EC2 Largely manual process Write shell scripts to configure server (bash, ruby, perl, etc.) Make all variations environment variables Create packages of scripts, script runners, and naming conventions to order scripts Upload scripts to S3 bucket or commit to SVN Start an AMI Post AMI boot Setup environment variables for the instances Get scripts on server from S3 or SVN Run scripts to configure the server
  • 20. Wait a minute, Eric says...
  • 21. Better living thru.... RightScale to the rescue More expensive, but great framework to manage your setup Automates a great deal Create RightScripts Create Alerts & Escalations Build Server Templates Assign AMI Assign RightScripts - Boot/Operational/Decommission Provide Inputs (env vars) Assign Alerts/Escalations Bulk of the work is at design time Runtime deployments/scaling are button clicks (or automated!)
  • 22. Disaster Planning It will never happen to me Plan for disaster and test for it Kill Web or Database instance See if you survive and make fixes until you do Things that can help you survive Master-Slave DB Replication Daily S3 backup for Master 10 minute S3 incremental for Slave Filesystem sync to S3 Even better, ESB for filesystems & ESB to S3 backup Test recovery from complete failure of all instances
  • 23. Other Cloud Providers Rackspace/Mosso http://mosso.com Scalr/EC2 http://scalr.net Google App Engine (Python Only) http://code.google.com/appengine/ Coming Soon to EC2 Web Based Console Built-in Load Balancing Auto-Scaling options Monitoring
  • 24. Act 3 Cost and other stats
  • 25. After all that, Eric saved some money Hosting expenses now 25% of what they were Cost now varies with what we use No more year-long hosting agreements Rolling out additional servers is a 15-minute job
  • 27. Or drop us a note... Eric Johnson Director of Web Development The Case Foundation ericj@casefoundation.org Frank Febbraro CTO Phase2 Technology frank@phase2technology.com Slides will be posted later tonight Eric's blog: http://el-studio.com/tag/cloud/ Phase2 blog: http://agileapproach.com