Driver Core

Driver Core is a full driver with complete support for all types of deployment configurations, authentication, SSL, and cursors. The API is verbose, but highly configurable which is why it’s a great solution to build higher-level APIs upon. The MongoDB .NET Driver is built upon Driver Core.

Services

Driver core provides a number of services that higher-level drivers can utilize either implicitly or explicitly.

Connection Pooling

Connection pooling is provided for every server that is discovered. There are a number of settings that govern behavior ranging from connection lifetimes to the maximum number of connections in the pool.

Server Monitoring

Each server that is discovered is monitored.

MongoDB 4.4 or later: The MongoClient establishes an exhaust cursor to each discovered cluster node using { hello: 1 } (or legacy hello). Cluster nodes push topology updates to MongoClient.

MongoDB 4.2 or ealier: The MongoClient polls each discovered cluster node every heartbeatFrequencyMS (default 10 seconds, MongoDB Atlas 5 seconds) using { hello: 1 } (or legacy hello).

When servers go down, the frequency of these calls will be increased to 500 milliseconds. See the Server Discovery and Monitoring Specification for more information.

Server Selection

An API is provided to allow for robust and configurable server selection capabilities. These capabilities align with the Server Selection Specification, but are also extensible if additional needs are required.

Operations

A large number of operations have been implemented for everything from a generic command like “hello” to the extremely complicated bulk write (“insert”, “update”, and “delete”) commands and presented as instantiatable classes. These classes handle version checking the server to ensure that they will function against all versions of the server in which they exist as well as ensuring that subsequent correlated operations (such as get more’s for cursors) function correctly.

Bindings

Bindings glue together server selection and operation execution by influencing how and where operations get executed. It would be possible to construct bindings that, for instance, pipeline multiple operations down the same connection or ensure that OP_GETMORE requests are sent down the same connection as the initial OP_QUERY.

Eventing

The driver provides many events related to server selection, connection pooling, cluster monitoring, command execution, etc… These events are subscribable to provide solutions such as logging and performance counters.