# Rails or Java J2EE (Spring, Struts Shale) - scalabilty

**URL:** <https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870>\
**Category:** Rails\
**Created:** [January 19, 2006, 9:40pm UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870 "2006-01-19T21:40:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 19, 2006, 9:40pm UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/1 "2006-01-19T21:40:51Z")

</div>

Hi,

normally I am doing all my webprojects with PHP. But now I am planning  
to use a framework, either Ruby On Rails, or Java in particular J2EE  
with Java Spring, or Struts Shale.

Well, I already tried RoR a few month ago, so I am simply comparing it  
to the Java alternatives now. My problem is, that maybe using Java for  
my projects is like using a dredger to grub a small hole 🙂 But on the  
other hand I don’t know, how heavily my next project will be used. Maybe  
I have 50 requests per second, or only 50 requests per hour. I only have  
one server for this project (1,5 GHz, 512 MB RAM) and I am not sure, if  
ruby on rails can manage 50 requests per second. Any experiences?

I don’t know, how Tomcat behaves compared to ruby on rails. Does anybody  
know, which one scales better? Which one needs more Cpu Power, or memory  
usage? PHP seems to use less memory, or cpu power compared to RoR. Or  
would it be possible to run similar webapps like amazon, or ebay with  
RoR? (Having enough server capacity assumed)

With Java it is possible to share the application on several servers (if  
this case should occur). Is this possible with RoR too?

Greetings

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 19, 2006, 9:49pm UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/2 "2006-01-19T21:49:54Z")

</div>

On 1/19/06, Michael G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> other hand I don’t know, how heavily my next project will be used. Maybe  
> I have 50 requests per second, or only 50 requests per hour. I only have  
> one server for this project (1,5 GHz, 512 MB RAM) and I am not sure, if  
> ruby on rails can manage 50 requests per second. Any experiences?

This all depends on what sort of work your app is doing. The # of  
requests  
you can handle per second will vary so widely that without a better idea  
of  
what you’re doing, it’s almost impossible to say.

I don’t know, how Tomcat behaves compared to ruby on rails. Does anybody

> know, which one scales better? Which one needs more Cpu Power, or memory  
> usage? PHP seems to use less memory, or cpu power compared to RoR. Or  
> would it be possible to run similar webapps like amazon, or ebay with  
> RoR? (Having enough server capacity assumed)

With enough server capacity, RoR can scale quite well. Raw performance  
numbers are usually a bit lower than Java due to the fact that RoR is  
interpreted, while Java is byte-compiled. Ruby is not the language to  
use  
if you need to eke out every last bit of performance from a given piece  
of  
hardware. With the price of hardware nowadays, this is almost never an  
issue.

With Java it is possible to share the application on several servers (if

> this case should occur). Is this possible with RoR too?

Using FastCGI (maybe SCGI but I haven’t looked into it), you can  
distribute  
RoR apps w/ load balancing across many servers.

Greetings

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 19, 2006, 10:59pm UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/3 "2006-01-19T22:59:33Z")

</div>

Scalability is manageable. Code that is completely obtuse and verbose  
and just plain ugly is not. Use Ruby.

Mike P.  
Enterprise Java Developer

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 19, 2006, 11:57pm UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/4 "2006-01-19T23:57:02Z")

</div>

Hi,

you are working with JavaEE? Do you use it at work? And in your free  
time RoR?

I’ve read some articles about the next version of struts, struts shale.  
Have you ever heard about? Do you think, this will change the situation?  
Or not?

Greetings

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 19, 2006, 10:56pm UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/5 "2006-01-19T22:56:32Z")

</div>

Hi,

first thanks for your answer.

> This all depends on what sort of work your app is doing. The # of  
> requests you can handle per second will vary so widely that without a  
> better idea of what you’re doing, it’s almost impossible to say.

Hm yeah this is right of course.

> With enough server capacity, RoR can scale quite well. Raw  
> performance numbers are usually a bit lower than Java due to the fact  
> that RoR is interpreted, while Java is byte-compiled. Ruby is not the  
> language to use if you need to eke out every last bit of performance  
> from a given piece of hardware. With the price of hardware nowadays,  
> this is almost never an issue.

Ok, but Ruby will have bytecode in the future too. So this is only a  
disadvantage at the moment 🙂 This will change I guess.

> Using FastCGI (maybe SCGI but I haven’t looked into it), you can  
> distribute RoR apps w/ load balancing across many servers.

This sounds really nice. Thanks

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 20, 2006, 12:57am UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/6 "2006-01-20T00:57:24Z")

</div>

Hi,

thanks for your answer. This helps me a little bit to decide.

Normally I would use RoR for home, because I am really fast in  
developing with it.

But on the other hand: I would learn more with J2EE, because I don’t  
have any experiences in J2EE, Struts and Co. Maybe this is more useful,  
than simply bringing a new webproject up and running, because the  
project is only for myself and not for a customer.

Hm, difficult.

Greetings

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 20, 2006, 12:27am UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/7 "2006-01-20T00:27:13Z")

</div>

I am a fulltime Java programmer but have recently switch to coding  
rails at home. At work we spent a significant amount of time bringing  
together and customizing Struts, Tiles, an ORM, Ant and JUnit into a  
single cohesive package.

This was well before I knew anything about rails, and as you know,  
rails comes with all this functionality built in and in a standardized  
fashion to boot. Fairly depressing.

This means that comparing RoR to Struts (at least how Struts works  
currently) is not adequate, because Struts does not contain a data  
persistence layer, a pre-configured build process and a built-in  
testing framework. All these pieces are scattered about various open  
source projects, albeit mostly of the Jakarta flavor.

Also Rails contains a more extensive “best-practices layer” in all its  
components, meaning that it encourages you to write test cases and use  
a automated build process from the start. You don’t have to get  
discouraged trying to set a test harness, it just runs.

Some Java project may pop up that mimics RoR, but I’m not aware of any  
that are there yet and that don’t use a godawful amount of XML in the  
process. I am disallusion with Spring, at least for web projects. Some  
PHP projects are around, but I haven’t messed with them yet.

My 2 cents.

-Theo

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [January 20, 2006, 1:00am UTC](https://www.ruby-forum.com/t/rails-or-java-j2ee-spring-struts-shale-scalabilty/52870/8 "2006-01-20T01:00:26Z")

</div>

Same on pretty much all counts here. I have done a lot in the Java  
space and most of the really cool stuff happening around Java is just  
attempts to make Java dynamic. To make Java more like Ruby by all  
kinds of abstractions around Java Beans, etc.

It gets so that every 100 lines of Java starts to look like 10 lines  
of Ruby just waiting to pop out.

I am hoping that Rails will free me from that misery soon.

Best,  
Mike P.
