Mongo vs Redis: which one is better for a huge community?
-
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.
-
@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.
-
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.
-
@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)
-
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.
-
@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 mangolassi.it community uses a clustered (I believe) mongo backend for NodeBB.
-
Just for your comparison: We use nodebb with ~3 Million users and the same amount of posts... Running in a redis cluster (we wrote our own layer for that, because the node-redis doesn't support clustering). We tried mongo first, but it was not fast enough for our needs.
-
@Pramvir-Rathee said in Mongo vs Redis: which one is better for a huge community?:
@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 ?Redis is not for large deployments. MongoDB uses far less memory as it is not an "in memory" database. It's meant for scaling much larger than Redis is. You would use Redis for your sessions, but not for your community data.
-
@Florian-Müller said in Mongo vs Redis: which one is better for a huge community?:
Just for your comparison: We use nodebb with ~3 Million users and the same amount of posts... Running in a redis cluster (we wrote our own layer for that, because the node-redis doesn't support clustering). We tried mongo first, but it was not fast enough for our needs.
What's the community link?
-
@Pramvir-Rathee said in Mongo vs Redis: which one is better for a huge community?:
@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 ?While you could get by with much less, you'll want 64GB or more. Sure, MongoDB doesn't need to go all in memory, but for speed, you'll appreciate it.
-
64GB -- that is a lot of memory
We host larger databases on much less RAM (as we're using a cloud provider and high memory installs are crazy expensive)...
There is definitely a speed difference though. Navigating between pages on here takes a split second longer than a Redis database... if you want to see NodeBB fly, use Redis.
-
@julian said in Mongo vs Redis: which one is better for a huge community?:
64GB -- that is a lot of memory
We host larger databases on much less RAM (as we're using a cloud provider and high memory installs are crazy expensive)...
There is definitely a speed difference though. Navigating between pages on here takes a split second longer than a Redis database... if you want to see NodeBB fly, use Redis.
@scottalanmiller was replying to somebody talking about a 50 GB data community though.