Sunday, May 16, 2010

Workshop 7: End of the Line: production site migration and maintenance

Topic objectives

Upon the completion of this workshop, developers or managers should be able to:
· Discuss and choose the Rails production deployment configuration;
· Identify and evaluate the ways to take move the development site on your computer to the online production site;
· Evaluate and devise how to integrate a new Rails site into an existing or future e-commerce structure;
· Conclude the development of the OTBS as a Ruby on Rails application;
· Think critically and analytically about the policy for site maintenance and further development.
· Share your findings with your peers and examine what the other team is doing.

Topic reading from Safari Books Online

Hartl, M & Prochazka, A, (2008). RailsSpace: Building a Social Networking Website with Ruby on Rails, Pearson Education

This workshop continues to use your reading of the ‘RailsSpace’ online book and use of other online sites.

Both teams of developers and IT managers examine the Rails application deployment considerations as described at http://rubyonrails.org/deploy and in Chapter 17 of ‘RailsSpace’. This raises issues around which advice to follow in the migration of the Online Taxi Booking Service to the production site. Both teams consider which deployment and maintenance procedures to adopt.

Focus Question

As either a developer or as an IT manager, what are the options available when deploying and maintaining the Ruby on Rails application online?

Discussion Notes

We need to look for ways to automate the migration to the production site while keeping the configuration simple. This is a reminder of the earlier work on the ‘convention over configuration’ aspects of using Ruby on Rails. As a pre-requisite, developers will need to know about using Linux (or other UNIX variant) and its bash shell with sudo (admin) access and Subversion for version control. You should know where the logs for each piece of software running in your Rails application for fixing bugs.

When it comes to issues like scalability then the use of mongrel clusters and Linux for the OTBS on Rails handle scaling up well, but other options exist.

Here are a few to consider to automatically deploy and manage of the back end of your Rails application:

Phusion Passenger (modrails.com) aka mod_rails – a module for Apache
Jumpbox (jumpbox.com/app/rubyonrails) Ubuntu Linux environment
JRuby for J2EE using Glassfish and Warbler
IronRuby under .NET runs Rails and make use of the .NET libraries as you build the OTBS on top of ASP.NET or ASP.NET MVC

Tools like Mongrel (mongrel.rubyforge.org), Mongrel Cluster and version management systems like Subversion or Capistrano (capify.org) help with simplification and automation if used. Zed Shaw wrote Mongrel in 2006 as a Ruby Web server that converts a HTTP request to a CGI loading of the Ruby interpreter and this required less steps than using Apache and a faster performing Web server.

See mongrel.rubyforge.org/docs/apache.html for linking Apache to a Mongrel cluster.

Mongrel cluster is a gem install that runs several Mongrel processes under the same configuration issued by a proxy server like Nginx (nginx.net). Nginx is another simpler Web server that will handle the incoming HTTP requests either by itself or by proxying the those requests to the Mongrel processes in the cluster. Monit (mmonit.com/monit/) can be used to control process management.

Which way you choose to go will most likely depend upon:

The user interface and your own skills;
How quickly you are guided through deployment by admin tools that simplify management of the system;
System back-up, data security, virtualization and portability features:
Future-proofness: (grid computing or a cloud computing service);
How much time and money is saved by an efficient deployment and maintenance schedule.
Now move on to your team’s thread for a last time before workshop 8…


DEVELOPER’S THREAD (RED team)

To Do:

Developers conclude their work with the OTBS and look at the options for deployment of the site. Examine the various platforms/software tools used for deployment such as UNIX environment suggested in the Discussion Notes, Mongrel or Mongrel cluster, Nginx, Subversion or Capistrano (during development stage), JRuby in the Java environment.



Which way?

The choice is up to you as this workshop present just one option and you may like to use another, such as deploying the OTBS in a .NET or J2EE environment

For this project, we are suggested to use Ruby on Rails which is one of the many object oriented programming which is an open source web application framework in the market. With the deployment of another free database mySQL, which incorporate very well with into ROR that forms a strong and easy to use platform for developing e-commerce website on the fly.



Can you get the OTBS Running in production mode as a minimal production server?

Share your success by posting progress comments and links etc to the Developers sub-forum site that has been set up for the Red team.

To start with all these development work, I need to first install Ruby-on-Rails by install the RubyGems package. In order to get ROR working it is required to have RubyGems 1.3.6 installed as a package on my laptop which is running Windows XP and goes through all the update process.

For the database part, I used the most generic mySQL to avoid anything goes wrong. However, it still required to modify the config files and copy the dll libraries to solve compatibility issues before Ruby can successfully connect to the database and these takes me the longest time to troubleshoot as there is no single source to solve all these problems.

To get the OTBS running, the minimal requirement is to get the database setup properly and connect with Ruby successfully. The other steps like generating the models, generating the controllers and views are some basic and generic steps which you may find much easier and there are many tutorials or sample coding which are helpful on the web. Incorporating the code would be also very time consuming so you may require to break down the work into small pieces as function for easier fault isolation and troubleshooting.

No comments:

Post a Comment