Building web apps fast and easy using RoR - Chennai Geeks Sept' 2012

  |   Source

Today's Chennai Geeks meetup dealt with an introduction to the architecture and basics of app development using the Ruby on Rails web framework, by Magesh.

It was a full fledged tutorial, with Magesh showing a demo of a sample blog application being built, but I thought I'd share some of the gyan that came out of discussions and questions at the session.

Why Ruby?

Ruby is a programming language created by Yukihiro Matsumoto(just call him Mats), with the aim of making programming fun, by combining the best practices of languages like Smalltalk, Ada, Lisp and Perl. The syntax is extremely readable, and you don't have to be a coding ninja to understand Ruby code.

Why Rails?

Rails is a web framework introduced by DHH. Best practices in building web apps involved certain tasks, and the goal of Ruby on Rails was to automate these tasks. RoR uses the Model-View-Controller architecture pattern  to organize application development.

Wanna get started?

Some links to get started with Ruby and Rails, suggested by Magesh:

What makes it easy?
Keeping with the paradigm of Write once, Use everywhere, Rails has the concept of Gems, that are like plugins, and can be added to your app, and used with great ease.
There are gems available to take care of many features you'd want on your app, like auth, social integration; and before you write any code on Rails, you almost always can find a Gem to do it for you. But take care to choose the ones that are up to date and supported by the developer.
Some of the gems Magesh demoed were Devise, for auth, FB Graph, for posting to facebook and Omni Auth, for auth using any of the social networks.

Common Problems

  • There are so many versions of Ruby. Which one do you choose? - The most commonly used version is MRI-Ruby, preferred because all ruby plugins(gems) are supported and maintained for this version. Mac users tend to prefer MacRuby.
  • How do you handle version management, to switch between different versions of Ruby? - This can be done using a version management tool. Commonly used tool is RVM.

Deploying and scaling applications

  • What support does Rails have for building scalable apps? - Rails provides caching mechanisms and you can achieve performance gains by applying page, action, and fragment caching. It also has support for memcached.
  • Deploying Rails? One can choose between, Cloud infrastructure provider + Dev op engineer || Cloud infrastructure provider + a tool like Chef to take of deploying multiple servers || Heroku(that takes care of everything, but is a bit more expensive).
Two and half hours had flown by, and what an interesting session, and a nice framework to learn. One more framework added to my learning wishlist. Thanks Magesh!
Comments powered by Disqus
Share