Play! framework against Ruby on Rails

This will not be a general comparison request:

Play! The framework is based on Java based , which means that the code is interpreted in bytecode and then compiled by the JVM at runtime. Ruby , on the other hand, is a dynamic language , which means that the code is interpreted with every request. This, of course, is obvious to every programmer.

Another aspect is the development process and the ease of the language (strong typing and weak typing).

I am currently developing a new site using Play! So for the questions:

  • Performance for an HTTP server (Play! Runs on the JVM, Ruby is dynamic) - is this really important for a website? will you see significant differences?
  • I feel that RoR has a much larger community, sources, tutorials, etc. and it beats me a little. Or should it be?
+8
java performance ruby ruby-on-rails
source share
2 answers

There are many differences between the two models. Regarding performance, my opinion on Java and RoR is:

1, a Java-based website (running on multiple Java application servers) has its own unique advantages, such as a multi-threaded model (maximum speed for reading local data), global memory, the ability to pool resources, many effective clients for connecting all kinds of OSS tools third part ...

2, RoR (and Php) to connect HTTPServer, you need to "proxy" to request the application level. A multiprocess model enhances interprocess communication. And as a "dynamic language" performance is lower.

But, at present, web programming depends on other tools for enhancement. The widespread use of the cache, NoSQL (Memcached, Redis, TT / TC), the IPC / RPC infrastructure (netty, akka) ... shift the bottleneck. I knew that both of the above models were used in large network multiplayer games.

+4
source share

Well, it depends.

  • Ruby is not a very fast language, but the speed of the language will probably not be your bottleneck - in my experience, the relative slowness of the ruby ​​is simply a fall in the ocean of external service calls (for example, databases), algorithmic problems (for example, synchronous, blocking subroutines) and design choices that are usually not suitable for the problem area. Keep your entire technology stack in perspective.

  • The community is important, and Ruby / Rails is extremely active. AFAIK Play is smaller, but in my own experience, Java and Scala (and many other languages ​​with JVM implementations (including Ruby)) also have good communities.

It all depends on the specific needs of your application (and you!). If Ruby is too slow, it is too slow. If you absolutely need a library that exists only in Java, use Java. Select a tool to fit the task. But keep the whole task (and your own needs for this task) in perspective.

+6
source share

All Articles