Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do Morphia, Mongo4j and Spring data for MongoDB compare? [closed]

I'm interested in how to they compare to each other, what's more mature, has more features, better for some use cases.

My own use case is to create a real-time monitoring service (think Chartbeat) but if you can talk about other use cases please do it - after all this Q&A might be of interest for others.

like image 329
Catalin Braescu Avatar asked Apr 29 '11 20:04

Catalin Braescu


People also ask

What is Morphia MongoDB?

Morphia is a wrapper around the Java driver for MongoDB. It acts as an ODM (Object Document Model) for MongoDB documents. Its original goal was to provide an easy mapping to POJO (Plain Old Java Objects). Nowadays, newer versions of the Java driver support this mapping out of the box.

What is the use of Morphia?

Querying a document in Morphia begins with creating a query using Datastore and then declaratively adding filters, to the delight of those in love with functional programming! Morphia supports much more complex query construction with filters and operators.

What is Spring Data MongoDB?

Spring Data for MongoDB is part of the umbrella Spring Data project which aims to provide a familiar and consistent Spring-based programming model for new datastores while retaining store-specific features and capabilities.


1 Answers

Morphia may be the most stable of the three. I have not heard much of Mongo4j lately- probably abandoned. I personally like spring-data because of the hades project... You don't need to implement the DAOs. You just write the interface and spring data automatically provides it to you. However Spring Data Mongodb implementation seems a little buggy in my initial trial. If you have hard dates and is working on a production quality product, probably it is wise to choose Morphia.

like image 122
Hari Gangadharan Avatar answered Sep 17 '22 20:09

Hari Gangadharan