So you have a web development
project in mind to be developed from scratch. For sure, it is a complex web
application that has got to be rich in feature, scalable and maintainable.
Among these core requirements, it’s difficult for teams to choose a programming
language or a web framework that is objectively the best to suit the given
requirements.
There are hosts of technologies and
programming languages available. Of these enterprises have widely embraced open
source object-oriented programming languages like Java, Python, Ruby etc. for
their web development requirements. Considering the coding advantages and
structure of language, the most
preferable languages that come to my mind are Ruby on Rails and Java since the other language i.e. Python is loosely
structured which makes the development process longer.
Now the question here arises
whether to choose Ruby on Rails or Java technology for your web
application development requirements.
Let us take a closer look at both
these technologies from the following perspectives to make an objective
decision-
Find out the bests of Java & Ruby
Tools, Libraries and APIs:
Since Java has been around for a
long time, there are several tools, APIs and libraries available which makes
its infrastructure more powerful than Ruby. Having this kind of infrastructure
is more essential when a company matures and customers demanding high quality
services and features expands. Since Ruby is younger than Java, it lacks the
support of such tools, libraries and APIs. This makes Ruby stand lower compared to Java.
Learning Curve:
As Java comes with various combinations
of libraries and technologies to be applied while coding, developers have to
spend more time in learning different architecture and sorting out the details.
On the contrary, Ruby helps you get started quickly due to its simple
development architecture which is easy to learn and apply. Hence the vote goes to Ruby for the advantage on
learning curve.
Manageability of Codes:
With Java, managing codes and defining classes is easy owing to its statically typed programming
language. In Java, especially with Eclipse, you can search defined methods
and classes which are better than calling something hypothetical as in Ruby
where handling codes and naming classes is difficult due to its dynamic
language type. With dynamic typing, it’s confusing and difficult to assume what
you are typing and changing since there are no warnings from the Static
compiler. This ends up spending more time in Ruby and difficulty in managing
codes.
Testability & Robustness:
Although both the languages have
good support for regression testing, Ruby
is slightly ahead of Java as it
relies strongly on automated tests which ensure things do not break easily
if there are changes at the other end of the application.
Scalability and Stability:
In terms of scalability and stability, Java
beats Ruby due to the scalable architecture of all the frameworks of Java. In
the event of outages and unfavorable environments or with a large number of
users and database, Java frameworks are more secure and dependable than Ruby.
Even corporates prefer Java over Ruby for their critical applications which
means Java outweighs Ruby on scalability and stability grounds.
Percentage Hiring:
A survey conducted two years ago
in cooperation with the SHARE user group, IBM and Northern Illinois University
on 376 employers revealed that Java is the most sought after language by
enterprises for hiring. Java accounted for 56% while Ruby constituted only 5%.
Considering the above
perspectives, you may find that Java is better if you want the backend of your
application to be more scalable and manageable while Ruby can be a choice if
you want to get it done quickly. For those who cannot decide, here is an
example of the social media giant – Twitter.
Find out what and how it did.
See what Twitter did
Twitter is one of
popular and highly used micro-blogging and social networking services started
in 2006.
Twitter in its early years was
running on Ruby on Rails. With over-usage by people across the world, there was
a time when Twitter became vulnerable as the number of tweets and queries increased
which created load on the back-end server. Moreover, the search latencies also
increased which reduced the request handling making it unavailable for users.
Hence in 2010, the engineers at
Twitter realized that Ruby was not enough capable of juggling with the tweets
of millions of people across the world.
The team found that Java
frameworks because of higher scalability and maintainability were well-suited
to develop web-services that can stand the large traffic. The engineers started
rewriting the Twitter search engines and moved it from MySQL to Lucene. They
also replaced
the frond-end Ruby with Blender – a Java Server to improve the search latencies
and sustain the traffic.
Twitter engineers also installed
JVM (Java Virtual machines) across all their servers and created an independent
web service which communicates with each other constantly but also looks after
various part of their web application. Like there will be an independent web
service that will look after Twitter homepage and another that will handle
tweets from mobile.
As a result of these changes, Twitter started
running 3x faster without any problems.
Mazen Rawashdeh - Twitter's VP of
Infrastructure Operations Engineering then said “The bottom line: No matter
when, where or how people use Twitter, we need to remain accessible 24/7,
around the world.” "We’re hard at work delivering on that vision."
This is how Twitter moved from
ROR to Java and managed to be on top even after so many crisis.
Java surely rules it
From the above example, it’s
evident that Java is better than Ruby on several grounds. It is not only a
programming language for developing application but also a virtual machine that
can run codes built in myriad languages. Even big operations like Google,
LinkedIn, Tumblr, and Square, have adopted Java because of its ease of use and
ability to handle multiple operations through the JVM.
Owing to its lightweight and fast-to-deploy
architecture, Java is gaining recognition. As published in a post on Zd.net,
Wired Enterprise’s Editor Cade Metz observed that "Like Twitter, many other companies have realized that Java is
particularly well suited to building web services that can stand up to the
massive amounts of traffic streaming across the modern internet,"
However, it is still portrayed as
an insecure framework but after Oracle acquired Sun – the original producer of
Java, it has become more stable and secure programming language.
So
now what do you think? Is it ROR or Java for your web development project? Do let us know in commens section.
Download our Free Whitepaper on Grails: Accelerating J2EE Application Development
Download our Free Whitepaper on Grails: Accelerating J2EE Application Development