Ejabberd vs PubSub - use cases and differences?

These are completely orthogonal things.

  • XMPP is a protocol, just like HTTP or WebSocket
  • ejabberd is an implementation of server for such protocol in Erlang. Just like Cowboy is an implementation of server for HTTP/WebSockets.
  • Phoenix.PubSub is an helper library for exchanging messages between Erlang nodes.

It is not comparable at all.