How much faster is Redis than mongoDB?

前端 未结 7 1096
既然无缘
既然无缘 2020-12-07 06:34

It\'s widely mentioned that Redis is \"Blazing Fast\" and mongoDB is fast too. But, I\'m having trouble finding actual numbers comparing the results of the two. Given simila

7条回答
  •  囚心锁ツ
    2020-12-07 07:19

    In my case, what has been a determining factor in performance comparison, is the MongoDb WriteConcern that is used. Most mongo drivers nowadays will set the default WriteConcern to ACKNOWLEDGED which means 'written to RAM' (Mongo2.6.3-WriteConcern), in that regards, it was very comparable to redis for most write operations.

    But the reality is depending on your application needs and production environment setup, you may want to change this concern to WriteConcern.JOURNALED (written to oplog) or WriteConcern.FSYNCED (written to disk) or even written to replica sets (back-ups) if it is needed.

    Then you may start seeing some performance decrease. Other important factors also include, how optimized your data access patterns are, index miss % (see mongostat) and indexes in general.

提交回复
热议问题