Skip to content
Basic read/write test for RavenDB and MongoDB document databases.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Raven - Mongo (basic performance comparison)

This is a simple test comparing basic write/read performance of RavenDB and MongoDB in connection to the document size.


To get the best performance out of the RavenDB.

Read Items by ID

Selects 500 ids and read them with random order from DB.

Raven: Load<Person>(id)

Mongo: FindOneById(id)

Read Items – filtered

Filters Person by category for first 5 categories

Raven: Query<Person>().Where(i => i.CategoryId == categoryId).ToList()

Mongo: AsQueryable().Where(i => i.CategoryId == categoryId).ToList()

Write Items

Writes 1000 generated items to the DB. Raven test use bulk insert feature!

Raven: BulkInsert.Store(item)

Mongo: Save(item)


There is just one entity/document Person. This includes property mostly for making document big enough. Except the CotagoryId property which is used also for filtering.

There is 1000 person generated in 10 categories so it is quite small data set. The generated data try to be more realistic therefore the document sizes are just estimates the real size can be a little bit different.

The test client is running on the same machine as the server.


  • version 2.2.2
  • run as service
  • journal: true


  • build 2261
  • run as service
  • following settings: HttpCompression: true, AnonymousAccess: None
documentStore.JsonRequestFactory.ConfigureRequest += (sender, e) =>
    ((System.Net.HttpWebRequest)e.Request).UnsafeAuthenticatedConnectionSharing = true;
    e.Request.PreAuthenticate = true;

Test machine:

Windows 7 64-bit, 8GB RAM, i72720QM 2.2GHz, SSD


Change log

Based on feedback from ravendb group the following has been changed:

  • tests for mongo/raven can be run separately and they are in the results
  • there is a wait after generating items to give a time for DB to build indexes
You can’t perform that action at this time.