I have a web chat app, and I finish front end of the web app . I want to start back end, so I do not know how can I create logical back end architect, because I want to use ejabberd with elixiri hooks, is there any open source project for it?
If you use ejabberd as the backend, there is no need for a middle tier. Ejabberd supports BOSH, which is an enhanced version of HTTP long polling, so your frontend can talk to the backend directly with it.
tnx so much for ur comment apprciated, if I use ejabberd with elixir hook or just create my own back end with elixir will be best ?
āWhat is best for meā is not a question other people can answer. We can give you ideas, but ultimately you have to pick your own way. Here are 3 ways to leverage Ejabberd that I can think of:
- make a javascript frontend that talks BOSH to your instance of Ejabberd. There will be no Elixir part
- make a Phoenix Liveview application that talks TCP XMPP to your instance of Ejabberd
- combine your Phoenix application and your Ejabberd instance into the same OTP release and skip the network connection
The implementation will get progressively harder however you would gain tighter control from the first way to the last way.
Creating an ejabberd plugin using Elixir isnāt difficult, and communicating over XMPP using a JS library will work just fine. If this is just a ātoyā app then ejabberd is a completely fine choice, especially if it is used as a dep in a larger application. Running it āat scaleā in a multi-node setup is much more complex and has itās own challenges. Especially since it is a large code base that you donāt have a ton of experience with. XMPP is also a beast, and knowing the various XEPs is extremely useful, but takes time.
All of that being said, there are very simple examples of chat apps written in Elixir that youāll have a good amount of control over yourself, know exactly how it works, etc. You donāt get the fancy guarantees, federation, and standards that XMPP gives you, but you should really ask yourself: do you need it? Are you going to support 10s of thousands of users?
tnx so much for ur comment, yes definitely I want to create this app for huge community, that is why I am not sure which one will be best for me, ejabberd or just own elixir chat server with xmpp?
tnx for ur comment, for alots of users this one enough?
What do you mean by a lot? What resources do you have at your disposal? If you are a lone developer scaling is the last thing you should consider.
alots users for chat
āA lotā is not useful to the discussion. Do you know the general magnitude? 1000, 10k, 100k? Thereās vastly different tradeoffs you can take as well as requirements to a team behind a project based on that.
like more than one million users per day for chat app, I mean
What would be the suggested stack for an offline first chat app where we need guarantees that the message & other events have been delivered to the client.
For message queues I was looking at Sequin, RabbitMQ but would ejabberd be a better choice?