I'm working on a Rails 1 application. We'd like to upgrade it to Rails 3 or 4, but Rails 1 is so old that we think it would take a total rewrite to upgrade. There are management and budget issues with a total rewrite. We wouldn't be able to deliver anything until the entire rewritten application was finished.
Can two Rails versions use one database?
Posted 30 January 2014 - 10:04 PM
Posted 01 February 2014 - 01:10 PM
You are certainly correct as regards to re-write vs upgrade. The task to upgrade a Rails version 1 app would probably be greater than starting from scratch with a Rails 4 site.
The main issue I see you having with mixing the two together is the version of Ruby that Rails would need to work with version 1.8.xx whereas version 4 of Rails works best with Ruby 2.x
To cater for this you will need to ensure your gemsets remain separate. so you should be looking to use RVM or Rubyenv Both options are well documented and there are various railscasts on them at http://railscasts.com/
I see no issues with both apps hooking into the same database but in the process of developing the new site you may wish to make changes/enhancements to the DB structure that ay upset the original app. This needs very careful planning and I would advise a full design of the new app before making this decision.
The only other downside I can se is the potential for more resources needed on your web server. This will be down to the need to serve multiple apps from the same server. You may also wish to take advantage of the newer server options available to you (nginx and Unicorn are a fantastic combination) again this may upset your existing app. So think carefully about your hosting options.
Rails 1 was very buggy, there are a host of new features available in Rails 4 that would probably greatly benefit your app in terms of both functionality and development time.
If it was me making this decision, I would host a separate app on a separate server, start from scratch and I would set up redirects for new features as they come on line, bearing in mind that there may not be a direct page for page replacement in all circumstances. Then I would set up a process to enable the databases to keep in sync with each other.
I have no idea on the budget involved, or the complexities of the existing app or the requirement to re-write. I would be sceptical of any answer to this question (including mine) that is missing this information.
Hope it goes someway to helping you make your decision.
Programming is just about problem solving!
Posted 05 February 2014 - 04:56 PM
Thanks James. I think all of your arguments are sound, although we may try and serve both apps from the same webserver. Also, we will probably not design the new app much in advance. It will mostly be a feature-for-feature reimplementation of the current app, although we'll try and sneak in cosmetic and performance improvements. The warnings about Ruby versions and DB schema updates are sensible.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users