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

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()').

Related

Why does MongoDB advise on upgrading MongoDB incrementally, version-by-version?

Apologies if this question is too open-ended.
I have inherited an aging tech stack and am required to upgrade our 200GB MongoDB Community Edition v3.4 installation (hosted on Ubuntu 20) to MongoDB v5 in order to support some new features.
MongoDB advises that to install v5.0, one must be already on MongoDB v4.4:
https://www.mongodb.com/docs/manual/release-notes/5.0-upgrade-standalone/
They say that if you are on a version older than 4.4, then you need to incrementally upgrade to v4.4 before upgrading to v5.
However, if you follow the links in that official upgrade tutorial, you will find that in order to upgrade to any version of MongoDB, they insist on you upgrading version-by-version, successively.
So for me on v3.4 the upgrade path will look like this:
v3.4 -> v3.6 -> v4.0 -> v4.2 -> v4.4 -> v5.0.13
Following these tutorials:
https://www.mongodb.com/docs/manual/release-notes/3.6-upgrade-standalone/
https://www.mongodb.com/docs/manual/release-notes/4.0-upgrade-standalone/
https://www.mongodb.com/docs/manual/release-notes/4.2-upgrade-standalone/
https://www.mongodb.com/docs/manual/release-notes/4.4-upgrade-standalone/
https://www.mongodb.com/docs/manual/release-notes/5.0-upgrade-standalone/
I'm not entirely sure why this is necessary, as the tutorials themselves seem to mostly involve copying over newer binaries and then setting a feature compatibility version in the database config.
To test whether this was necessary I did a mongodump of our entire v3.4 database and then installed a standalone MongoDB v5.0.13 on the same server and then mongorestore to the new v5.0.13 database. Everything seems to work fine, mongorestore spent two hours recreating all the indexes as its last step (something various articles told me would not happen using the mongodump/mongorestore method).
I am able to connect Mongo clients to this new v5.0.13 Community instance without issue. All the data is there and I am able to query it just fine.
So my question is, why does MongoDB strongly advise doing the upgrade incrementally, one version at a time when dumping the database and restoring it to a new version of MongoDB seems to work just fine?
The only issues I have currently is having to rewrite some client code which is using an older Mongo Java driver. This is something I am going to have to do regardless of the upgrade method I used.
Our MongoDB instance is Community Edition and is a single, standalone instance (not a replica set) so I don't know if this matters. Perhaps the upgrade process described by MongoDB is for Mongo Cloud or for Enterprise?
I'm just looking for clarification on whether the simpler method I tried is going to cause me issues. Maybe I've missed something I hadn't considered.

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.

Is using a newer Mongo shell version with an older MongoDB version safe?

I use MongoDB on multiple production servers, with different versions for different projects. My development environment has v3.6 of the shell but when I connect to a server with MongoDB v3.4, I am greeted with this message upon login:
WARNING: shell and server versions do not match
Is it unsafe to use a newer Mongo shell with an older DB version?
Has MongoDB provided any official answer/documentation regarding this?
Is it unsafe to use a newer Mongo shell with an older DB version?
The startup warning is about expectations rather than safety: ideally the major version (x.y) of your mongo shell and MongoDB deployment should be part of the same release series. Basic commands are generally backward-compatible (and will default to "legacy mode" where appropriate), but mismatched shell versions can definitely lead to unexpected or confusing results.
For example, the 3.6 mongo shell includes helpers for new MongoDB 3.6 features like sessions and retryable writes. If you connect to an older MongoDB server, use of helpers for newer features or options may not always result in an obvious error or warning.
Similarly, if you connect to a MongoDB 3.6 deployment using a 3.4 mongo shell you will be missing helpers for newer server features.
You can choose to ignore the version mismatch warning if you are confident the difference won't cause any issues for the commands you are using.
If you regularly need to connect to multiple MongoDB server versions (and use Linux or macOS), m (MongoDB version manager) is very handy for downloading and switching between multiple mongo versions.

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

Is there a MongoDB 2.4+ installation available for Arm chips?

I'm interested in building a small server using the Odroid U3 which has 1.7GHz Quad-Core chip. I did install MongoDB 2.1.1 on a Raspberry but found the performance far too low for any serious usage other than tinkering. I was wondering there is a MongoDB package/instruction/tutorial somewhere to install newer versions of MongoDB. Any suggestion/help would be appreciated
You may use mongodb-linux-armv7l-2.4.1.tgz that I've uploaded, taken from a JIRA comment. An experimental but working build. Not production ready.
There is a really up to date version of MongoDB for Arm chips on ArchLinux. Its currently 2.6.1+ and no need for compiling. Is also production ready - albeit with the limitations MongoDB 32bit has.
As of version 3.4 MongoDb officially supports ARM 64.
One thing to note though: Currently (v3.4.0) Only the Wired Tiger storage engine is currently supported.
The current version can be downloaded here: https://fastdl.mongodb.org/linux/mongodb-linux-arm64-ubuntu1604-3.4.0.tgz
You may watch this thread on Github of DietPi for update.
For now I have tested prebuild MongoDB 3.0.14 Binaries for Odroid XU4 Running DietPi_OdroidXU4-ARMv7-Jessie and it is working fine. Pl check bellow screenshot.
MongoDB 3.0.14 Running on Odroid XU4 on DietPi V6.10 (Debian Jessie):