Can two Rails versions use one database?

63 views
Skip to first unread message

Russ S

unread,
Jan 30, 2014, 4:13:58 PM1/30/14
to rubyonra...@googlegroups.com
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.

So, we are searching for creative solutions to the upgrade problem. One idea is to start rewriting the application in Rails 4 and run it alongside the Rails 1 application. As features are added to the Rails 4 version, the same feature in the Rails 1 version could be taken offline. Users would see a mix of the two versions. Some pages would be served by Rails 1 and others by Rails 4.

This would require both the Rails 1 and Rails 4 versions to use the same database.

So my question is, will this work? What problems with this approach should we be anticipating? We know it isn't a perfect solution, but we're hoping it's good enough to drive the project forward.

Walter Lee Davis

unread,
Jan 30, 2014, 5:14:21 PM1/30/14
to rubyonra...@googlegroups.com
You may want to watch this talk, from last year's Railsconf. https://www.youtube.com/watch?v=xi7z-vGNNGw Now this isn't moving quite as far as you want to go, but it still might be instructional.

Walter
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fab938fc-b987-4645-aafb-4286af3ba75c%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Jim

unread,
Jan 31, 2014, 8:11:33 AM1/31/14
to rubyonra...@googlegroups.com
On Thursday, January 30, 2014 4:13:58 PM UTC-5, Russ S wrote:
So, we are searching for creative solutions to the upgrade problem. One idea is to start rewriting the application in Rails 4 and run it alongside the Rails 1 application. As features are added to the Rails 4 version, the same feature in the Rails 1 version could be taken offline. Users would see a mix of the two versions. Some pages would be served by Rails 1 and others by Rails 4.

This would require both the Rails 1 and Rails 4 versions to use the same database.

So my question is, will this work? What problems with this approach should we be anticipating? We know it isn't a perfect solution, but we're hoping it's good enough to drive the project forward.

The thing to consider most carefully is how you will be able to run the single website from two different rails apps.  Things like linking between them, sharing authentication, session variables like session and flash, stuff like that.  Databases are inherently multi-user systems so you're not so likely to run into problems with the database itself unless you are using sqlite, although I'm not so familiar with Rails 1 ActiveRecord mechanisms anymore.

Russ S

unread,
Feb 5, 2014, 11:51:38 AM2/5/14
to rubyonra...@googlegroups.com
Thanks Walter and Jim for your feedback. The Railsconf talk was indeed informative, although we are still leaning against an upgrade path and are more likely to choose a rewrite-based approach. Jim, I hadn't thought about the flash, so thanks for pointing that out. I think we can probably manage by limiting flash feedback to one site or the other. We might have to make some workflows slightly more complicated for that to work.

Russ

Robert Walker

unread,
Feb 5, 2014, 3:10:46 PM2/5/14
to rubyonra...@googlegroups.com
Russ Dast wrote in post #1135683:
> Thanks Walter and Jim for your feedback. The Railsconf talk was indeed
> informative, although we are still leaning against an upgrade path and
> are
> more likely to choose a rewrite-based approach. Jim, I hadn't thought
> about
> the flash, so thanks for pointing that out. I think we can probably
> manage
> by limiting flash feedback to one site or the other. We might have to
> make
> some workflows slightly more complicated for that to work.

I think the point was you'll need to deal with session sharing as a
whole. The flash is really just stored in the session anyway, so if you
solve the session issue then you solve the flash issue along with it.

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages