开发者

Using Rails as a framework for a large website

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:

  • The Speed and Scalability of Ruby (I've heard that its up to 10 times slower than most other server-side languages).
  • The extra background processing that Rails as a framework (multiple levels开发者_Python百科 of abstration).
  • The lack of enterprise-level web apps that run on Rails (the only ones that I can think of Groupon, Github and Hulu).
  • The complexity of the environment (nginx > mongrel > rails > ruby > website).
  • The behind-the-scenes SQL operations (I know that these can be optimized, but I'm sure that I'll miss some).

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.

Please advise :)


There are tons of large sites and infrastructures in production that use Rails. This question has also been asked to death over the years of Rails being actively used for all manner of web apps, large and small.

Short version is that it is not the fastest language around but despite that scales fine if you know what you are doing. And you should have enough money to hire people that know what they are doing if you actually have any problems of scale.

Scaling any webapp is hard, use the language/framework you know. Programmer happiness is king.


You can get good performance with Ruby. Easy:

require 'inline'

inline :C do |builder|
  builder.c <<-C_CODE

  void run() {
    // Write your entire application in C here
  }

  C_CODE
end

run

Problem solved ;)


Not the speed and scaling discussion again?

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.

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.

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.

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?

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.

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜