简体   繁体   中英

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.

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

Unless you really need an ORM\\ODM I recommended you don't use Mongoose at all.

It seems most people (including me, briefly) are you using Mongoose because the native driver's api is to cluncky and difficult to understand.

That's why I have switch to mongojs . Mongojs is a module that wraps the native driver but with much cleaner api that is almost identical to mongo shell.

I can't really comment on the scalability of Mongoose but mongojs is just that, a lightweight wrapper around the native driver.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM