Go or Elixir which one is best for chat app services?

I try to create chat services for mobile chat app like whats app for about 1 Billlion users, so I do know which language best for me, golang or elixir, any idea?

Is this a crosspost of Should I use Go or Elixir for chat app back-end? - Getting Help - Go Forum, or just identical by accident?

WhatsApp’s backend is implemented in Erlang and the WA lead developer attributed the fact that they could serve 500mio users with a team of only 30 people to their technology stack. So there is no doubt that Erlang and therefor also Elixir is a great choice for a chat backend.

The more important question is what protocol to use, e.g. MQTT or XMPP. VerneMQ and MongooseIM are great open source servers for these protocols.

1 Like

tnx so much for ur answer, which protocol is best for it?

There has been blog posts on Discord regarding Elixir as Backend. They’ve also extend some of their services with Go and Rust using NIFs but eventually favors Rust.

Check out their blog posts:

3 Likes

Pls, don’t mention “Why Discord is switching from Go to Rust” - comments there expose why. TLDR - its an absolutely inadequate attempt to use golang.

upd: seems they changed their blog platform. all comments disappeared. the main issue was taking a super old golang version (i don’t remember all points mentioned in that comments, but there were a lot of them)

1 Like

Difficult to say. XMPP is a complex protocol with a lot of features. I have used it for a hobby project and it takes time to handle it. XMPP is also the protocol that WA kind of used as a base for their custom protocol. I heard the Facebook messenger uses MQTT. MQTT is more light weight. I have no experience with but I would give it a try if I needed messaging in a new project.

1 Like

which one is best, XMPP or MQTT. Which is more efficient in projects?

you can use both, they are not related to each other, and they can work independently and simultaneously, and XMPP is messaging protocol and MQTT is pub sub protocol.

1 Like

“Best” depends on what the project needs. As @Skysoft13 pointed out, these two technologies aren’t even used for the same things. Imagine asking a similar question about things in the physical world: “which vehicle is best, trains or cars. Which is more efficient in transportation?”

2 Likes

Why not use the same as them? :003:

WhatsApp is arguably the busiest, most stable chat app ever created - and they use Erlang. Elixir runs on the Erlang VM :smiley:

2 Likes

I would say it depends on how much of the standard XMPP stuff (such as the roster, presence system
) you need for your app and how much you are willing to implement yourself.

If you don‘t need the heavy XMPP features and you are able and willing to implement your own logic, go for MQTT.

1 Like

Don’t forget Discord!! Literally millions of people in the same room and they use Elixir proper (but yeah, still Erlang/BEAM VM
 :slight_smile:)!

1 Like