SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Velocity - NxtGen Oxford
Velocity - NxtGen OxfordVelocity - NxtGen Oxford
Velocity - NxtGen Oxford
Phil Pursglove
 

Tendances (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?
 

Similaire à Real World Rails Deployment

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
mmoline
 

Similaire à 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
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
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...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

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