socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

MongoDB Instead of Redis?

Open alonronin opened this issue 14 years ago • 12 comments

alonronin avatar Feb 09 '12 15:02 alonronin

Will mongodb be plugable as store for socket.io?

alonronin avatar Feb 20 '12 16:02 alonronin

Why do you want this? Redis is very fast and reliable solution for this case. I don't think MongoDB can work with comparable speed.

cris avatar Feb 21 '12 16:02 cris

To use just one DB solution

alonronin avatar Feb 21 '12 18:02 alonronin

mongodb doesn't have a push service the way Redis, CouchDB and Postgres do so I don't see how you would implement this as effectively.

mikeal avatar Feb 21 '12 18:02 mikeal

There are other ways to pub/sub, for example zeromq provides pub/sub http://zguide.zeromq.org/page:all#Getting-the-Message-Out.

zoowar avatar Feb 23 '12 19:02 zoowar

The only way I can see to do this with mongo is polling. I have also a usecase where the absolute performance is not that way important, f.e. chat. I can poll every 1 sek the database from every frontend server.

kof avatar Jun 22 '12 10:06 kof

Just created this https://github.com/kof/socket.io-mongo

Feedback is welcome.

kof avatar Jun 27 '12 19:06 kof

kof, great job :-) i'll give it a test!

alonronin avatar Jun 27 '12 19:06 alonronin

for the case somebody is interested in benchmarks, the seem to be really great

https://github.com/kof/socket.io-mongo#benchmarks

kof avatar Jun 30 '12 10:06 kof

If it's not too much trouble, maybe you could also benchmark https://github.com/dshaw/socket.io-zero on your system.

zoowar avatar Jun 30 '12 19:06 zoowar

Sure, but https://github.com/JustinTulloss/zeromq.node/issues/116

kof avatar Jul 01 '12 09:07 kof

Looks like you don't have the development files installed. I don't know how things work in OSX, but in Fedora you would need to "yum install zeromq zeromq-devel"

zoowar avatar Jul 01 '12 17:07 zoowar