PCOM
March 14, 2025, 12:39am
1
Hi all. I’m new to Erlang. Everywhere I read, I see how good Erlang is at managing high-concurrency applications.
In my world (IOT) this is a perfect fit.
However, I’m curious what most web-based systems out there use to connect, say, site or application visitors to an Erlang server.
I imagine it goes something like this:
Browser/App → Websocket → Erlang Server → gen_server/registry update → pipe back and forth between.
I imagine this would be useful in situations like
Real time positional tracking (like where a car is on the map)
Chatrooms
General dashboards? In addition to standard REST API’s?
Online matchmaking/multiplayer (Assuming Activision utilized web sockets for this?)
Not 100% sure, but very curious.
Or is there another suggested protocol besides websockets?
Any insight would be greatly appreciated!
vances
March 14, 2025, 4:01am
2
If by “IOT” you mean Internet-of-Things, you may want to look at Constrained Application Protocol (CoAP) (RFC7252 ).
3 Likes
ieQu1
March 14, 2025, 9:44am
3
Or is there another suggested protocol besides websockets?
MQTT protocol is fairly popular for IoT. Shameless self-promotion: we built a platform (in Erlang) that tries to solve all IoT scenarios in a self-contained package: GitHub - emqx/emqx: The most scalable open-source MQTT broker for IoT, IIoT, and connected vehicles
3 Likes
I second the MQTT solution.
In Zotonic we use MQTT over Websocket for the communication between the web-browser and the server. Works like a charm, and MQTT takes care of retrying failed messages etc.
On the client we have a MQTT topic tree, and a bridge topic to the server. On the server we have client topics where any messages for the clients are routed through.
We use response-topics for implementing “calls” to models and other functions on the server.
See also our talk about this subject:
4 Likes