NoSQL Zone is brought to you in partnership with:

Reza Rahman is a former independent consultant, now Java EE/GlassFish evangelist at Oracle. He is the author of the popular book EJB 3 in Action. Reza is a frequent speaker at Java User Groups and conferences worldwide. Reza has been a member of the Java EE, EJB and JMS expert groups. He implemented the EJB container for the Resin open source Java EE application server. All views voiced are my own, not necessarily Oracle's. Reza is a DZone MVB and is not an employee of DZone and has posted 159 posts at DZone. You can read more from them at their website. View Full User Profile

Using NoSQL with EclipseLink and JPA?

  • submit to reddit

NoSQL is obviously a hot topic in the enterprise these days, at least at the water cooler if not in the production data center. The momentum is such that despite being seen as a stalwart of relational databases, Oracle too has entered the NoSQL ecosystem with Oracle NoSQL. Naturally, the question of how to use NoSQL databases in Java EE applications (specifically existing Java EE 5 and Java EE 6 applications) comes up all too often. As it so turns out there are a number of very interesting initiatives out there to radically simplify the usage of NoSQL databases in Java EE applications by creating JPA based facades over them (strictly speaking, JPA as it stands today is not intended to support NoSQL from a purely standards standpoint). Such efforts include one from non other than the team behind the Oracle JPA reference implementation EclipseLink. In a code driven blog post, Huseyin Akdogan demonstrates how to use MongoDB using EclipseLink NoSQL. You are also welcome to check out my own slide deck covering using NoSQL databases in Java EE with or without a JPA flavored API (using just plain CDI):

Interestingly, NoSQL support featured quite prominently in the results of a survey around JCP standards put together by the London Java Community (LJC). It would be interesting to hear your thoughts as well.

Robert Greene, John Bracken and Shaun Smith held both a technical session titled "Building Oracle NoSQL Database Applications with EclipseLink" and a BOF titled "Java Persistence for NoSQL" at JavaOne 2013 on this topic. Stay tuned to for the video recordings of the sessions.

Published at DZone with permission of Reza Rahman, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Lukas Eder replied on Fri, 2013/10/18 - 4:54am

Agh. JPA is already a compromise and least-common denominator for interaction with SQL databases. Blending in other data storage architecture support into a single API might make the JPA API even less specific towards underlying storage and query engines.

In other words, 95% of the time in the future, people will have to write out native queries, but sit on a huge JEE stack they don't really need.

Why not just choose a SQL / NoSQL database and query that more or less directly or with jOOQ in the case of SQL, an API that focuses on one language only?

Reza Rahman replied on Fri, 2013/10/18 - 7:19am

No one is saying using NoSQL APIs directly is not a valid option. I've covered these concerns in this talk:

However, JPA clearly works quite elegantly for a large class of applications - it can work for NoSQL too, which is what these emerging initiatives are all about. JPA has certainly worked well for me personally and many other Java EE adopters quite well for many years now for example.

If you have specific technical concerns around JPA, it is will be good to know what they are so that they can be addressed.

Reza Rahman | WebLogic, GlassFish and Java EE Evangelist

All views voiced are my own, not necessarily Oracle's.

Reza Rahman replied on Fri, 2013/10/18 - 7:32am

BTW, in the interest of full disclosure, I think it's best to mention that you own the company behind the technology you referred to?

Reza Rahman | WebLogic, GlassFish and Java EE Evangelist

All views voiced are my own, not necessarily Oracle's.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.