NoSQL Zone is brought to you in partnership with:

Trisha has developed Java applications for a range of industries, including finance, manufacturing and non-profit, for companies of all sizes. She has expertise in Java high performance systems, is passionate about enabling developer productivity, and right now is getting to grips with working in an Open Source fashion as a developer for MongoDB Inc, where she contributes to the Java driver and Morphia. Trisha blogs regularly on subjects that she thinks developers and other humans should care about, she’s a leader of the Sevilla Java & MongoDB User Groups, a key member of the London Java Community and a Java Champion - she believes we shouldn't all have to make the same mistakes again and again. Trisha is a DZone MVB and is not an employee of DZone and has posted 70 posts at DZone. You can read more from them at their website. View Full User Profile

How are You Using MongoDB with Java?

  • submit to reddit

So, like one of my presentations, I have a question for you.  Actually, I have more than one question for you.  I'm not going to bother with survey monkey or whatever, I want to share the answers so please, answers in the comments:

  1. Are you using the Java driver for MongoDB in your application?
  2. Are you using the Java driver directly, or are you using a third party library like Morphia, Spring Data, the Scala driver, your own abstraction layer, etc?
  3. If you're using a third party library, why did you choose that over using the Java driver directly?
  4. If you're using the Java driver directly, what do you like about it? 
  5. If you're using the Java driver directly, are there any areas that give you pain?  Areas for improvement?
  6. Which version of Java are you using?
Feel free to leave additional information if you have it.  And this is a public blog, so if you're really mean I'll just delete your comment.  So there.

Published at DZone with permission of Trisha Gee, 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.)


Frank Taylor replied on Fri, 2013/05/17 - 2:11pm

I use mongoLabs with javascript, which is free, and unfortunately won't work in JDBC.

Tom O'Hare replied on Wed, 2013/05/22 - 7:08am

  1. Yes
  2. Directly
  3. N/A
  4. I'm quite happy with the Java driver - using it is pretty straightforward (for db actions - see item 4) and so far I've been able to find out how to implement a few more advanced use cases from documentation, tutorials etc
  5. The GridFS functionality could be improved - that's my main bugbear for the moment. As an aside, the existence of third party libraries does imply that some people may not be 100% happy with the Java driver as is.
  6. 1.6 for Production and a mix of 1.6 and 1.7 in Development

Jeff Schneller replied on Wed, 2013/05/22 - 9:34am

  1. Yes
  2. Morphia
  3. Liked the annotation and the hibernate-ish feeling.  Now second guessing as some things are more difficult but most things are easier.
  4. N/A
  5. N/A
  6. 1.6 and 1.7 depending on project

Russell Bateman replied on Wed, 2013/05/22 - 11:55am

Java driver: 20-30%.

Morphia: 70-80%.

Morphia works: it's an easy in-and-out for my POJOs. I first wrote using the Java driver, but I find my code moved toward Morphia as I felt more comfortable with it and, as I refactor existing DAO methods, I migrate them to Morphia. I do wish Morphia weren't a split code base even though I have confidence so far in the new, active fork. I think 10gen should bring J. K. Green and Morphia back into the fold and bless the effort.

Java 6.

Comment: MongoDB rocks. We use it now for everything because our needs aren't super-relational in nature. I look at lots of problems less "relationally" nowdays. I'm not looking forward to returning to the land of SQL.

Trisha Gee replied on Wed, 2013/05/22 - 12:02pm in response to: Russell Bateman

Well the good news is that we've been talking to J. K. Green over the last month or so.  We havne't forgotten Morphia, we want it to work for you guys.

Comment viewing options

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