A Performance Comparison of Drivers for Azure CosmosDB

In this article, we compare the performance of the CData Drivers for CosmosDB to the equivalent drivers produced by MongoDB, Inc. We compared read performance, measuring the amount of time that it takes to query an Azure CosmosDB instance (configured for the MongoDB API) for data and process the result set in some way.

The test machine specifications are as follows:
Operating System: Windows 10
Processor: Intel® CoreTM 2 Quad CPU Q8400 @ 2.66GHz
Installed Memory (RAM): 6.00 GB
System type: 64-bit Operating System

Since the drivers are being compared side-by-side, the performance of the machine itself is relatively unimportant; what matters is how the drivers compare relative to one another.

The Data

In order to provide a reproducible comparison, we copied the sample restaurants dataset made publicly available by MongoDB, Inc. The relevant details for the table queried are below:

Table Number of Rows
restaurants 25,359
restaurants_large 1,193,949


The main goal of this investigation was to compare the related performance of the drivers. We did this by running the same query with each driver. To simulate actual processing of the data beyond simply reading from MongoDB, we stored the values of each row in an array (that was replaced for each row). The queries are listed below:

  1. SELECT borough, cuisine, name, restaurant_id FROM restaurants
  2. SELECT borough, cuisine, name, restaurant_id FROM restaurants_large


Below, you can see the performance of the various queries, based on the driver/platform.

ADO.NET Provider / C# Drivers

CData Software and MongoDB, Inc are the two companies that provide native support for connecting to MongoDB data in .NET applications. CData Software has an ADO.NET Provider and MongoDB, Inc has their own C# and .NET MongoDB Driver. The times required for each product to process the results are in the table below.

ODBC Query Times by Company (in seconds)
Query CData Software Magnitude|Simba
~25,000 rows 6,911.4 (+160%) 18,001.4
~1.2 million rows 267,950 (+209%) 828,049

As can be seen in the results, the CData ADO.NET Provider was able to work with large result sets faster than the MongoDB, Inc. C# Drivers, processing the largest dataset over three times faster than the MongoDB, Inc. driver.

The average runtime for each query (of the larger datasets) is compared in the charts below:

Results for ~25,000 Rows

Results for ~1,200,000 Rows


The CData Software drivers regularly prove to be faster than the competitors' equivalent products, particularly when dealing with large data sets. Our developers have spent countless hours optimizing the performance in processing the results returned by the CosmosDB database to the point that the drivers seem to only be hindered by web traffic and server processing times.

Related Articles