5

We have an application for iOS which has a chat feature. Currently it works with long poll. And now we are trying to modify it to work with sockets. When it comes to socket, we have started for a research and it seems that one of the best option is using nodejs with socket.io. Then we have used redis pub/sub to manage the message delivery and storage.

After a few researching on redis, the recommended usage suggests the stored data should fit on memory. But, we have a little big database. We would like to store the whole chat history. So we have started to plan to use redis as a cache database, which will store the online user's chat history (may be not whole of them) and write the actual conversation after getting offline from redis to mongodb/simpledb (or instantly both of them).

So as a summary, we are about to decide to use nodejs and redis pub/sub to deliver messages, redis as a cache database, and mongodb to store the whole conversation.

What do you think about the design? Is this acceptable? Or, if there is a better way you can suggest, can you please explain a little more?

Thanks in advance.

4

1 回答 1

3

对于聊天系统,您的想法很大。如果你认为你将达到一百万用户,那就去吧。还要考虑可用性——您的系统将如何处理机器故障?

于 2012-04-06T13:05:15.520 回答