TorqueBox from Dec. 2011 URUG

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
tehviking
December 13, 2011

TorqueBox from Dec. 2011 URUG

This TorqueBox talk was given by Brian Johnson at the December 2011 URUG meeting.

tehviking

December 13, 2011

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

24 slides
  1. What is TorqueBox? A JVM-based, prepackaged server stack for JRuby

    Rack apps (Sinatra, Rails, ...): Web application server (JBoss), Messaging (HornetQ), Services (like Daemons), Scheduling (like Cron), designed for scalability & availability
  2. More problems (typical): • Scalability • High availability • Complex

    server stack • Distribution of caching, sessions, etc. • Much easier to scale up than out
  3. O HAI JVM • 1st Class JDBC drivers • Concurrency

    via real threads • Fast! • It’s real Ruby
  4. What’s wrong with Ruby on JVM? • WAR files break

    continuous deployment and require server restarts • Increases server stack complexity • XML hell • Fewer people doing it = less support
  5. Enter TorqueBox YAML config (the NoXML) Hot Redeploys (no restarts!)

    Streamlined server setup & monitoring Easy Deployment (cap deploy) Baked-in high-scalability & availability Great community & support (Red Hat)
  6. Tech Stack: HornetQ Set up queues via YAML: messaging: /queues/puppies:

    MyHandler: concurrency: 5 config: some_key: some_value Or at runtime: @queue = TorqueBox::Messaging::Queue.new("/queue/foo") @queue.publish( “Oh, puppies!” )
  7. Tech Stack: Scheduled Jobs It’s not cron! Configure via YAML

    JGroups runs tasks on all nodes or as singleton # config/torquebox.yml jobs: monthly_reminder: description: sends reminders job: MyJob cron: ‘0 0 0 1 * ?’ singleton: true # app/jobs/my_job.rb class MyJob def run() # your code here end end
  8. Tech Stack: Services Daemon-like Easy to monitor JGroups: All nodes,

    single-node, failover # app/services/my_service.rb class MyServer def initialize(opts) end def start end def stop end end
  9. Oh my gosh so much more Capistrano support (or archive

    deploy, or web-based git deploy in StompBox) Meta-transactions (incl. ActiveRecord, queue, Infinispan) Client-side async with Stomplets RSpec helpers
  10. Challenges Slow-ish boot time for dev Larger base memory footprint

    Ruby 1.9 is “edge” “The TorqueBox Way”: Bundled stack is largely what you get If using advanced features (like messaging), you need to develop against TorqueBox, not ‘rails s’

More Decks by tehviking

Other Decks in Technology