Vlahunter

Vlahunter

Hi, i wanted to create a post and get some feedback regarding elixir ecosystem and a project that is on the way.
The short story
My boss assigned me to research around the ecosystem landscape in order to see if a specific ecosystem would help us create robust services in the edge. So far the only other language i am researching around is Golang

About me
I mainly use Node.js but also i use Golang for creating tools/scripts and whatever is needed that i need to build fast and light weight, i am not an Elixir devloper, i just happened to start learning some of the concepts this ecosystem has some months ago and they got me excited enough to have it in the top of the list before i start this research.

The concept
The main idea is not new, i should be able to connect to multiple different controllers (Modbus TCP/RTU), collect the data and either persist or push to a Message Queue. As i imagine, i would have multiple different server applications near the Field, communicating data in one way or another on a Centralized Server. Of course if possible some of the Data Processing could take place in the Field.
[Think of an X amount of controllers connected to a PC-Router per Physical Place]

Proposed Setup in the Field

  • Industrial Grade Router
  • Industrial Mini-PC (probably with at least 8 GB of RAM)

The Problems
Some things that need to be considered while researching on this topic are the following

  • Being able to run in a lightweight manner
  • Being able to change configurations or update parts of the app on the fly
  • Fault tolerance as much as possible considering that there are a lot of points of failure (network, legacy systems, etc)

Some Golang Findings

  • Seems that there is a maturing Ecosystem around the Edge Computing like (EdgeXFoundry)[https://www.edgexfoundry.org/]
  • Fast to Develop
  • Runs Lightweight

Lessons from the Past
In the past i have built a similar solution as a prototype that used Node.js, Mosquitto and TimeScaleDB but seems that in this setup it would be tough to scale (as far as my DevOps is explaining :stuck_out_tongue: )

Main Question
Do you think that the Elixir Ecosystem could possibly offer an advantage on a project like this ? Have you heard of similar Industrial Grade projects run on Elixir/Erlang/BEAM ? Any information would be useful so i could have a more complete picture for this Ecosystem when i will need to present it to my Boss.
Thanks in Advance

PS
This was my first post so please forgive me in case i use the wrong Category. If you need any further clarification, please let me know.

Showing Posts 1 to 10

crova

crova

The 3 bullet points of your “the problem” sections seems to be well within some of erlang/elixir’s core proposition.
Throw in the excellent Nerves project and I believe you got everything you need to focus your research on.

Vlahunter

Vlahunter OP

Thanks for your reply, to be honest i alreeady took a look on the Nerves Project and i got the impression that it is aimed to solve these kind of problems in “smaller” devices so i quickly stopped considering this since in the case of an industrial PC (even with low resources) i was thinking of using Elixir and leveraging the OTP for fault tolerance, i am not sure if i got it wrong here. Good to know that the solutions to the “problem” section seem that could be solved using this ecosystem, although i am trying to see if there are any “good pactices” for projects like these, some system design to help me understand how to properly use the OTP to solve the problems in a correct and future proof way.

wanton7

wanton7

For Go there is also this project GitHub - ergo-services/ergo: An actor-based Framework with network transparency for creating event-driven architecture in Golang. Inspired by Erlang. Zero dependencies. · GitHub . That brings OTP features for Go. But you really can’t have process isolation in Go because it uses shared memory model. That makes Erlang/Elixir bit more robust.

Vlahunter

Vlahunter OP

Yes i already saw that project some time ago but i was not certain if it is production ready. Also, please forgive my ignorance but from reading the docs of Erlang/Elixir i noticed that most of the strengths reside in the BEAM so the VM is the place that magic happens (connect remotely on a running Instance for debug/inspection or hot code swap) so in theory even if Ergo seems to be production ready, still some of the BEAM features would not be available correct ?

wanton7

wanton7

I haven’t used it but my understanding is that it’s production ready. From their GitHub repo https://kaspersky.com , https://www.ringcentral.com and https://lilithgames.com are using it. Sure some BEAM features will be missing. But it seems so compatible with Erlang that you can use some Erlang tools like Observer with it. It will bring things like supervision trees for example that should help with app stability by restarting crashed services. I’ve seen code hotswap talked about quite a bit, but I don’t think almost anyone uses it.

I’m not professional Elixir developer but these things come to mind

Elixir pros

  • Immutable
  • Process/Memory isolation making it more robust. Process can’t access other processes memory directly.
  • Functional language (just functions and data). It being functional might be con as well for hiring people.
  • Probably better 99th percentile latency because of memory isolation. If you create a process, do work and exit GC might not even run and memory is released when process exits.
  • Better remote inspection and able to run code remotely.
  • Single popular web framework called Phoenix. Our company moved from C# to NodeJS/TypeScript, I hate that there are so many different web frameworks with some cons in them all.
  • Phoenix LiveView that you can use to create real-time admin interfaces easily.
  • Elixir as language has reached point where it’s pretty much ready according to its creator. So it won’t be evolving like C# for example. So you can just focus on building things with it.

Go pros

  • Statically typed.
  • Better IDE integration because it’s statically typed. My understanding is that JetBrains GoLand IDE is excellent.
  • Faster running code.
  • Compiles to single binary.
  • Quite likely more maintained good quality libraries available.
  • Easy to learn. I learned Go fully in one day (before generics) coming from C#.
  • Probably easier hiring people
Vlahunter

Vlahunter OP

Thanks for the detailed list, yes my findings point to these in one way or another as well and all of these points are excellent. I suppose i can take a second look on the Ergo and see if it could help me in any way.

dogweather

dogweather

Golang’s creator’s view that their audience is "not capable of understanding a brilliant language" rubs me the wrong way — YMMV. I’ve also found their writing and messaging to be defensive and irrational. I worked at a household-name software company, and the engineers with experience hated the language.

dogweather

dogweather

I found Go very difficult to learn. For example, how to accomplish simple things. How to do application-level multi-threading. How to write safe code, and code defensively. How to write maintainable code. Circa 09/2021, several of these were unsolved problems IMO in Golang.

wanton7

wanton7

I started using C# professionally starting from I think version 1.2. Before it had generics. Anyway I knew all about thread safety and other pitfalls that could bite you. So yes even if it was very easy for me to learn, might not be that for others with different background.

I agree with you that in Go you sometimes have to write lot more code to achieve some simple things compared to other languages. It’s partly because Go is very sinple and language wants to have only one way to do a thing. Go not having generics was big part of this problem. But latest Go 1.18 adds generics to the language. It might take a while until libraries catch up. Even core libraries yet don’t seem to have things like generic sort.

dogweather

dogweather

I agree. And by making it so simple — in the way Assembly is simple — the designers failed in this goal. There are 100 ways to do any particular thing.

For me it was a programming task along the lines of “Give me a sorted list of the map keys.” Something that’d be one line, 20 characters in Python. In Go, this involved a tedious trip to Stack Overflow and a choice between multiple low-level ways to implement it. Each several lines of un-expressive code.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 92995 915
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews