L
L
likejavascript2014-04-30 09:04:45
MongoDB
likejavascript, 2014-04-30 09:04:45

How to properly implement messaging system on MongoDB/NodeJS?

You need to implement a messaging system with MongoDB/NodeJS. It is necessary that the user sees a list of dialogs with users and, when choosing a dialog, sees the full correspondence with him (following the example of facebook and vkontakte).
Tell me which scheme for storing messages and dialogs to choose?
Do I need to use two collections of Messages and Dialogs and link them by IDs, or should we keep everything in one collection?
Which approach is better for sharding?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sajgak, 2014-04-30
@sajgak

I'm afraid to seem ignorant, but still I'll ask: why monga?

N
Nikita Kortunov, 2014-04-30
@styou

At one time I did a similar correspondence for a site using mongo, + I used radish as a message broker for everything. I just had a scheme with separate storage of dialogs and messages themselves.
As for the monga itself, there may have been an unstable release, but it flowed well for me, I’m still afraid to do some serious projects on it, who can know how the situation is now?

O
overmes, 2014-04-30
@overmes

I would make a collection of dialogs, and inside them a list of messages

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question