Ongoing work to update Cryomongo to MongoDB 8.0

Hello Crystal community,

I saw that Crymongo received an update 4 months ago, but it is compatible with Mongo up to 4.2.

Since we are already at Mongo 8.3, I would like to know if there is anyone working on a Mongo driver.

I’m considering trying to contribute to Crymongo.

Ok. Temporarily forked bson.cr and cryomongo. Better help the community and unify efforts instead of splitting things.

The ongoing work at bson.cr fork is going well. I’ve been working on it for a day now, and I estimate I’ll finish it by the end of the day.

Sending the improvements to upstream will depends on @elbywan approval, and this is my goal, to return everything to the original repository as soon as the roadmap is concluded.

Later on I will move my efforts to cryomongo.

My understanding is that we cannot update bson.cr and publish it before also updating cryomongo, since they both need to be in sync of what the latest MongoDB expects.

Since I’m not at the level of Julien, I will start first focusing on Linux and local deployments, exclusively for MongoDB 8.0. Then I will probably need help to update the more complex things like integration with MongoDB Atlas and eventual retro-compatibility with previous MongoDB versions.

Since the current driver supports Mongo up to 4.2, one possibility in this update is to skip all intermediary versions before 8.0.

This is because, most probably, no one used cryomongo on newer versions of Mongo 4.2 anyway.

So one simpler strategy could be to document the compatibility of the existing version for Mongo 4.2 and the new version to 8.0.

Update: the complete update on the temporary fork at alumna/bson.cr is concluded. :tada:

It is fully updated and test covered to the latest BSON specification used by MongoDB 8.0.
Lots of optimizations were done, including the long-awaited BSON::Decimal128 implementation in pure Crystal.

Starting now the work at Cryomongo

Update on Cryomongo: the work is now 50% 75% 90% 100% concluded (with basic auth).

The temporary fork at alumna/cryomongo partially works on MongoDB 8.0 and uses the official MongoDB Unified Test Format (UTF), in place of the previous specifications (now deprecated in favor of UTF).

All of of the added tests from UTF work, by I’m adding them gradually (see below). There is a simple roadmap and detailed one. Basically, this is the current one:

  • Unified Test Format (unified-test-format.md): new runner for UTF
  • CRUD Operations (crud.md): 100% compliant.
  • Retryable Writes (retryable-writes.md): 100% compliant.
  • Retryable Reads (retryable-reads.md): 100% compliant.
  • Transactions (transactions.md & transactions-convenient-api.md): 100% compliant.
  • Sessions & Causal Consistency (causal-consistency.md): 100% compliant.
  • Server Discovery and Monitoring (server-discovery-and-monitoring.md): 100% compliant.
  • Authentication (auth.md): Basic auth concluded. Beta usage.

I’ll try to finish it this week, if possible.

Note: this would not be possible without the incredible work of @elbywan, so thank you Julien! I will inform when everything seems good to finally open a PR on the original/upstream repo.

Update:
Sessions, Causal Consistency and Snapshot Reads (MongoDB 5.0+) specifications now added.

6 of 8 categories from the roadmap for MongoDB 8.0 now concluded (75%).

Link: releases/tag/v0.8.0

Update:
Server Discovery and Monitoring (SDAM) specifications now added, including adjustments for MongoDB 6.0+.

This was probably the most difficult one.

7 of 8 categories concluded (~90%). Just one more.

Link: releases/tag/v0.10.0

Update: The fork is in beta state and welcome testers. :tada:

Basic authentication is finally done (last item from the beta roadmap).
To surpass beta, it will need performance optimizations and improved tests, specially multi-topology tests:

  • standalone
  • replica set (already tested)
  • sharded cluster

These items are the focus of my next steps.

Link: releases/tag/v0.12.0