Mongo vs Redis: which one is better for a huge community?

  • My forum uses IP.Board but it's pretty slow, so I'm planning to change it to NodeBB.

    But my question is: I know that Redis is ultra fast since it uses RAM, but my forum is huuuuuge: 6.5 million posts and 31.200 members.

    My server is CentOS one and has 32Gb of memory ram. Will it be too much for Redis? Should I consider to use MongoDB instead?

  • Community Rep

    The performance difference is insignificant. Both use RAM to store their data and have persistence configurations so you can control how often they write to disk. Redis always stores it's entire db in ram and is generally about 2x as fast. But I don't recommend you use that to determine which one you use, they are both very fast for large amounts of ops. Look at the docs, community, and apps for each and choose the one you like the best based on them.

    Redis puts all of your data in ram, so look at how much your forum takes up on disk to determine if you have (approximately) enough ram.

  • @ludam the answer is both. Search for clustering here on the forums.

    We are running a big community site with NodeBB (close to 25000 members but a lot less posts, only some hundred thousands). Both Redis and Mongo set up so we can cluster the system. Initially we tried to set up just redis on a small test machine, but got no human perceivable performance difference to the clustered set-up.

    Works beautifully and is way faster than what we had previously.

  • @yariplus @tekojo Got it. I'm asking that because, since the users post a lot and refreshes the page all the time looking for new posts and topics, even a lil difference in performance would make a lot of difference.

    I see some posts over the web that says that Redis is faster but I'm afraid due to the space.

  • Admin

    @ludam For larger forums, definitely go with MongoDB, as it will automatically put as much data as it can into RAM, and theoretically, the less-often-requested data on disk.

    We use Redis here on this forum, but we may switch at some point in the future, although at the moment the amount of memory used still isn't a concern.

  • GNU/Linux

    Yay, for the necro. - I found this post to be interesting as it was something I too was also wondering. I'm considering just going MongoDB because rather not fuss around changing it later on. Has anyone seen that big of a difference or has any other input on Redis vs MongoDB?

    @administrators curious you guys still on redis? I saw another older post that said 1 year was around 40mb of ram utilizing Redis. Would be interesting to see an update of that now. Also new recent thoughts on the Redis vs Mongo.

  • Translator

    @Joykiller On this community forum they use MongoDB if I'm correct, for there clients they use a combination of both Redis and MongoDB (I've attempted to find it but appear to have lost it. source)

  • GNU/Linux

    @Kowlin Thanks, So they combo it now. I'll prob end up starting with Mongo then looking into Redis later on for partial storage for sessions etc as they do later on.

  • Community Rep

    Oh, I'm glad you necro'd this! My opinion has changed since I've had a chance to work closer with redis and mongo. I would now recommend Mongo in all situations (it seems most others do as well). It's interface, setup, and addons are much nicer to work with then redis, and performance is on-par in most circumstances.

  • Translator

    @yariplus definably can agree on that. Let us not have another catastrophe where security plays the main role...

  • @ludam So you tried nodebb + mongo on your huge community or not ? Because i want same, have a millions pages, 50 gb data community, do not know how much RAM mongo will require for this data.
    Anyone here have any idea ?

  • @scottalanmiller could post details, but the community uses a clustered (I believe) mongo backend for NodeBB.

Log in to reply

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.