Using Ruby on Rails to build large sites?

Can you build a site using Ruby on Rails that can handle the traffic levels of Myspace?


Share Send to a friend Watch Report
 
 

6 Posted Answers
Order by

 
1 helpful answer

Of course you can.  Scalability is mostly a product of good planning, good seperation of components and good coding/selection of algorithms.  

The current in vogue method for scaling with ruby on rails is to use <a href="http://mongrel.rubyforge.org/">Mongrel</a> (ruby based web server) as your application server on the backend.  You can setup multiple servers running Mongrel to help you scale when you need to.  You then setup your front-end web server (Apache, LightHTTPD, whatever) to proxy requests to Mongrel and you can then setup various load balancing algorithms to distribute the load.  You can scale out the front-end web server instances as well by putting a hardware or linux based web load balancer in front of them.

Finally, if you develop a serious database backed web application you will likely find that one of the main bottlenecks is the database not the application code.  To alleviate this consider caching solutions like <a href="http://www.danga.com/memcached">memcached</a> which has good support built into ruby and rails.

Posted 2006-08-14T22:24:10Z
jmccaskey was invited by Yedda to answer this question.

Helpful?(5)
Rated as Best Answer
 
gtx
1 helpful answer

well, theoretically - there should not be anything preventing one from building a RoR service capable of sustaining a MySpace load factor.

However, I don't believe this has yet been done, and more importatntly, will defanetly require some unique & new solutions for problems that arise from heavy traffic like MySpace would have.

 

Posted 2006-08-14T23:40:56Z
 
16 helpful answers

I would say that it could handle it.  The largest aimplementation of RoR I know of is Penny Arcade and I don't recall it being down since they switched.

 www.penny-arcade.com

Posted 2006-08-15T01:17:03Z
 
8 helpful answers
Agile like Ninja 42squared

Yes, you can.  By using distributed technologies(memecached, etc..) you can use almost any programming structure to handle that type of load.  The areas you would have to watch is the underlying code, as you may want to code some of it in C or another compiled language so that it will be a little faster.

Posted 2006-08-19T02:02:13Z
hornbeck was invited by Yedda to answer this question.

 
4 helpful answers

the short answer is yes Smile

The long answer:

 Let's cover the basics.

* scalability has almost nothing to do with performance. Scalability is being able to add hardware and gain more throughput proportionaly to the hardware added.

* performance/speed is being able to do more on the same hardware. 

In fact, Ruby is a dog performance wise. It is definetly slower then perl, python and php. Benchmarks vary from twise as slow to as much as 5 times slower. Where Ruby and in particular Ruby on Rails shine though is speed and easy of development. So if you need 'speed' choose something else, if your concern is 'time to market' RoR is a great choice.

Now when we done with 'speed' let's look at 'scalability'.

To be able to scale to MySpace's size you need to get to a point of 'linear scalability'. i.e. when to serve 2x users you need 2x hardware.

Since you can easily add more frontends (running RoR, php, python whatever), the usual bottleneck in scalability is indeed a database. But the good thing is that sites like MySpace, Blogger, LoveJournal are fairly easily partitioned. i.e. my profile can sit at database db13, and your profile can sit at db37 thus solving the db bottleneck.

Problems start when you have some data that needs to be centralized, or shared between users. (For example you do some DB joins with users table and some other table, then that other table can not be easily partitioned). The are many techniques t osolve this problem (duplicating data, doing joins in application lever etc), but they are not related to RoR at all. it's all just carefull system architecture design. not trivial, but doable.

 

For a good primer on scaling web sites read Building Scalable Web Sites by Cal Henderson (flickr).

 

Hope this helps 

Posted 2006-09-09T05:36:54Z

Sign in to participate

Got an answer for sudonim? Would you like to comment on the posted answers, or vote for the one which you think is the best?

Sign up for a free account, or sign in (if you're already a member).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


Q:

Detecting tranactions in Ruby on Rails

I have a Ruby on Rails question: I need a way to detect if the code is executing under a transaction. So that I'll be able to ...
Submitted by pacman   3 years ago.
  • viewed 2607 times
Last answer posted 3 years ago by rholliday


Q:

Using Ruby for internal CRM app

I am about to start developing a new internal web application for the company I work for. It will be a lightweight CRM app ...
Submitted by Marti   3 years ago.
  • viewed 2423 times
Last answer posted 3 years ago by david_terrar


Q:

Rails Cascading Includes

Why can't I do cascading includes in ruby on rails: Tree.find(:first, :include => {:children => {:children => :children}}) I get ...
Submitted by richcollins   3 years ago.
  • viewed 482 times
Last answer posted 3 years ago by richcollins



» More...

Feed - Subscribe to changes to this Q&A Blog
ADVERTISEMENT
ADVERTISEMENT
AOL Autos Q&A is powered by Yedda an AOL Company
Copyright © 2006-2010, Yedda Inc. and respective copyright owners