Search code examples
xmppejabberdmuc

ejabberd 2 user MUC vs. normal 1-to-1 chat


I've been working with ejabberd for some time now, but due to some recent issues and requirements, I'm curious about something.

If I create a MUC room with 2 users in it, does it differ from normal 1-to-1 chat messaging (performance wise)?

What happens if I always use MUCs for all 1to1 chats?

Does it have any performance overheads or disadvantages?

Do my connections suffer from performance penalties, and does this generally consume more resources or impose any kind of restrictions or penalties?

Any help or insights would be much appreciated.


Solution

  • I don't know how ejabberd implements XMPP, but from protocol perspective:

    1. "Normal" one-to-one chats are stateless server-side. All context (message history etc) is maintained by client. Server just relays messages back and forth. On the other hand, Multi User Chats are maintained by server. Resources (participants list, room settings, message history) have to be stored somewhere, and that responsibility lies on server.

    2. One to one messages are "ad-hoc". When one party wants to chat, they just send a message to recipient. MUC, on the other hand, has to be created, configured prior to starting conversation, and the other party has to be invited to join MUC room before conversation can begin. This adds complexity and/or time.

    3. Multi User Chats give more features, but it is debatable whether they make sense in context of one-to-one conversations (eg. does kicking someone out of conversation make sense?). On the other hand, you probably have to properly configure chatrooms, so that they are not discoverable (one cannot see list of conversations), third parties cannot join them (unless invited to), that users cannot freely change nicknames etc.