Last fall, I began studying switching the NewsCloud Facebook application code over to a framework to help us improve the robustness of our code, the efficiency of our work and to make it easier for open source developers to collaborate on our project.
I looked most closely at CakePHP but had concerns about the breadth of documentation, tutorials and the comparative robustness of its developer community. I was also concerned by the departure of a leading Cake developer to start another new framework. Then, I began looking more closely at Ruby on Rails (RoR).
Moving away from PHP was not our first choice, but ultimately the advantages, robustness and relative maturity of RoR made it an ideal choice for us.
We began by prototyping a migration of our PHP code base and data architecture to RoR. The results of this work were impressive and conclusive. The speed of our progress and the quality of our prototype implementation led me to overwhelmingly favor continuing in this direction.
Developers can debate the value of various frameworks until the cows come home - each has its own strengths and weaknesses for particular applications. This is how RoR fits into our particular needs.
What are the advantages of migrating our code base to Ruby on Rails?
* RoR provides modular support for simultaneous publishing to multiple platforms: a Facebook application, a Web application with Facebook Connect, a mobile Web application (potentially iPhone & Android Applications too) and RSS/XML. For more information, see Facebooker and JqTouch.
* Multi-lingual support (via I18n) - for providing internationalized language support and multi-lingual applications e.g. click to select French, Spanish or English
* RoR uses a Model View Controller framework (MVC). All RoR applications are structured the same way vs. PHP where each application can have a different architecture. MVC makes it easier for partners or open source developers to jump into a project and get up to speed quickly. MVC makes development faster and more efficient with less bugs. The bugs that exist are generally easier to resolve.
* We hope that RoR will excite developers about the NewsCloud Facebook source code - RoR is a framework for the future, whereas PHP is an older programming language that lacks a framework. According to this blog post analysis of GitHub, the web-based code collaboration manager we use, "Ruby projects recruit contributors astoundingly well, with Python a close second. Java, Javascript and PHP projects, on the other hand, do particularly badly."
* RoR is extremely well documented and has a vibrant developer community. I was particularly impressed with Railscasts. There are many excellent plugins for enabling common functionality, and reducing the code we need to build from scratch.
* RoR supports HAML and SASS which simplify HTML/CSS code and will allow for easier customization of design skins for clients and open source adopters
* Rails applications offer easier solutions for deployment and hosting upgrades including forward and backward migrations of databases
* RoR applications are generally less vulnerable to security threats than PHP-based applications. Writing secure code should be easier with RoR.
* RoR provides a framework for automated test suites which over time can prove to be huge timesavers and help with validating and integrating work from open source community members.
* RoR provides an excellent suite of programming tools that make coding more efficient including the interactive console and rake command line utilities
* RoR can be easily integrated with HopToadApp, LighthouseApp and NewRelic for tracking errors, managing bugs and tuning/monitoring performance
What are some of the disadvantages of RoR?
* PHP developers would have to learn RoR to contribute to our RoR open source work. Some of our team has to increase its proficiency at RoR as well.
* RoR has a reputation for being difficult to scale partly due to high profile Twitter outages. We do not believe these kinds of issues will affect us or that they apply globally when proper practices are used. Also, most of our projects are moderate in size at this time.
* Our PHP architecture is capable of running multiple sites on a single code installation (which makes managing them easier). RoR, like Drupal for example, is best used with separate code installs for each site. However, RoR's deployment and migration capabilities make managing hosting much simpler than with PHP.
What will we do with our PHP codebase?
* We have updated our PHP codebase with an improved installer and some basic updates so that organizations and developers that wish to use it may do so simply and easily.
* We will continue hosting existing sites, but most will want to migrate them to the new RoR as soon as it is ready
* We will maintain an area in our open source community tools for PHP work. Whether some development continues in PHP within our open source community (with or without our hands-on support) will be determined by the level of interest.
In Conclusion
We hope you're as excited as we are by this migration. We expect to release an alpha of our Ruby on Rails codebase within the next month. Please stay tuned. Be sure to follow us on Twitter @newscloud.
You can join our online support discussion about Ruby on Rails here.
I also want to give a shout out to the GitHub and TenderApp folks for offering free services for open source projects like ours!
Recent Comments