1

My use case is fetching data from an external source. After fetching data.I'm mapping with multiple tables in MongoDb which has huge data and generating results. For this use-case which is faster Pymongo or MongoEngine?

1 Answers1

1

pymongo is a driver. mongoengine is an ODM and it exists on top of the driver.

Any operation going through mongoengine also goes through the driver. Therefore, execution time in pymongo is always going to be less than execution time in pymongo+mongoengine.

With that said:

  • mongoengine provides functionality that pymongo does not implement (the object-data mapping). If you implement the equivalent functionality in your own application that uses pymongo directly, the result could be slower than using mongoengine.

  • if a query you are sending is slow for the database to execute, the extra time that mongoengine spends doing its thing can be so small as to be irrelevant.

D. SM
  • 13,584
  • 3
  • 12
  • 21