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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With