Migrating ITsax.de and 6 other portals to Rails

on under developer
3 minute read

Out Of Date Warning

This article was published on 01/06/2014, this means the content may be out of date or no longer relevant.
You should verify that the technical information in this article is still up to date before relying upon it for your own purposes.

Recently, we deployed a huge milestone: Converting our dusty old PHP job-boards to Ruby on Rails. As these job boards are the integral part of our company's online operations, we agreed that they deserved more attention so we decided to cut this huge chunk of remaining PHP software from our technical landscape. I will not mock PHP, as it served well and was easy to understand but I will also not miss it.

After having run a few days smoothly, setting up a bunch of 301 redirects, here are some of the facts:

Backend

The apps are running on Ruby 2.1.1 with Ruby on Rails 4.1.1. For the app-server, we are using Passenger, which is a joy to manage. The webserver with SSL-termination is Nginx. As a database, we are using PostgreSQL and Redis as cache and lock store. Together with the Empfehlungsbund, we created an ElasticSearch micro cluster – Jobs are written by the Empfehlungsbund, and the portals can access them via the cluster directly. The server is setup up via Ansible (I am planning to partially release the Rails role I created). Last weekend, we deployed all of our 7 job boards at once: ITsax.de, ITmitte.de, MINTsax.de, OFFICEsax.de, OFFICEmitte.de, ITbbb.de, and ITbavaria.de – all are using identical software with different, database saved configuration and different images/colors. All of the 7 portals running on one single, SSD-powered host. By using Rails and SSD, we are now able to serve with average response times cut by half. As with all of our Rails apps, we apply centralized logging via Graylog2 and exception tracking through Errbit.

Frontend

Of course, we are using Twitter Bootstrap for our responsive design, as we are familiar with it from former projects and it's popularity makes it easy to integrate, like with SimpleForm or pagination templates. We went with the document based approach, that Ruby on Rails covers perfectly and added some JavaScript functionality here and there: draggable Job Cart, various BS-affixis, and animated number search. We discussed making a Single Page App with Angular, but discarded the idea quickly, as the site should be usable without JavaScript. Another reason is to make it easier for bots – not only Google and co., but also things like Facebook and Twitter, which hit your site to parse the og-tags and various Jobcrawlers which all have different capabilities and might or might not be able to render JS. As the Rails gold standard, we used Sass and CoffeeScript which allowed faster development for us. I am very happy that we got rid of so many sites, sidebar-elements and other clutter.

Architecture

We are using a centralized architecture, with Empfehlungsbund in the center. Companies and admins log in there to modify data. Background worker will synchronize those changes via an API to the portals within seconds. So, there is no user login on the apps, job application data is only stored temporarily, statistics are synced back every day. With this kind of setup, we are able to be very flexible in the future, when spreading apps to different servers or creating new job boards.

Finishing this project in the last weeks, took away a great deal of time, which is why I didn't post anything recently. This will change in the upcoming weeks.