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.

derek-zhou

derek-zhou

I sense some X/Y problem here. It would probably be better if you state what objective you want to achieve first, so other people can make recommendations for you to choose from.

derek-zhou

derek-zhou

Ejabberd or XMPP in general is meant for an industrial strength chat application with a rich and extensible set of functionalities, on a federated network governed by multiple entities. You may or may not need that.

Using Phoenix Liveview one put together a simple chat application quickly. I have one too:

I do not even use PubSub/Presence. There is more than one way to do it

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New

We're in Beta

About us Mission Statement