SlideShare a Scribd company logo
1 of 37
Download to read offline
Merb, not rails? !
A practical introduction to a new framework.
Intro to merb
What is merb?

• MVC Framework.
• Similar to Rails.
• Lightweight, extensible, fast.
Merb Ideology

• Hacker-friendly.
• Core should be small, plugins bountiful.
• Code should be as simple as possible.
• Code should not be “magical.”
Merb is like rails


• Application structure is very similar
• Can use ActiveRecord
What does merb-core include?

• rack-based request handling
• session handling
• before / after filters
• layouts / views with erb
• routing
What does merb-core include?

• gem-based plugins
• mailers
• partials
• exceptions
• generator for controllers, and models
  (integrates with your chosen ORM).
What is elsewhere?

• an ORM (can use ActiveRecord,
  DataMapper, Sequel)
• form helpers such as form_for
  (merb_helper)
• ActiveSupport and all those little ruby
  extensions (extlib?)
What is elsewhere?
• flash (merb_has_flash and
  redirect :message)
 • redirect(quot;/posts/34quot;, :message =>
    { :notice => 'Post updated successfully!' })
• scaffolding
• caching (merb-cache)
• ajax library (merb_jquery)
DataMapper

• Thread-safe.
• Supports data stores you don’t manage.
• Optimizations in eager-loading, lazy-loading,
  etc.
What do we need
 helper functions for?

• Why not just use HTML for templating
  instead of all those helper functions?
• Why not just use JQuery for AJAX instead
  of all those AJAX helper functions?
Thread-safety

• Merb is thread-safe now.
• Rails will be thread-safe in 2.2.
• What does that mean? http://
  blog.headius.com/2008/08/qa-what-thread-
  safe-rails-means.html
Considerations
• Does your app block?
 • File uploads
 • Remote HTTP calls
   • Facebook app: 1-2s wait time?
• Do you have native threads?
 • JRuby / C ruby differences
Instances Required
                                Merb   Rails

C MRI, one core, no blocking     1      1

C MRI, one core, 80% blocking    1      5

C MRI, two cores, no blocking    2      2

C MRI, two core, 80% blocking    2      10

Jruby, one core, no blocking     1      1

Jruby, one core, 80% blocking    1      5

Jruby, two cores, no blocking    1      2

Jruby, two core, 80% blocking    1      10

Jruby, 16 cores, 80% blocking    1      80
Case study
The Project

• CMS for Faculty.
• Keeps track of courses, education,
  biography info, etc.
• Deployed to Tomcat.
Requirements

• 2500 faculty websites.
• 5 concurrent backend users.
• 500 users per day on the public facing
  pages.
Can Rails handle that?


• One process per file upload?
• RAM requirements?
Why merb?

• Thread-safe.
• Low memory footprint.
• ???
Why JRuby?


• Authentication integration using JRadius
• Java platform lowers IT stress level.
What is development
         like?
• There are no books... yet.
• The codebase is changing.
• Smaller userbase than rails.
• If you are doing anything weird, be prepared
  to corepatch!
Problems
• File upload broken in Tomcat deploy.
• Partial behavior is totally weird.
• Render syntax changed / broke export
  code.
• Activerecord-jdbc mysql quote error.
• String concurrency problem??
Other Issues


• acts_as_list had to be extracted from
  ActiveRecord files and manually included in
  init.rb.
Post-mortem
Speed Comparison

•   Test with simple merb / rails apps using ActiveRecord

•   Tests using ab -n 10000

•   Testing serially, not concurrently.

•   Tested on this MacBook Pro
C MRI Mongrel


• Merb: 170 requests / second
• Rails: 32 requests / second
JRuby Tomcat


• Merb: 69 requests / second
• Rails : 121 requests / second
JRuby Mongrel


• Merb: 104 requests / second
• Rails: 29 requests / second
JRuby Glassfish


• Merb: 106 requests / second
• Rails : 125 requests / second
What is the deal?

• JRuby thread pool, instead of thread
  instantiation?
• Default session handling?
• Overspinning threads in app server?
• Incorrect JIT compilation?
Tomcat Memory Usage

• Merb: ~30 MB for all threads
• Rails: ~60 MB+ additional memory per
  process


• (Tested on Tomcat)
Was it worth it?
• Thread-safety is a minor advantage when it
  comes to file uploads.
• Merb uses less memory.
• Merb is slower than rails.
• Merb may die on string thread-safe bug
  until JRuby / Merb team fix it.
Conclusion
Consider merb if...
• you’re writing a small tool.
• you have limited memory requirements.
• you like trying new ORMs.
• you need fast performance (and you’ve
  figured out why it runs so slow on JRuby).
• you like hacking about in frameworks.
Upcoming

• Merb 1.0 is released Oct 11-12.
• MerbCamp is in San Diego Oct 11-12.
• Merb in Action book (2009?).
Available

• I’m available for contracts again. Talk to me
  here, at 408-646-2240 or
  paulboone@mindbucket.com.
• http://www.mindbucket.com/

More Related Content

What's hot

Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco PresentationJuan J. Merelo
 
Starting a new ruby on rails development
Starting a new ruby on rails developmentStarting a new ruby on rails development
Starting a new ruby on rails developmentNicolas Alpi
 
From java-to-ruby-book-summary
From java-to-ruby-book-summaryFrom java-to-ruby-book-summary
From java-to-ruby-book-summary120bi
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The EnterpriseMatt Aimonetti
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBrian Sam-Bodden
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platformdeimos
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smellolegshpynov
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Stefan Koopmanschap
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony frameworkStefan Koopmanschap
 
WebSocket For Web Rubyists
WebSocket For Web RubyistsWebSocket For Web Rubyists
WebSocket For Web RubyistsMu-Fan Teng
 
Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!Abu Ashraf Masnun
 
JRuby and Google App Engine
JRuby and Google App EngineJRuby and Google App Engine
JRuby and Google App Enginejoshsmoore
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsDinh Pham
 

What's hot (15)

Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco Presentation
 
Starting a new ruby on rails development
Starting a new ruby on rails developmentStarting a new ruby on rails development
Starting a new ruby on rails development
 
From java-to-ruby-book-summary
From java-to-ruby-book-summaryFrom java-to-ruby-book-summary
From java-to-ruby-book-summary
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
pearls of Perl
pearls of Perlpearls of Perl
pearls of Perl
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony framework
 
WebSocket For Web Rubyists
WebSocket For Web RubyistsWebSocket For Web Rubyists
WebSocket For Web Rubyists
 
Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!
 
JRuby and Google App Engine
JRuby and Google App EngineJRuby and Google App Engine
JRuby and Google App Engine
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applications
 

Viewers also liked

Trabajo De InvestigacióN De Sociedad123
Trabajo De InvestigacióN De Sociedad123Trabajo De InvestigacióN De Sociedad123
Trabajo De InvestigacióN De Sociedad123guest17b72f
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro MerbPaul Pajo
 
Hacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at WorkHacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at WorkPaul Pajo
 
Tech island2014
Tech island2014Tech island2014
Tech island2014Paul Pajo
 
Ciclo Sup. Mantenimiento de Instalaciones térmicas y de fluidos
Ciclo Sup. Mantenimiento de Instalaciones térmicas y de fluidosCiclo Sup. Mantenimiento de Instalaciones térmicas y de fluidos
Ciclo Sup. Mantenimiento de Instalaciones térmicas y de fluidosTic Eraiken
 

Viewers also liked (6)

Trabajo De InvestigacióN De Sociedad123
Trabajo De InvestigacióN De Sociedad123Trabajo De InvestigacióN De Sociedad123
Trabajo De InvestigacióN De Sociedad123
 
Gracias
GraciasGracias
Gracias
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro Merb
 
Hacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at WorkHacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at Work
 
Tech island2014
Tech island2014Tech island2014
Tech island2014
 
Ciclo Sup. Mantenimiento de Instalaciones térmicas y de fluidos
Ciclo Sup. Mantenimiento de Instalaciones térmicas y de fluidosCiclo Sup. Mantenimiento de Instalaciones térmicas y de fluidos
Ciclo Sup. Mantenimiento de Instalaciones térmicas y de fluidos
 

Similar to Practical Intro Merb

Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUGMatt Aimonetti
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
Merb Presentation
Merb PresentationMerb Presentation
Merb Presentationgueste4d7fc
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvmdeimos
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deploymentAbhishek Singh
 
Merb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksMerb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksRowan Hick
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Rails on JRuby
Rails on JRubyRails on JRuby
Rails on JRubyRob C
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentationweb25
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyelliando dias
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Rubymattmatt
 
The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018Charles Nutter
 
Rails hosting
Rails hostingRails hosting
Rails hostingwonko
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGTomek Borek
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 NotesRoss Lawley
 

Similar to Practical Intro Merb (20)

Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUG
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
re7olabini
re7olabinire7olabini
re7olabini
 
Merb Presentation
Merb PresentationMerb Presentation
Merb Presentation
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deployment
 
Scaling the Rails
Scaling the RailsScaling the Rails
Scaling the Rails
 
Merb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksMerb The Super Bike Of Frameworks
Merb The Super Bike Of Frameworks
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Rails on JRuby
Rails on JRubyRails on JRuby
Rails on JRuby
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentation
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRuby
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Ruby
 
Merb + Nanite
Merb + NaniteMerb + Nanite
Merb + Nanite
 
The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018
 
Rails hosting
Rails hostingRails hosting
Rails hosting
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUG
 
Spark Tips & Tricks
Spark Tips & TricksSpark Tips & Tricks
Spark Tips & Tricks
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 

More from Paul Pajo

Geeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App TrendsGeeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App TrendsPaul Pajo
 
Have Code, Will Compete
Have Code, Will CompeteHave Code, Will Compete
Have Code, Will CompetePaul Pajo
 
My excel reviewer
My excel reviewer My excel reviewer
My excel reviewer Paul Pajo
 
Using Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb WorksUsing Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb WorksPaul Pajo
 
Social Network-Driven Voter's Education
Social Network-Driven Voter's EducationSocial Network-Driven Voter's Education
Social Network-Driven Voter's EducationPaul Pajo
 
Presidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity SurveyPresidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity SurveyPaul Pajo
 
Principal Factors Analysis on IS Survey
Principal Factors Analysis on IS SurveyPrincipal Factors Analysis on IS Survey
Principal Factors Analysis on IS SurveyPaul Pajo
 
Principal Factors Analysis of IS Survey
Principal Factors Analysis of IS SurveyPrincipal Factors Analysis of IS Survey
Principal Factors Analysis of IS SurveyPaul Pajo
 
Cloud Computing Nist Paul Pajo
Cloud Computing Nist Paul PajoCloud Computing Nist Paul Pajo
Cloud Computing Nist Paul PajoPaul Pajo
 
I made something people want
I made something people wantI made something people want
I made something people wantPaul Pajo
 
ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009Paul Pajo
 
Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009Paul Pajo
 
Drip In Cultural Commons
Drip In Cultural CommonsDrip In Cultural Commons
Drip In Cultural CommonsPaul Pajo
 
Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009Paul Pajo
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon RailsPaul Pajo
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationPaul Pajo
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails PresentationPaul Pajo
 
Introduction To Business Ethics
Introduction To Business EthicsIntroduction To Business Ethics
Introduction To Business EthicsPaul Pajo
 
P I C S Ecommerce In The Region E Not What It Used To Be V2
P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2
P I C S Ecommerce In The Region E Not What It Used To Be V2Paul Pajo
 
talentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural Mandatetalentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural MandatePaul Pajo
 

More from Paul Pajo (20)

Geeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App TrendsGeeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App Trends
 
Have Code, Will Compete
Have Code, Will CompeteHave Code, Will Compete
Have Code, Will Compete
 
My excel reviewer
My excel reviewer My excel reviewer
My excel reviewer
 
Using Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb WorksUsing Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb Works
 
Social Network-Driven Voter's Education
Social Network-Driven Voter's EducationSocial Network-Driven Voter's Education
Social Network-Driven Voter's Education
 
Presidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity SurveyPresidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity Survey
 
Principal Factors Analysis on IS Survey
Principal Factors Analysis on IS SurveyPrincipal Factors Analysis on IS Survey
Principal Factors Analysis on IS Survey
 
Principal Factors Analysis of IS Survey
Principal Factors Analysis of IS SurveyPrincipal Factors Analysis of IS Survey
Principal Factors Analysis of IS Survey
 
Cloud Computing Nist Paul Pajo
Cloud Computing Nist Paul PajoCloud Computing Nist Paul Pajo
Cloud Computing Nist Paul Pajo
 
I made something people want
I made something people wantI made something people want
I made something people want
 
ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009
 
Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009
 
Drip In Cultural Commons
Drip In Cultural CommonsDrip In Cultural Commons
Drip In Cultural Commons
 
Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon Rails
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails Presentation
 
Introduction To Business Ethics
Introduction To Business EthicsIntroduction To Business Ethics
Introduction To Business Ethics
 
P I C S Ecommerce In The Region E Not What It Used To Be V2
P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2
P I C S Ecommerce In The Region E Not What It Used To Be V2
 
talentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural Mandatetalentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural Mandate
 

Recently uploaded

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 

Recently uploaded (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 

Practical Intro Merb

  • 1. Merb, not rails? ! A practical introduction to a new framework.
  • 3. What is merb? • MVC Framework. • Similar to Rails. • Lightweight, extensible, fast.
  • 4. Merb Ideology • Hacker-friendly. • Core should be small, plugins bountiful. • Code should be as simple as possible. • Code should not be “magical.”
  • 5. Merb is like rails • Application structure is very similar • Can use ActiveRecord
  • 6. What does merb-core include? • rack-based request handling • session handling • before / after filters • layouts / views with erb • routing
  • 7. What does merb-core include? • gem-based plugins • mailers • partials • exceptions • generator for controllers, and models (integrates with your chosen ORM).
  • 8. What is elsewhere? • an ORM (can use ActiveRecord, DataMapper, Sequel) • form helpers such as form_for (merb_helper) • ActiveSupport and all those little ruby extensions (extlib?)
  • 9. What is elsewhere? • flash (merb_has_flash and redirect :message) • redirect(quot;/posts/34quot;, :message => { :notice => 'Post updated successfully!' }) • scaffolding • caching (merb-cache) • ajax library (merb_jquery)
  • 10. DataMapper • Thread-safe. • Supports data stores you don’t manage. • Optimizations in eager-loading, lazy-loading, etc.
  • 11. What do we need helper functions for? • Why not just use HTML for templating instead of all those helper functions? • Why not just use JQuery for AJAX instead of all those AJAX helper functions?
  • 12. Thread-safety • Merb is thread-safe now. • Rails will be thread-safe in 2.2. • What does that mean? http:// blog.headius.com/2008/08/qa-what-thread- safe-rails-means.html
  • 13. Considerations • Does your app block? • File uploads • Remote HTTP calls • Facebook app: 1-2s wait time? • Do you have native threads? • JRuby / C ruby differences
  • 14. Instances Required Merb Rails C MRI, one core, no blocking 1 1 C MRI, one core, 80% blocking 1 5 C MRI, two cores, no blocking 2 2 C MRI, two core, 80% blocking 2 10 Jruby, one core, no blocking 1 1 Jruby, one core, 80% blocking 1 5 Jruby, two cores, no blocking 1 2 Jruby, two core, 80% blocking 1 10 Jruby, 16 cores, 80% blocking 1 80
  • 15.
  • 17. The Project • CMS for Faculty. • Keeps track of courses, education, biography info, etc. • Deployed to Tomcat.
  • 18. Requirements • 2500 faculty websites. • 5 concurrent backend users. • 500 users per day on the public facing pages.
  • 19. Can Rails handle that? • One process per file upload? • RAM requirements?
  • 20. Why merb? • Thread-safe. • Low memory footprint. • ???
  • 21. Why JRuby? • Authentication integration using JRadius • Java platform lowers IT stress level.
  • 22. What is development like? • There are no books... yet. • The codebase is changing. • Smaller userbase than rails. • If you are doing anything weird, be prepared to corepatch!
  • 23. Problems • File upload broken in Tomcat deploy. • Partial behavior is totally weird. • Render syntax changed / broke export code. • Activerecord-jdbc mysql quote error. • String concurrency problem??
  • 24. Other Issues • acts_as_list had to be extracted from ActiveRecord files and manually included in init.rb.
  • 26. Speed Comparison • Test with simple merb / rails apps using ActiveRecord • Tests using ab -n 10000 • Testing serially, not concurrently. • Tested on this MacBook Pro
  • 27. C MRI Mongrel • Merb: 170 requests / second • Rails: 32 requests / second
  • 28. JRuby Tomcat • Merb: 69 requests / second • Rails : 121 requests / second
  • 29. JRuby Mongrel • Merb: 104 requests / second • Rails: 29 requests / second
  • 30. JRuby Glassfish • Merb: 106 requests / second • Rails : 125 requests / second
  • 31. What is the deal? • JRuby thread pool, instead of thread instantiation? • Default session handling? • Overspinning threads in app server? • Incorrect JIT compilation?
  • 32. Tomcat Memory Usage • Merb: ~30 MB for all threads • Rails: ~60 MB+ additional memory per process • (Tested on Tomcat)
  • 33. Was it worth it? • Thread-safety is a minor advantage when it comes to file uploads. • Merb uses less memory. • Merb is slower than rails. • Merb may die on string thread-safe bug until JRuby / Merb team fix it.
  • 35. Consider merb if... • you’re writing a small tool. • you have limited memory requirements. • you like trying new ORMs. • you need fast performance (and you’ve figured out why it runs so slow on JRuby). • you like hacking about in frameworks.
  • 36. Upcoming • Merb 1.0 is released Oct 11-12. • MerbCamp is in San Diego Oct 11-12. • Merb in Action book (2009?).
  • 37. Available • I’m available for contracts again. Talk to me here, at 408-646-2240 or paulboone@mindbucket.com. • http://www.mindbucket.com/