Background

Ruby on Rails (Rails) is a software framework for building Web Application.

Features:

  • Building using the Ruby programming language.
  • Open source - MIT License.
  • Provides a full stack - back-end data store to front-end presentation of web pages, and everything in between.
  • Released in 2004, and has continued to evolve rapidly.
Some sites built using Rails: Twiter Hulu GitHub Yellow Pages and Funny or Die

Rails - What's Inside

  • Rails is a Ruby gem (a gem is a prepackaged Ruby application or library)
  • Rails includes an extensive set of code generators, automated testing script and other features that are intended to make the job of programming a web application easier.
  • A suite of additional tools are provided as part of the Rails ecosystem that make it easy to deploy a fully-functional web application:
    • Rake - comes from RubyMAKE, i.e. it's utility similar to the UNIX make. You use it to create and migrate databases, clear
    • web session data, etc.
    • WEBrick - web server for hosting Rails web application. Can also use other web servers, e.g. Apache, Thin, Unicorn, etc
    • SQLite - a simple database engine pre-installed with Rails. It is perfect for development. When you go to production, you can simply switch to something like MySQL or a post grasp production database.
    • Rack Middleware – standardized interface for interaction between web server and web application

Model-View-Controller

The Rails framework is built around the Model-View-Controller (MVC) design pattern:

rails Model-View-Controller

Rails Criticisms

It doesn't scale - High profile issues at Twiter.

It is magic - The framework and code generation means you really don't know what's going on "under the hood"

Our answer - It is all a part of the natural progression

Bits → Assembly → HLL → OOP → Frameworks

“The point is that the cost per request is plummeting, but the cost of programming is not. Thus, we have to find ways to trade efficiency in the runtime for efficiency in the ‘thought time’ in order to make the development of applications cheaper. I believed we’ve long since entered an age where simplicity of development and maintenance is where the real value lies.”

David Heinemeier Hansson