Mongodb java driver replicaset from 2.4 to 3 - mongodb

I have a replica set consisting of
Mongo1 2.4 primary
Mongo2 2.4 secondary
Mongo3 2.4 arbiter
Mongo4 3.0.3 secondary
My Java application uses driver version configured on all members of the replica set.
When I force a mongo v. 3.0.3 as primary the java app with driver 2.4 continue work correctly?

Concerning the part about Java driver version 2.4 and Mongo server version 3.0.3 : According to the docs it should.
But your mongo 4 will never become primary because it is an arbiter.
Kind regards
Chris

Hope it should not work correctly, or you may have some issues.
It is not a good practice to use the lower version of a java driver to use against a higher version of mongo.
Always use the right version of java driver for the mongo version.
Also, You can use it in other way, (ie) you can use a higher version of a java driver for a lower version of mongo, but ensure that backward compatibility is provided for the mongo version.
Also Having different versions of Mongo for Primary and Secondary you will be facing the backward compatibility issues.
References:
http://docs.mongodb.org/master/release-notes/2.6-compatibility/
http://docs.mongodb.org/manual/release-notes/3.0-compatibility/

Related

migrating parse-server / mlab deployment to MongoDB Atlas

I originally posted this question on ServerFault, but it didn't get any traction, so I thought that stack might be a better forum for this question. My apologies if this out of line.
We are currently running parse-server (v2.7.2) on Heroku (node.js 7.10.1), connected to an mLab mongodb database. I recently received a notification
from mLab that they have been acquired by MongoDB and will be eventually migrating all customers to MongoDB Atlas.
The migration instructions from mLab to Atlas seem fairly self explanatory. My question concerns parse-server itself:
Does our version of parse-server (2.7.2) and node.js (7.10.1) have drivers that will support Atlas MongoDB?
MongoDB feature compatibility will depend on the underlying driver version which you can find by running npm list mongodb in the directory where you installed parse-server.
You can also check the mongodb driver version requested in parse-server's package.json, but a newer driver version may be installed depending on the semver notation used.
It looks like parse-server 2.7.2 uses the mongodb 3.0.1 driver, which is fully compatible with MongoDB 3.4 and 3.6 features according to the MongoDB Driver Compatibility documentation.
The MongoDB Node 3.0.x driver won't support newer features of MongoDB 4.0 (for example, transactions), but you should otherwise be fine with an Atlas deployment using MongoDB 3.4 or newer.

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

Compatility of older driver versions against newer mongodb server

We have multiple applications using mongodb as database. In our current case our applications are using the mongo driver 3.4.
On the server side currently we are running with Mongo 3.4 but we would like to keep the Mongo version up to date as long as possible.
I know that mongo drivers provide such level of backward compatibility, but I don't know whether an old version of mongo driver can work without any problem with a newer version of a mongo server.
Can mongo driver 3.4 work with 3.6 server without any problem?
Officially supported drivers provide a form of backward compatibility.
That is, newer drivers should be compatible with older server versions, but thorough testing of the application to double-check is always strongly recommended.
Note that the opposite is not always true, e.g. newer servers may be compatible with older drivers, but there is no guarantee. This is especially true if you apply setFeatureCompatibilityVersion command after a server upgrade.
The page Driver Compatibility in the documentation should be up-to-date with driver versions vs. server versions. You might be able to refer to this page in the future.
As of December 2021, the driver compatibility pages containing compatibility matrices for Python can be found at:
PyMongo: https://docs.mongodb.com/drivers/pymongo/#mongodb-compatibility
Motor: https://docs.mongodb.com/drivers/motor/#mongodb-compatibility

Copy database from host with MongoDB 2.4 to host with MongoDB 3.0 via ssh tunnel

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.

C# client lib for Mongodb: Will it run against Mongodb 3.x?

We have an app that uses the C# Mongodb client lib from mongo, version 1.1.0.4184
This code currently runs against mongodb 2.6.4
We would like to stand up a new mongodb server, the current version (3.2.11). Will our code run against newer mongodb?
It really depends what you mean by "will it run". The MongoDB v1.1.0.4184 C# driver was released in June, 2011 and dates to roughly the MongoDB 1.8 server release timeframe. This driver version is certainly no longer tested or supported, and will not be fully compatible with newer server features like the WiredTiger storage engine (default in MongoDB 3.2+) or SCRAM-SHA-1 authentication (default in MongoDB 3.0+).
The MongoDB documentation includes a reference table with recommended version(s) of the drivers for use with a specific version of MongoDB: C#/.NET Driver Compatibility.
If this is a production system I would strongly recommend taking the time to update and test a supported version of the C# driver for use with MongoDB 3.2 (eg. the v1.11 C# driver). I suspect it is very likely you will encounter fixed (or novel) bugs/behaviour using a driver that is more than five years old. Your application won't be able to take advantage of many of the newer server features, and this obsolete driver predates specifications such as standard Server Discovery and Monitoring (SDAM) behaviour.
That said, assuming you aren't using any features the driver isn't aware of your code may continue to run (or at least appear to run) successfully. In my opinion doing so is a high risk deployment strategy.
Yes, i am using it, but however we have to chek on specific features, which you were using. using MongoDB latest driver is much better in terms of latest features and there are few features were removed(like 'eval()').