Node.js mongoose performance

后端 未结 2 965
温柔的废话
温柔的废话 2021-02-20 16:04

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 everyth

相关标签:
2条回答
  • 2021-02-20 16:21

    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.

    0 讨论(0)
  • 2021-02-20 16:23

    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

    0 讨论(0)
提交回复
热议问题