I am currently investigating into writing a real time chat application in Elixir/Phoenix. I have a few queries before I jump into choosing a particular technology. Please see and answer my below queries -
Is WebSocket the standard for writing real time chat applications or can I use gRPC or is there any better transport mechanism?
How does Elixir/Phoenix Channel compares to other technologies or services like
Firestore
Pusher
Anycable
Action Cable
If I decide to go with Elixir/Phoenix Channel, how can I run multiple instances of chat application on Kubernetes pods? Can someone points me to any document/article on this deployment part?
Is there any hidden problem using WebSocket with multiple instances of chat applications that I should know about - like security/stability/scalability/performance?
Even though a bit old would like to know where WebSockets in general but Phoenix Channels in particular stands with respect to the views expressed in above link.
Websocket is one of the reason why I started Phoenix, coming from Rails…
1 If You use Phoenix, it might… but You can use other protocol
2. Firestore. Pusher. Anycable are all external services. Actioncable… Phoenix channel, hmmm, cannot be compared
3. Distribution is one aspect of the BEAM, but it’s not easy to setup
4. Websocket is just the transport
Sorry to tell, but a chat app is just the hello world application in Phoenix. If Rails promotion video is about building a blog in 15 minutes, Phoenix one could be how to build a chat in 15 minutes.
Websocket is just the transport, but Elixir has building blocks for chat application.
You should really try to build one. And You will see it’s easy because of the tools the BEAM provides.
There was a lecture about building a chat in Erlang before Phoenix even existed, unfortunately it is outdated now.
WebSocket is a great transport mechanism and is what I’d recommend generally across the board today. Phoenix has its own protocol on top of WebSockets, but you could implement something like gRPC messages if you wanted. I have never needed to do that.
Redis PubSub works great, but I wouldn’t shy away from the out-of-the-box pg implementation. It’s really not bad to setup in Kubernetes.
There can be lots of caveats with any technology, WebSocket included. Real-Time Phoenix tries to capture those gotchas as much as possible.