TwistingTwists

TwistingTwists

Ejabberd vs PubSub - use cases and differences?

I know that Whatsapp uses some custom implementation of ejabberd. - which is used for messaging between two clients.

Since Phoenix PubSub also has that bi-directional communication over websockets,it CAN work be used in realtime (soft realtime, not accurate to the 1/100 of a second) .

I am confused between XMPP vs Phoenix PubSub. My questions are :sweat_smile:

  1. For what use cases XMPP is strictly better than Phoenix PubSub?
  2. What are the differences between ejabberd vs Phoenix PubSub ?

Most Liked

hauleth

hauleth

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.

hauleth

hauleth

No, Phoenix.PubSub do not use WS, it do not use Phoenix at all. It is my biggest gripe with that library, that there is phoenix in its name. It is completely independent from any web or Phoenix technology. It uses defined transport (by default pg which uses Distributed Erlang), but it can use any other messaging technology out there.

These also are orthogonal. WebSocket is more like transport protocol (like TCP, but a little bit higher level as it utilises TCP underneath) and XMPP is data protocol (more like HTTP).

Technically - yes, but it would be IMHO a little bit pointless, as it would introduce a lot of overhead with encoding and decoding all that XMLs. So instead it would be better to use for example Kafka or PostgreSQL LISTEN/NOTIFY.

TwistingTwists

TwistingTwists

I will read more about protocols.

Thank you so much for clarifications.

Last Post!

hauleth

hauleth

When you need protocol (because you want to exchange messages with systems that are out of your control) go with ejabberd. If you want internal system communication then Phoenix.PubSub is a solution.

Where Next?

Popular in Questions Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement