Sea splash

This is the highlight of my summer: I just released 1.2.0-beta of libmongoc, the C driver for MongoDB. You can download the tarball here:

https://github.com/mongodb/mongo-c-driver/releases/tag/1.2.0-beta


The main feature is Jason Carey and Samantha Ritter's rewrite of the mongoc_client_t internals. They overhauled it to match the Server Discovery And Monitoring Spec and the Server Selection Spec. The payoff is huge:

  • All replica set members or mongos servers are discovered and periodically checked in parallel. The driver's performance is dramatically better and more predictable with multi-server deployments, or with a flaky network, or when some servers are slow or down.
  • Clients from the same mongoc_client_pool_t share a background thread that discovers and monitors all servers in parallel.
  • Unnecessary round trips for server checks and pings are eliminated.
  • Behavior is documented in the specs, and consistent with other drivers, even in complex or unusual scenarios.
  • The URI's "replicaSet" option is enforced: the driver now refuses to connect to a server unless it is a member of a replica set with the right setName.
  • Many race conditions related to changing deployment conditions are fixed.

The worst code in the old driver, the cause of most of the bugfix releases in the 1.1.x series, has been completely replaced with a well-designed architecture.

To conform to the new specs, the client accepts these options in the MongoDB URI; see the mongoc_uri_t documentation for details:

  • heartbeatFrequencyMS
  • serverSelectionTimeoutMS
  • serverSelectionTryOnce
  • socketCheckIntervalMS

Other features:

Notable bugs fixed:

Thanks to everyone who contributed to this version of libmongoc.

  • A. Jesse Jiryu Davis
  • Sujan Dutta
  • Jason Carey
  • Hannes Magnusson
  • Jeremy Mikola
  • Derick Rethans
  • Samantha Ritter
  • Yuchen Xie
  • Lloyd Zhou

I hope you'll try this beta and let me know how it goes. Open a ticket in our bug tracker if you find an issue. If you try it and it goes well, email me! I'm jesse@mongodb.com. I'd love to hear from you, and I need to know how the beta period is going for libmongoc users.

Peace,

— A. Jesse Jiryu Davis


Image: Robert Witcher