The performance of driver is central to the reason for its existence. A series of benchmarks have been created to measure the performance of the Asynchronous driver relative to the MongoDB Inc. supported (legacy) driver. These benchmarks are divided into insert and update benchmarks. These benchmarks are provided as part of the mongodb-async-performance GitHub project.

The Asynchronous driver provides three modes for almost all methods of the MongoCollection interface.

Callback
The user provides an implementation of an interface that is notified once the response to a message is received.
Async
The user is provided with a Future that is updated with the results of the request.
Sync
The result of the operation is returned to the user via normal method call semantics.
  • Note: A change in version 2.6 makes the 'fsync' durability functionally equivalent to 'journaled' when the server has journaling enabled. When the journal is disabled 'fsync' reverts to the the pre-2.6 behavior of syncing all data files. Further, in 2.6, the 'journaled' durability will report an error if journaling is not enabled on the server.

    The first shows the relative performance of the legacy driver's vs. the Asynchronous driver when inserting documents with only a sequential _id integer value.

    Figure 1 - Relative Performance of the MongoDB Inc. (legacy) and Asynchronous drivers Inserting documents.

    The next chart shows the relative performance of the legacy driver's vs. the Asynchronous driver when updating a single document's non-indexed 'c' long field. The update's query is based on the _id field of the document.

    Figure 2 - Relative Performance of the MongoDB Inc. (legacy) and Asynchronous drivers Updating documents.

Test Environment

All tests were performed on computer with a Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz and 16GB of memory running Fedora 20. JDK 1.7.0_55 was used. The mongod process was started using the following command line:

   mongodb-linux-x86_64-2.6.1/bin/mongod --dbpath /dev/shm/mongod/

Test Results

The raw performance data is provided in the analysis spreadsheet.