开发者

Coldfusion to Rails migration with Java code unchanged

We've built a webapp using plain Coldfusion 9 (serving html content) and Java (backend work and connecting to WebServices). We're expecting about 50 000 visitors a day, up to 200 requests per minute. Production servers are running on Windows. The problem is that we're getting tired and angry because of painful CF code.

Our idea is to replace the CF layer with 开发者_开发问答Ruby on Rails. The java side should be left untouched, because it's well written, reliable, fast and covered with automated tests.

So my question is: how would you approach this problem in details?

  1. Is JRuby the only option?
  2. Will invoking our jar-packaged Java code be still fast enough?
  3. Is Linux required along with switching to Rails? (I don't like Rails on Windows)
  4. What about scalability? Do you recommend Sinatra to handle our traffic?
  5. Will it be possible to place this configuration in a cloud?

Thanks in advance


If you're willing you should give the ColdFusion on Wheels framework a try. It's VERY inspired by Rails and you could easily drop your current app into the framework and then slowly convert it over to MVC.

Check it out at: http://cfwheels.org/


I agree with Ciaran Archer's thoughts for the most part, and will point out a project where I incrementally convert a Spring application to Rails. You will have to use your imagination to figure out how to convert your messy CF views to Rails, but you can at least look to see how you might use your Java backend in a Rails environment.

https://github.com/nicksieger/refactoring-to-rails


Is JRuby the only option?

Don't speak in absolutes! :) JRuby has the benefit of being able to call Java libraries like CF, but it's still an emerging platform, albeit one with great potential on the JVM.

Will invoking our jar-packaged Java code be still fast enough?

If you are still going to run on a JVM language like CF or JRuby then I would say yes.

Is Linux required along with switching to Rails? (I don't like Rails on Windows)

Linux is not required for JRuby (see here) - remember JRuby is just another JVM language and the benefit of the JVM is platform independence. If you are going for plain Rails I would recommend going over to Linux - I've tried using Rails on Windows before and it's not pretty. Everything you read in terms of Rails tutorials etc. will assume a favour of Linux.

What about scalability? Do you recommend Sinatra to handle our traffic?

Sinatra is a very slimmed down framework which essentially uses simple regex routing rules. I would use it for small projects, but for a production application that is likely to grow, then no. You are better off getting the organisational benefits of Rails.

Will it be possible to place this configuration in a cloud?

I believe Engine Yard do JRuby hosting. Heroku do Rails PaaS hosting. Heroku might not be a good match if you are using JRuby or calling Java from JRuby, but for a plain Rails application it's very cool.

And as others have pointed out - CF is not the problem, the problem is how your application was written and organised. You can write crap Rails code too, remember.

Hoep all that helps you somewhat with your decision.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜