Coldfusion 到 Rails 的迁移,Java 代码不变

发布于 2024-11-19 07:25:14 字数 474 浏览 2 评论 0原文

我们使用普通的 Coldfusion 9(提供 html 内容)和 Java(后端工作并连接到 Web 服务)构建了一个 Web 应用程序。我们预计每天约有 50,000 名访客,每分钟最多 200 个请求。生产服务器在 Windows 上运行。 问题是我们因为痛苦的 CF 代码而感到疲倦和愤怒。

我们的想法是用 Ruby on Rails 替换 CF 层。 java 方面应该保持不变,因为它编写得很好、可靠、快速并且覆盖了自动化测试。

所以我的问题是:您将如何详细解决这个问题?

  1. JRuby 是唯一的选择吗?
  2. 调用我们的 jar 包 Java 代码是否仍然足够快?
  3. 切换到 Rails 时是否还需要 Linux? (我不喜欢 Windows 上的 Rails)
  4. 可扩展性怎么样?您推荐 Sinatra 来处理我们的流量吗?
  5. 是否可以将此配置放置在云中?

提前致谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一抹淡然 2024-11-26 07:25:14

如果您愿意,您应该尝试一下 ColdFusion on Wheels 框架。它的灵感来自 Rails,您可以轻松地将当前应用程序放入框架中,然后慢慢将其转换为 MVC。

请访问:http://cfwheels.org/

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/

红尘作伴 2024-11-26 07:25:14

我在很大程度上同意 Ciaran Archer 的想法,并将指出一个项目,我在该项目中逐步将 Spring 应用程序转换为 Rails。您必须发挥您的想象力来弄清楚如何将杂乱的 CF 视图转换为 Rails,但您至少可以看看如何在 Rails 环境中使用 Java 后端。

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

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

娜些时光,永不杰束 2024-11-26 07:25:14

JRuby 是唯一的选择吗?

说话不要绝对! :) JRuby 的优点是能够调用 CF 等 Java 库,但它仍然是一个新兴平台,尽管它在 JVM 上具有巨大潜力。

将调用我们的jar包Java
代码仍然足够快吗?

如果您仍打算在 CF 或 JRuby 等 JVM 语言上运行,那么我会说是的。

切换时是否需要 Linux
到轨道? (我不喜欢 Rails
Windows)

JRuby 不需要 Linux(请参阅此处) - 请记住 JRuby 只是另一种 JVM 语言, JVM 的好处是平台独立性。如果您打算使用普通 Rails,我建议您使用 Linux - 我之前曾尝试在 Windows 上使用 Rails,但效果并不理想。你读到的所有关于 Rails 教程等的内容都将假定 Linux 是有利的。

可扩展性怎么样?你
推荐 Sinatra 来处理我们的
交通?

Sinatra 是一个非常精简的框架,它本质上使用简单的正则表达式路由规则。我会将其用于小型项目,但对于可能增长的生产应用程序,则不会。您最好获得 Rails 的组织优势。

可以把这个
在云中配置?

相信 Engine Yard做JRuby托管。 Heroku 做 Rails PaaS 托管。如果您使用 JRuby 或从 JRuby 调用 Java,Heroku 可能不太适合,但对于普通的 Rails 应用程序来说,它非常酷。

正如其他人指出的那样 - CF 不是问题,问题在于您的应用程序是如何编写和组织的。请记住,您也可以编写垃圾 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文