TheServerSide.com – Hibernate vs. Rails: The Persistence Showdown

Lucas Jellema 1
0 0
Read Time:1 Minute, 45 Second

An interesting article comparing two OO/R frameworks: Hibernate and RAILS. It gives a good indication of what you should look for when investigating OO/R mapping/persistency frameworks. TheServerSide.com – Hibernate vs. Rails: The Persistence Showdown

You could apply this same kind of analysis to alternatives such as: Toplink, Ibatis, OJB, JDO, EJB 3.0, Oracle ADF Business Components etc.

By the way, the main conclusion is: Hibernate is more mature and has features required for large, scalable applications. On the other hand, RAILS is simple to learn and very quickly gets you going, especially on smaller endeavours.

Beyond the basics, Hibernate adds quite a few more mapping types (I documented a complete catalog of examples with over 20 mappings in Hibernate Quickly), including different inheritance strategies, custom user types, and maps of entity or simple types. While it’s simpler to specify and use simple associations in Rails than in is in Hibernate, but there is less you can do with them. If you stick to the simple cases like single tables with a few associations, and you name your tables and columns right, Rails will likely do just fine, but for more complicated object models, Hibernate will be a better choice.

Rails and Hibernate are very different when it comes to query languages. While its not possible to do an exhaustive comparison of their query languages, generally selects for single objects/tables will be quicker and easier for Rails, and anything join related is better suited for Hibernate. Rails use SQL, which is familiar to most developers, while Hibernate offers HQL a OO query language that developers will need to learn. In addition, Hibernate offers quite a few more tuning opportunities, providing the necessary ORM mechanisms, like outer join fetching, configurable lazy fetching and second level caching. This further supports the theory that Rails is likely suitable for smaller projects, but its ORM layer lacks a number of the essential features that will allow it to scale up to larger projects.

It reminds me that we should take a look at Ruby. Too much buzz to remain ignorant.

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

One thought on “TheServerSide.com – Hibernate vs. Rails: The Persistence Showdown

  1. Hibernate offers its Hibernate Query Language, but you can use SQL too. You may need to learn HQL if you’re working on an existing project that uses it, but if you’re writing your own Hibernate application from scratch, you can ignore HQL entirely.

Comments are closed.

Next Post

Knowledge Center on Web & Java

AMIS has several Knowledge Centers, each around a technology theme. The current themes are: Web & Java (Oracle) Server Development & Programming Languages Oracle Development Tools Database Administration and Application Server Administration Technical Architecture In addition we have groups concerned with Project Management and Analysis & Business Consultancy. We have […]
%d bloggers like this: