SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Real World
Rails Deployment




    Alan Hecht
Deployment Options

• Heroku - PaaS

• Shared Web Hosting

• Virtual Private Server

• Amazon Web Services - IaaS
Heroku - PaaS

• No setup & no system administration
  -   Easy to deploy

• Free when using one web process
  -   Pay as you scale

• App will idle after inactivity if only using one
  process (“dyno”)

• Additional “dyno” + database > 5MB is
  $50/month
Shared Web Hosting

• Cheap - $5 to $10 per month


• Web hosting control panel (i.e. cPanel) to
  configure web server & web application


• Limited to what is on the server


• Not recommended
  -   Constrained by CPU usage
Virtual Private Server
• Starts at around $25 per month


• Extremely flexible, can load anything you want


• System administration knowledge required
  -   Must maintain server


• Good for one or two standalone servers
Amazon Web Services - IaaS
• Building a virtual data center
  • Netflix runs on AWS


• Can load instances with a pre-built O/S


• Pay as you scale


• Most expensive option
Running Rails

• WEBrick should only be used in a
  development environment

• Need a web server to handle static
  requests
  - Images, HTML, JavaScript, CSS

• Need a Ruby web application server to
  handle Rails requests (i.e. Unicorn,
  Thin, or Passenger)
Web Server

• Apache & Nginx the two most popular
  choices


• Rack is used as an interface between
  the web server and Rails
Apache

• Most popular web server and has the
  many options & features


• Process-based web server


• Good for handling dynamic content via
  modules
Nginx

• Light weight web server that only
  handles static content


• Event-based web server


• Low memory usage
Apache or Nginx

• Pick one - either works

• Nginx better on a VPS because of low
  memory usage

• Apache is full-featured

• Nginx does a few things well
Rails Web App Servers

• Phusion Passenger, Thin, and Unicorn
  currently the most widely used Rails app
  servers


• Can be installed as a web server plugin
  or as a separate Ruby Gem
Phusion Passenger

• Acts as an Apache or Nginx module


• Philosophy – same as Rails (DRY,
  convention over configuration)


• Easy to deploy & maintain
  - No separate configuration file
Thin

• Event based Rails server


• Philosophy – tiny, fast, and secure


• Used by Heroku
Unicorn

• Process-based Rails server


• Philosophy – Unicorn is Unix


• Used by Twitter & GitHub
Nginx + Unicorn Architecture
Sample Nginx Configuration
Which One?

• People have built scalable sites with all
  three


• Thin & Unicorn need configuration,
  Passenger does not


• Performance depends on the
  application
  - “Hello World” apps not useful for profiling
Capistrano

•Tool for deploying Rails (or Rack)
applications



•Similar in structure to Rakefile
Sample Capistrano Script
What Does a Scalable Site
 Architecture Look Like?
          Content Delivery Network




                Nginx SSL

                HA Proxy



Nginx        Nginx              Nginx
  +            +                  +
Unicorn      Unicorn            Unicorn

Weitere ähnliche Inhalte

Was ist angesagt?

Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friendFilip Bruun Bech-Larsen
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?Eduard Tomàs
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business HeadsYash Mody
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen OxfordPhil Pursglove
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps FasterBrij Mishra
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapiBrij Mishra
 
Building solutions with the SharePoint Framework - deep-dive
Building solutions with the SharePoint Framework - deep-diveBuilding solutions with the SharePoint Framework - deep-dive
Building solutions with the SharePoint Framework - deep-diveWaldek Mastykarz
 
Getting Started with ASP.NET 5
Getting Started with ASP.NET 5Getting Started with ASP.NET 5
Getting Started with ASP.NET 5Brij Mishra
 
Building real time app by using asp.Net Core
Building real time app by using asp.Net CoreBuilding real time app by using asp.Net Core
Building real time app by using asp.Net CoreCommit Software Sh.p.k.
 
Host, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsHost, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsJose Javier Columbie
 
Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0EastBanc Tachnologies
 
Introduction 2 to aws and storage options
Introduction 2 to aws and storage optionsIntroduction 2 to aws and storage options
Introduction 2 to aws and storage optionsSzilveszter Molnár
 
WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?Alexandr Skachkov
 

Was ist angesagt? (20)

Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
 
ReactPHP + Symfony
ReactPHP + SymfonyReactPHP + Symfony
ReactPHP + Symfony
 
Frameworks and webcomponents
Frameworks and webcomponentsFrameworks and webcomponents
Frameworks and webcomponents
 
DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop DevOpsCon Cloud Workshop
DevOpsCon Cloud Workshop
 
Fluxible
FluxibleFluxible
Fluxible
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business Heads
 
Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen Oxford
 
10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapi
 
Building solutions with the SharePoint Framework - deep-dive
Building solutions with the SharePoint Framework - deep-diveBuilding solutions with the SharePoint Framework - deep-dive
Building solutions with the SharePoint Framework - deep-dive
 
Owin & katana
Owin & katanaOwin & katana
Owin & katana
 
Velocity - Edge UG
Velocity - Edge UGVelocity - Edge UG
Velocity - Edge UG
 
Getting Started with ASP.NET 5
Getting Started with ASP.NET 5Getting Started with ASP.NET 5
Getting Started with ASP.NET 5
 
Building real time app by using asp.Net Core
Building real time app by using asp.Net CoreBuilding real time app by using asp.Net Core
Building real time app by using asp.Net Core
 
Vagrant&ansible
Vagrant&ansibleVagrant&ansible
Vagrant&ansible
 
Host, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsHost, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server Apps
 
Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0Developing Cross-Platform Web Apps with ASP.NET Core1.0
Developing Cross-Platform Web Apps with ASP.NET Core1.0
 
Introduction 2 to aws and storage options
Introduction 2 to aws and storage optionsIntroduction 2 to aws and storage options
Introduction 2 to aws and storage options
 
WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?
 

Ähnlich wie Real World Rails Deployment

Amazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and HostingAmazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and HostingAcquia
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScalemmoline
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerWeb à Québec
 
What are clouds made from
What are clouds made fromWhat are clouds made from
What are clouds made fromJohn Garbutt
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013aspyker
 
Beyond Heroku: Hosting Your Rails App Yourself
Beyond Heroku: Hosting Your Rails App YourselfBeyond Heroku: Hosting Your Rails App Yourself
Beyond Heroku: Hosting Your Rails App Yourselfstcarpenter
 
Web Servers(IIS, NGINX, APACHE)
Web Servers(IIS, NGINX, APACHE)Web Servers(IIS, NGINX, APACHE)
Web Servers(IIS, NGINX, APACHE)Reza Jebeli
 
Webinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case StudyWebinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case StudyCeph Community
 
High performance web sites with multilevel caching
High performance web sites with multilevel cachingHigh performance web sites with multilevel caching
High performance web sites with multilevel cachingDotnet Open Group
 
Urbanesia - Development History
Urbanesia - Development HistoryUrbanesia - Development History
Urbanesia - Development HistoryBatista Harahap
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 

Ähnlich wie Real World Rails Deployment (20)

Amazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and HostingAmazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and Hosting
 
Wikipedia Cloud Search Webinar
Wikipedia Cloud Search WebinarWikipedia Cloud Search Webinar
Wikipedia Cloud Search Webinar
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScale
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
Intro to Serverless
Intro to ServerlessIntro to Serverless
Intro to Serverless
 
What are clouds made from
What are clouds made fromWhat are clouds made from
What are clouds made from
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
 
Beyond Heroku: Hosting Your Rails App Yourself
Beyond Heroku: Hosting Your Rails App YourselfBeyond Heroku: Hosting Your Rails App Yourself
Beyond Heroku: Hosting Your Rails App Yourself
 
Migrating to aws
Migrating to awsMigrating to aws
Migrating to aws
 
Apereo OAE - Bootcamp
Apereo OAE - BootcampApereo OAE - Bootcamp
Apereo OAE - Bootcamp
 
Bitnami Bootcamp. OpenStack
Bitnami Bootcamp. OpenStackBitnami Bootcamp. OpenStack
Bitnami Bootcamp. OpenStack
 
Performance stack
Performance stackPerformance stack
Performance stack
 
Web Servers(IIS, NGINX, APACHE)
Web Servers(IIS, NGINX, APACHE)Web Servers(IIS, NGINX, APACHE)
Web Servers(IIS, NGINX, APACHE)
 
OpenStack and Windows
OpenStack and WindowsOpenStack and Windows
OpenStack and Windows
 
Webinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case StudyWebinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case Study
 
High performance web sites with multilevel caching
High performance web sites with multilevel cachingHigh performance web sites with multilevel caching
High performance web sites with multilevel caching
 
AWS Distilled
AWS DistilledAWS Distilled
AWS Distilled
 
Urbanesia - Development History
Urbanesia - Development HistoryUrbanesia - Development History
Urbanesia - Development History
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 
WSO2 Application Server
WSO2 Application ServerWSO2 Application Server
WSO2 Application Server
 

Kürzlich hochgeladen

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Real World Rails Deployment

  • 2. Deployment Options • Heroku - PaaS • Shared Web Hosting • Virtual Private Server • Amazon Web Services - IaaS
  • 3. Heroku - PaaS • No setup & no system administration - Easy to deploy • Free when using one web process - Pay as you scale • App will idle after inactivity if only using one process (“dyno”) • Additional “dyno” + database > 5MB is $50/month
  • 4. Shared Web Hosting • Cheap - $5 to $10 per month • Web hosting control panel (i.e. cPanel) to configure web server & web application • Limited to what is on the server • Not recommended - Constrained by CPU usage
  • 5. Virtual Private Server • Starts at around $25 per month • Extremely flexible, can load anything you want • System administration knowledge required - Must maintain server • Good for one or two standalone servers
  • 6. Amazon Web Services - IaaS • Building a virtual data center • Netflix runs on AWS • Can load instances with a pre-built O/S • Pay as you scale • Most expensive option
  • 7. Running Rails • WEBrick should only be used in a development environment • Need a web server to handle static requests - Images, HTML, JavaScript, CSS • Need a Ruby web application server to handle Rails requests (i.e. Unicorn, Thin, or Passenger)
  • 8. Web Server • Apache & Nginx the two most popular choices • Rack is used as an interface between the web server and Rails
  • 9. Apache • Most popular web server and has the many options & features • Process-based web server • Good for handling dynamic content via modules
  • 10. Nginx • Light weight web server that only handles static content • Event-based web server • Low memory usage
  • 11. Apache or Nginx • Pick one - either works • Nginx better on a VPS because of low memory usage • Apache is full-featured • Nginx does a few things well
  • 12. Rails Web App Servers • Phusion Passenger, Thin, and Unicorn currently the most widely used Rails app servers • Can be installed as a web server plugin or as a separate Ruby Gem
  • 13. Phusion Passenger • Acts as an Apache or Nginx module • Philosophy – same as Rails (DRY, convention over configuration) • Easy to deploy & maintain - No separate configuration file
  • 14. Thin • Event based Rails server • Philosophy – tiny, fast, and secure • Used by Heroku
  • 15. Unicorn • Process-based Rails server • Philosophy – Unicorn is Unix • Used by Twitter & GitHub
  • 16. Nginx + Unicorn Architecture
  • 18. Which One? • People have built scalable sites with all three • Thin & Unicorn need configuration, Passenger does not • Performance depends on the application - “Hello World” apps not useful for profiling
  • 19. Capistrano •Tool for deploying Rails (or Rack) applications •Similar in structure to Rakefile
  • 21. What Does a Scalable Site Architecture Look Like? Content Delivery Network Nginx SSL HA Proxy Nginx Nginx Nginx + + + Unicorn Unicorn Unicorn