I have no experience with MongoDB and we are trying to port a JPA application to be based on MongoDB. There are 3 drivers mentioned for porting java here. Which driver would be the easiest to use for converting my existing JPA application? Would it be morphia, mungbean or daybreak. Would prefer some practical experiences with users who have gone through this path before.
The MongoDB Atlas SQL JDBC Driver provides SQL connectivity to MongoDB Atlas for client applications developed in Java. See the Atlas SQL Documentation for more information. MongoDB Atlas SQL JDBC is a JDBC Type 4 driver compatible with the JDBC 4.2 specification.
To connect to MongoDB on your local instance and default port, you can just omit the URI part of the above, or use a URI like 'mongodb://localhost:27017'. For MongoDB Atlas, you can find the connection string in the cluster console – and make sure you've whitelisted your development IP address for access.
The official MongoDB Node. js driver allows Node. js applications to connect to MongoDB and work with data. The driver features an asynchronous API which allows you to interact with MongoDB using Promises or via traditional callbacks.
All features are supported.
Morphia isn't a driver but a wrapper around the official java driver. It has a pretty active community.
Mungbean is an alternative community supported driver and POJO mapper. Having written a community supported driver myself, I wouldn't say that, that is necessarily a bad thing but it is like any open source project. You have to look at the vitality of the project.
Daybreak claims to be very new and experimental. Unless you have the stomach for it, I wouldn't touch it (yet).
The existing plain java driver is basic but has all the functionality. 10gen is working on a redo of it to address some of the warts of the old one. You may also want to look into that.
Some things you need to consider when using a mapper:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With