A couple of days ago I was discussing with a friend about different approaches to write microservices.
He said that if he was going to write a new microservice platform from scratch, he would probably use Go + Docker + Kubernetes + Rancher + Kafka/RabbitMQ.
I said that I would probably just stick with an Elixir’s umbrella using supervision tree and process discovery across nodes, using an external MQ or even Elixir Port to communicate with external actors when needed.
In the end we agreed that Go and Elixir proposes their own approach to the same problem, and that the context of the problem would tell which solution could be the best fit.
For me, this discussion raised a few questions that probably will be answered through experience and time.
Since a question like “why elixir is the best language in the world?” in the elixir forum would have very biased naswers, now I ask you: when would you not use Elixir?
If I can’t afford the overhead? there is 0 chance I’d reach for Go though I think Elixir + Rust is pretty much It for wast majority of use cases. And for use cases where Elixir would be too much overhead I’d reach for Rust. Both Rust and Elixir make writing concurrent code sane and safe in Go you can shoot yourself in the foot very easily and I’d rather “fight” compiler a bit than debug race conditions in prod. (not to mention how a lang. in 2018 can exist without sane package manager is a mystery).
If need a very quick 5mins throwaway script I can/need to use out of my IDE, like cutting parts of JSON I don’t need I would use Python. Or if it’s something I have to put on server and just execute, without all the hassle of elixir and Erlang installation,
I’ll provide a (webdev/Phoenix focused) counterpoint. For the time being I use Elixir very little — but I’m rooting for it. My interest is primarily in frontend dev, though at work I have to do some backend dev in JS and Java as well. For my side projects I have been looking for a language/framework combo that provides fast and pleasant development for basic CRUD APIs with authentification. I just want this to be fast and painless so I can concentrate on the frontend work (I’m crazy, I know). I like a lot of what Elixir/Phoenix offers, but for the time being I’m sticking with Python/DjangoREST for the following reasons:
More libraries for Python.
Included user models and auth functionality in Django.
Better googleabilty and availability of docs/books for Python/Django.
Mostly anecdotal evidence for Elixir/Phoenix performance. Where are the benchmarks that compare several frameworks in differnet scenarios? In Techempower’s latest round Django outperforms Phoenix in most tests. I know you guys here are sceptical about these benchmarks, but why isn’t the Phoenix subsmission fixed if it’s misconfigured? Why aren’t alterantive benchmarks provided if Techempower’s are flawed?
That said, I’m eagerly watching Elixir/Phoenix. I will read the Programming Phoenix book when it’s updated to 1.3, and perhaps write the next API in Elixir/Phoenix.
Yeah. When writing “scripts”, I start with Bash and quickly upgrade to Ruby as soon as I need to write a function or do some more complex looping. Gawd, shell scripting sucks.
Anyway… would not use Elixir for that…
To elaborate, Elixir isn’t really good with forking Unix processes. There is the porcelain package, which tries to make it nicer, but to get full nicety, it requires you install some shim written in Go. Ugh.
This may sound really, really stupid and obvious, but one of my primary use cases for Ruby (and before that, Smalltalk of all things) is prototyping Object Oriented interfaces. Even when the final language is going to be Swift, Objective-C, or in my younger years C++, I’ve found that figuring out the interface for a class is often easier to do in a language that doesn’t have as long an edit - results cycle.
Needless to say, Elixir is not a really good choice for investigating OO interfaces (though sometimes the clear separation of message passing means it’s not as far off as you might first think).
Unlike many folks who have chimed in, I do use Elixir for one-off scripts. But if I had to write larger script system (say build and deploy scripts for a non-elixir application) I probably wouldn’t use it for that.
When i look that benchmark. I see rails outperforms phoenix in most tests. I dont know why. Most of phoenix developers came from rails as me. We see rails isn’t even close to phoenix about performance in real life situations.
Can someone compare “Docker + Kubernetes + Rancher + Kafka/RabbitMQ” vs Elixir concurrency?
Wings3D is Erlang (and seemed pretty damn good when I played around with it a few years ago, interface and performance were both great), but I never investigated why the author/s settled on Erlang rather than something that you would expect would be more suited to the task.
Managing yourself Kafka and Kubernetes is not easy task. You will need all devops team or … cloud provider.
I would ask question if you are planning to use this in some public cloud, or you would like to maintain Kubernetes (K8s) by your self.
If you use public cloud , do you want to use other services from public cloud provide?
If so this this case I would stick with language that is official supported by cloud provider.
But if someone mentioned rancher I suppose this case K8s will be maintained by this person.
So you can create some services in elixr, some in go , some in python.
But also in this case I would choose language that fits the best for micro services architecture under K8s. So you can easy do tracing, monitoring …
Wings3D was implemented by Björn Gustavsson of the Ericsson OTP team who has been working with the compiler and the BEAM for over 20 years. It is rumoured that he improved the efficiency of floating point calculations for this tool.
I think most of the time I would not use Erlang/Elixir for something is a task for which they are just not well suited. For example, when I do web frontends I use Elm. If I had to do major number crunching (Not that I do that) I might reach for Fortran etc. Erlang & Elixir solve one set of problems really well, but there are lots of others that other things probably do better for.
I would not use Elixir when I have discussed the pros and cons with a client and they have not given the go ahead to proceed with a (gradual) migration to Phoenix/Elixir.
One client said no mainly because of the scarcity of elixir programmers with a side dish of not wanting to have yet another language, two others are happy enough for me to do my own (isolated) side project to experiment what a migration would entail (at my, not their cost), but don’t see it as a business priority, and therefor have not assigned any funds to it.
I am looking for greenfield projects that would start with Elixir … (I am just starting to learn Elixir and Phoenix, though it brings back memories of using prolog about 2 decades ago)