Friday, May 15, 2009

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

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

The OTBS is developed using Ruby on Rails (RoR). RoR is a new development language for me. I need to learn the implementation of Model-View-Controller (MOV) pattern in RoR, and code that controls or manipulates the MySQL database associated with my OTBS application. The stores business logic for validating or formatting of data that be stored in the model layer. RoR is good in it's principle of Don't Repeat Yourself (DRY). Rails attempts to impose many best practice techniques and conventions on the developer in order to create web applications that composed both elegantly and correctly (Alameda 2008).

RoR provide the modern database-driven web application, but nothing is perfect (Alameda 2008):
  • The performance of RoR is a bit slower than other web technologies.
  • Rails is a bit more demanding to deploy when compared to other solution such as PHP.
  • The rapidly changing of the Rails, makes the Rails developers to continuously improve both the framework and the development practices.
  • Not really understanding the code by the developers when they commonly use the tools (scaffolding) to generate their applications. It is a risk when something goes wrong with the application or need to modify the code to handle a special circumstance.
If I need to develop a web application for my company, I will select Microsoft ASP .Net. ASP .Net is most commonly used in business environment. It provide a easily use graphic tools for us to develop of our application. We could find a lot of resource without difficultly on the Web or other aspect such as supporting from Microsoft, books, training course and developer certificate. The business feels more confident to develop their Web site by ASP .Net, than using other open source tools such as RoR.

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

When deploy applications for development or testing environment, we need to (Hartl & Prochazka, 2008):
  • Configure the production database connection in the file named database.yml.
  • Create database in the production server
  • Run the migration in Rails by using of 'rake' to construt tables in it
  • Stop the development server and start a new server in production environment by using the -e flag (>ruby script/server -e production)
Minimal production server (Hartl & Prochazka, 2008):
  • Using Mongrel / Linux OS / Apache Web server, as the Rails application server
  • Setup the same softwares (such as Ruby, Rails, database and plugins) on the server like the development computer
  • Upload the Rails project to the server, follow the deploy application steps at the above to create and configure the production database
  • Install and configure the application server and webserver
A single server running a single Mongrel process is probably sufficient for most Rails application. A single server can be kept adding new Mongrels until you run out of CPU time, at that stage a new servers need to be added. Although caching can minimize database hits, the database may eventually become the application botttleneck. When that point reach, an extra database server need to be added in a master-slave setup (Hartl & Prochazka, 2008).

Reference
  1. Alameda, E. (2008), Foundation rails 2, Apress and fiends of ED books.
  2. Hartl, M. and Prochazka, A. (2008), Railsspace: building a social networking website with ruby on rails, Person Education, Inc.

No comments:

Post a Comment