Which version of spring-boot is compatible with MongoDB 4.0?
Is there an advisable way to use spring-boot 2.0.5 RELEASE with MongoDB 4.0?
Or better to use spring boot 2.0.5 which has mongo driver version 3.6.x with MongoDB 3.6`?
I think it is not strictly needed to have the latest driver and spring data mongo in order to use a mongodb 4.0; However in the spring data changelog you can see the various changes regarding the driver and DB update, there you can see that in version 2.1.0.RC1 they started adding support for version 4.0 of the database as well as in version 1.10.15.RELEASE. Latest GA version 2.1.0.RELEASE documentation has updated to MongoDB Java Driver 3.8.2.
The java driver and Spring will always be a bit behind with new functionalities introduced by each version of MongoDB. So my suggestion if you are starting now is to use the latest 2.1.0.RELEASE (https://projects.spring.io/spring-data-mongodb/#quick-start)
Edit:
How Mongo was before version 4.0 how-acid-mongodb
ACID in mongo 4.0 multi document transaction
Spring data mongo support for transactions
Related
I'm using QueryDSL 4.2.1, Morphia 1.3.2 and MongoDB Java Driver 3.5.
After upgrading MongoDB server to version 4.0, I updated the mongo-java-driver to a version that supports transactions in MongoDB.
QueryDSL seems to have abandoned integration with Morphia in version 1.3.2. Maybe the solution is to replace Morphia with Spring Data.
How do I use transactions in MongoDB 4.0 using QueryDSL and Morphia?
I don't know about QueryDSL but with Morphia itself, you can start a session via the Datastore:
https://morphia.dev/2.0.0/javadoc/dev/morphia/Datastore.html#startSession()
More information can be found here: https://morphia.dev/2.0.0/guides/transactions/
My project is currently working with an elder spring boot version 1.5.7 and we wanna use a mongodb 4.0
Due to the gap between spring boot versions 1.5 to 2.X, i would like to upgrade for now the mongodb driver only by using a 3.8.2
My need is only some records and fetchs, any ACID specifics needs sure as update a doc with several processes
I tried locally and i got any errors,
My question is although it's not the best way, is there any fallback by doing that?
(Notes: I will upgrade my spring boot version later)
Thank by advance
Spring Boot is an opinionated framework and also has opinions about the used dependency versions.
So it's never a good idea to upgrade the dependency versions without upgrading Spring Boot itself.
I would not recommend to upgrade just the Mongo DB driver.
When I updated my app's Node modules, MongoDB updated from 2.x to 3.x and I got a Dependency Error saying Mongoskin requires "mongodb":"^2.0". So I removed MongoDB 3.0 and installed 2.2.36, and all is fine.
Am I correct then to infer that Mongoskin, and its driver, will not cooperate and correctly operate against MongoDB 3.x or 4.x ? Or is it just that I cannot do the newer modern MongoDB 3.x/4.x operations but I can still do what I have been doing with Mongoskin to date?
I'm using gopkg.in/mgo.v2 for mongodb queries using GOLang.
Earlier, Mongodb version was 3.0 and now I'm planning to upgrade it to 3.6.
Are they compatible with each other?
I trying to migrate an old application, using MongoDB 2.4 to a host, running MongoDB 3.0 in Docker container. For test purpose I am copying the data via ssh tunnel from the older to the newer version.
As I read about the updating process of MongoDB, first I should use Mongo 2.6 and then 3.0. However my test with avoiding the step with version 2.6 was successful and the database works fine. Could somebody explain me is that really possible or I have misunderstood something? It's really strange for me.
Upgrading from 2.4 to 2.6, prior to upgrading to 3.0 is a requirement according to the documentation:
To upgrade an existing MongoDB deployment to 3.0, you must be running
2.6. If you’re running a version of MongoDB before 2.6, you must upgrade to 2.6 before upgrading to 3.0. See Upgrade to 2.6 for the
procedure to upgrade from 2.4 to 2.6. Once upgraded to MongoDB 2.6,
you cannot downgrade to any version earlier than MongoDB 2.4.
Having said that, if you have run the corresponding test cases for your application, with a good test coverage, the indexes are working properly, and nothing has been broken I can not see a reason to worry about but ideally they suggest to migrate to 2.6 and then make the move to 3.0 to avoid data corruption.