Heroku
Rails Hosting in the Cloud
What is cloud
 computing?
Cloud Computing

• Companies don‘t own the physical
  infrastructure
• Computing time and storage is rented from
  a third...
Advantages

• Variable costs instead of capital
  expenditure
  • Costs lining up with real usage
  • Real usage lining up...
Disadvantages


• You have to trust a third party
• Limitations for exotic configurations
The Cloud rocks

Deployment sucks
co sts
   agility      low            scala
                                    bility


        The Cloud rocks
abso
    ...
Set up new        Deal with
   instances        outages

Deployment sucks
                  Persist
   d Bala ncing   stor...
Automate or die
Customers




               contract


Dyno, SQL-Storage, Caching,…

               management


  ECS, S3, EBS, SimpleDB...
Customers




       contract                        contract



                       manages
                          ...
The Heroku stack
OS and Ruby

• default: Debian 4 + Ruby 1.8.6
• optional:
 • Debian 5 + REE 1.8.7
 • Debian 5 + Ruby 1.9.1
Dynos
App servers, background processes
Database
Shared or dedicated,
based on PostgreSQL
Add-Ons
• Amazon RDS          • Websolr
• Bundles (Backups)   • Memcache
• Cron                • AMQP
Integration
• Custom domains   • New Relic
• DNS servers      • Sendgrid
• Deploy hooks     • SSL certificates
• Exceptiona...
Read Only FS

• Caching → Header + Reverse Proxy
• Uploads → S3
• SQLite → PostgreSQL
• Ferret indices → use SOLR service
Interaction with
     heroku
Git based workflow

• gem install heroku
• heroku create
• git push heroku master
• heroku rake db:migrate
git push → build slug



                                     }
• checkout master branch
• download, build and install gem...
Gem management


• .gems manifest file
• bundler (experimental)
Database management

• Uses values from database.yml
• Export to heroku → db:push
• Import from heroku → db:pull
Other features

• heroku
 • console (interactive/single commands)
 • rake
Conclusion
Cons
• Oversimplification
 • Predefined sets of OS and Ruby version
 • No ssh access
 • No choice of physical location
 • On...
Pros

• Very simple start
• Low costs in the beginning / for small apps
• Offers simple management of complex
  apps, if d...
Questions?

Follow me!
 @ralph
Rails Usergroup Hamburg: Heroku
Rails Usergroup Hamburg: Heroku
Rails Usergroup Hamburg: Heroku
Upcoming SlideShare
Loading in...5
×

Rails Usergroup Hamburg: Heroku

1,802

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,802
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide



  • * no capital expenditure
    * low barriers to entry
    * low risk (cancel contract any time)
    * e.g. fire up test systems for load tests and pay by the hour
    * utility like electricity
  • * e.g. Amazon and possibly your management provider can read your data
    * XING uses SSDs to quickly serve small image files (not possible with Amazon)


  • * agility/scalability: fire up instances automatically
    * low costs: variable costs, low risk
    * security: experts take care of backups, it‘s their core business
    * reliability: replicate data between cloud providers, fire up instances on the other if one is down


  • The cloud does not make any sense without automation.

  • * no direct contact between customers and amazon
    * heroku could switch the hosting provider any time without anyone noticing
  • * customer has 2 contracts: one with scalarium, one with amazon
    * scalarium is tailored specifically to aws

  • * Reverse Proxy: Nginx
    * HTTP Cache: Varnish
    * Routing Mesh: Custom, written in Erlang
    * SQL: PostgreSQL
    * Memcache


  • * shared: multiple users on 1 powerful computing unit
    ** better for peaks
    ** impacts by other users
    * dedicated: 1 dedicated computing unit
    * database.yml will be replaced automatically on deployment




  • heroku create: git remote add heroku git@heroku.com:my_app.git
    http://my-url-35.heroku.com/
  • .slugignore format like .gitignore

  • * current bundler version on heroku: 0.9.11




  • * No Ruby 1.9.2 -> no Rails 3 beta3
    * e.g. no Redis
    * every custom tool must be manually managed, out of the Heroku scope
    * technical term confusion, e.g. bundle and migration


  • Rails Usergroup Hamburg: Heroku

    1. 1. Heroku Rails Hosting in the Cloud
    2. 2. What is cloud computing?
    3. 3. Cloud Computing • Companies don‘t own the physical infrastructure • Computing time and storage is rented from a third party
    4. 4. Advantages • Variable costs instead of capital expenditure • Costs lining up with real usage • Real usage lining up with sales volume • Higher flexibility
    5. 5. Disadvantages • You have to trust a third party • Limitations for exotic configurations
    6. 6. The Cloud rocks Deployment sucks
    7. 7. co sts agility low scala bility The Cloud rocks abso rb p ur ity eaks s ec reliability
    8. 8. Set up new Deal with instances outages Deployment sucks Persist d Bala ncing storag ant Loa e
    9. 9. Automate or die
    10. 10. Customers contract Dyno, SQL-Storage, Caching,… management ECS, S3, EBS, SimpleDB, …
    11. 11. Customers contract contract manages ECS, S3, EBS, SimpleDB, AppServer, SQL, etc. …
    12. 12. The Heroku stack
    13. 13. OS and Ruby • default: Debian 4 + Ruby 1.8.6 • optional: • Debian 5 + REE 1.8.7 • Debian 5 + Ruby 1.9.1
    14. 14. Dynos App servers, background processes
    15. 15. Database Shared or dedicated, based on PostgreSQL
    16. 16. Add-Ons • Amazon RDS • Websolr • Bundles (Backups) • Memcache • Cron • AMQP
    17. 17. Integration • Custom domains • New Relic • DNS servers • Sendgrid • Deploy hooks • SSL certificates • Exceptional • ...
    18. 18. Read Only FS • Caching → Header + Reverse Proxy • Uploads → S3 • SQLite → PostgreSQL • Ferret indices → use SOLR service
    19. 19. Interaction with heroku
    20. 20. Git based workflow • gem install heroku • heroku create • git push heroku master • heroku rake db:migrate
    21. 21. git push → build slug } • checkout master branch • download, build and install gems slug • delete .git, log/*, tmp/* and everything in .slugignore
    22. 22. Gem management • .gems manifest file • bundler (experimental)
    23. 23. Database management • Uses values from database.yml • Export to heroku → db:push • Import from heroku → db:pull
    24. 24. Other features • heroku • console (interactive/single commands) • rake
    25. 25. Conclusion
    26. 26. Cons • Oversimplification • Predefined sets of OS and Ruby version • No ssh access • No choice of physical location • Only predefined tools available • For larger setups: pretty expensive • Porting apps may be hard
    27. 27. Pros • Very simple start • Low costs in the beginning / for small apps • Offers simple management of complex apps, if developed with the heroku stack in mind
    28. 28. Questions? Follow me! @ralph
    1. A particular slide catching your eye?

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

    ×