I’ve built an application in Phoenix/Elixir which is more like a real-time polling application (like a big chat room). I’m currently exploring the option of building a chat application using Phoenix/Elixir. I went through different threads of Elixir forum in order to understand how I can achieve the same. I found this reply from Chris where he mentions keeping two channels. I’ve also gone through this thread where the end solution seemed to be Contus Fly.
Well I have gone ahead with Chris’s idea and also written some code but I was stuck with the problem of delivering offline messages. I’m thinking of storing all the topics for which the user has subscribed and when the user comes online I can push all the stored messages in different topics to the client (while also sending push notifications for the messages as and when they arrive on the server). But I’m confused where to store the messages till it has been successfully received by the client. Will it be a good idea to store the messages in a central database (Redis/Mongo) or somewhere else. I’m looking for a store-and-forward solution here.