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?

Would you like to answer or comment?

Sign up for a free account, or sign in (if you're already a member).
Share Send to a friend Watch Report
 
 

Posted Answers

Order by
 
5 thumbs up

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 2 years ago ( permalink )
In reply to sudonim's question
jmccaskey was invited by Yedda to answer this question.

Rated as
Best Answer
0
5

Helpful?

line
line
line



 
gtx
2 thumbs up

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 2 years ago ( permalink )
In reply to sudonim's question
Rated as
#2 out of 6
0
2

Helpful?

line
line
line



 

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 2 years ago ( permalink )
In reply to gtx's answer
Rated as
#3 out of 6
0
2

Helpful?

line
line
line



 
16 thumbs up
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 2 years ago ( permalink )
In reply to sudonim's question
hornbeck was invited by Yedda to answer this question.

Rated as
#4 out of 6
1
2

Helpful?

line
line
line



 
13 thumbs up

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 2 years ago ( permalink )
In reply to sudonim's question
Rated as
#5 out of 6
0
1

Helpful?

line
line
line