31

I was looking for the best middleware for storing session data in MongoDB to use in a production application that uses express?

I've been looking around and found this:

  1. session-mongoose (https://github.com/donpark/session-mongoose) According to author's comment this is not production-ready for following reasons:

    • insufficient testing
    • zero optimization
    • there are better options than MongoDB for session storage
  2. connect-mongo (https://github.com/kcbanner/connect-mongo)

  3. express-session-mongo (https://github.com/davglass/express-session-mongo)

    Based on these classes

    • Sencha Connect Memory Store
    • ciaranj's express-session-mongodb
  4. connect-session-mongo (https://github.com/bartt/connect-session-mongo)

I've been looking at their code, I was trying to find also a performance comparisson article. Do you guys have experience to suggest which is the best?

4

2 回答 2

35

connect-mongo ( https://github.com/kcbanner/connect-mongo ) 看起来比其他的更好。

express-session-mongoconnect-session-mongo非常旧,并且基于旧版本的mongodb驱动程序。

session-mongoose基于mongoose,比mongodb驱动程序慢。

我认为connect-mongo是最好的选择。

于 2012-12-27T19:41:24.613 回答
2

连接 mongodb 会话

  • https://www.npmjs.com/package/connect-mongodb-session
  • 发表于 3 个月前
  • connect-mongodb-session用于连接和 Express 的 MongoDB 支持的会话存储。旨在成为connect-mongo等模块的维护良好且功能齐全的替代品
  • 谷歌现在也首先展示了这个。

连接-mongo


于 2020-11-13T04:59:25.997 回答