使用 Rails 作为大型网站的框架 [英] Using Rails as a framework for a large website

查看:49
本文介绍了使用 Rails 作为大型网站的框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Rails(第 3 版)几个月了,我对这个框架相当了解.但是,我还没有开发一个提供大量数据库访问和用户交互的大型网站.

I've been playing around with Rails (version 3) for a few months now and I understand the framework fairly well. However, I have yet to develop a large website which offers lots of database access and user interaction.

我对以下内容持怀疑态度:

I'm fairly skeptical of the following:

  • Ruby 的速度和可扩展性(我听说它比大多数其他服务器端语言慢 10 倍).
  • Rails 作为框架的额外后台处理(多层次抽象).
  • 缺乏在 Rails 上运行的企业级网络应用(我能想到的只有 Groupon、Github 和 Hulu).
  • 环境的复杂性(nginx > mongrel > rails > ruby​​ > website).
  • 幕后 SQL 操作(我知道这些可以优化,但我肯定会错过一些).

出于这些原因,我不确定是继续使用 Rails 还是改用基于更高性能语言构建的语言……比如 Java Spring.

For these reasons, I'm unsure whether to continue using Rails or to switch to something that is built ontop a more performant language .. say Java Spring.

请指教:)

推荐答案

又不是速度和缩放的讨论?

Not the speed and scaling discussion again?

在 web 开发中,最慢的是网络通信(接收请求,取回所有数据)、数据库(从数据库中获取所有数据),而且大多数时候它与计算无关时间.

In webdevelopment the things that are the slowest is the network communication (receiving the request, getting al your data back), the database (getting all your data from the database), and most of the times it is not about the computation time at all.

虽然 Ruby 和 Ruby on Rails 似乎更关注程序员的快乐,但我认为每个用 .NET 或 Java 构建的不错的 Web 应用程序都具有同样多的抽象级别.

While it is true that Ruby and Ruby on Rails seem more focused on programmer happiness, I think that every decent web-application built in .NET or Java has as many levels of abstraction.

环境的复杂性?我想你的意思是部署?有很多选项,但最常用的选项是 Passenger(在 apache 或nginx) 或 Torquebox.Torquebox 目前是最快、最好的扩展解决方案(基于 JBoss 应用服务器),Ruby 社区中的几个大牌都将 Jruby 称为部署应用程序的选择实现.虽然 AFAIK 最常见的部署仍然是使用 REE(Ruby 企业版)和Passenger.

The complexity of the environment? I think you mean deploying? There are a lot of options, but the most used options are Passenger (very easy deployment on top of an apache or nginx), or Torquebox. Torquebox for the moment is the fastest, best scaling solution (based on JBoss Application server), and several big names in the Ruby community are calling Jruby the implementation of choise to deploy your applications. While AFAIK the commonest deploy still is using REE (Ruby Enterprise Edition) and Passenger.

除非您知道您将不得不进行严肃的数学运算、cpu 密集型运算,否则我认为您应该问自己的问题是:哪种框架/语言会给我最快的结果?

Unless you know you are going to have to do serious mathematical, cpu-intensive operations, I think the question you should ask yourself is: which framework/language will give me the quickest result?

如果您非常精通 Java/Spring,那可能就是您的答案.但是,如果您唯一担心的是总体性能,我会说:不要犹豫,选择 Ruby on Rails.开发是一种纯粹的乐趣.如果您遇到任何问题,ruby 社区真的很棒:支持就在一个帖子之外.

If you are very proficient in Java/Spring, that might be the answer for you. But if your only worry is performance in general, I would say: do not hesitate and go for Ruby on Rails. It is a pure joy to develop in. The ruby community is really awesome if you would encounter any issues: support is just a post away.

最后,我想添加几个使用 Rails 的非常大的网站:LinkedIn 正在使用 Rails(和 jruby),而 Twitter 仍然使用 Rails 作为他们的前端.

And to conclude, I want to add a few very big sites using Rails: LinkedIn is using rails (and jruby), and Twitter still is using Rails for their frontend.

这篇关于使用 Rails 作为大型网站的框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆