Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring-boot mongodb 4.0 compatibility

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`?

like image 657
Divs Avatar asked Nov 17 '22 00:11

Divs


1 Answers

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
like image 92
Paizo Avatar answered Dec 15 '22 04:12

Paizo