Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js mongoose performance

Is there somebody that has experience using mongoose.js as Node.js mapper for Mongodb at high scale?

I am wondering if I should use the native driver, so I keep everything lightweight or to write a simple wrapper.

If anybody got some tips, advise thank you very much.

like image 908
onlineracoon Avatar asked Aug 15 '12 19:08

onlineracoon


People also ask

Is Mongoose faster than MongoDB?

Results and Conclusion. Overall, the native driver is around 2x faster than Mongoose. Because the native driver uses findOneAndUpdate , read and write results are identical.

Is Mongoose a good node?

Mongoose, a neat ODM library for MongoDB used in Node. js projects, has plenty of useful features that make developers' lives easier. It manages relationships between data, has schema validation, and overall allows coding 3-5 times faster.

Is Mongoose better than MongoDB?

Mongoose allows users to conveniently create and manage data in MongoDB. While it is possible to manage data, define schemas, etc. using MongoDB APIs, it is quite difficult to do so. Hence, Mongoose has made lives easier.


1 Answers

A little late to the party some but according to this article Mongoose performs worse compared to the native MongoDB Node.js client. More or less Mongoose is slower (ops/sec) for every single metric collected (queries and inserts).

Source code with the benchmarks can be found here

like image 67
vorillaz Avatar answered Nov 15 '22 12:11

vorillaz