Decisional

Decisional

Elixir in an environment of polyglot microservices; feasible or not?

My question: considering an application consisting of a set of polyglot [micro ~ substitute your definition]-services, would Elixir, and in extension Erlang, fit into such an environment?

Disclaimer: I am new to Elixir. I’ve started learning and experimenting only a few weeks ago, and do not mean to offend with an unthoughtful question, I just didn’t come across satisfying answers to this problem yet. :drooling_face:

There have been several questions to this avail, and from the discussion around those, as well as from two excellent articles - [Dawn of the Microlith](http://Dawn of the Microlith), http://blog.plataformatec.com.br/2015/06/elixir-in-times-of-microservices/ - I have gathered that the unique features of Erlang and Elixir, namely the BEAM and Elixir Umbrella-Projects, much of the real world benefits of a micro service-oriented architecture can be had in Elixir, without some of the complex drawbacks of such a system - all while not actually writing micro-services.

What is still an open question to me, however, is how BEAM-bound languages, Elixir in particular, can cope in an environment in which they’re not the sole, or even a privileged, resident - namely as part of a set of polyglot micro services, written in different languages and using vastly different tech-stacks.

While I’ve heard that the BEAM has performance related issues when communicating with external processes, I haven’t found much concrete information of Elixir or Erlang in such a context, nor am I even aware of the preferred, if there’s such a thing, way of handling inter-process communication with the BEAM.
While I’ve read up briefly on ports and such, I haven’t gained much clarity yet.

So, I guess to sum it up, there is a core question in my mind:
Is Elixir fit to run, as a service and containerized, besides a myriad of other, distributed, not-necessarily-Elixir services?

First 3 of 3 Posts Switch mode

peerreynders

peerreynders

Just some examples:

It’s is sometimes suggested that Erlang/Elixir can be used with the BEAM to choreograph activities. However a lot of things can be done quite effectively on the BEAM itself so interactions are typically restricted to scenarios where there is a significant, tangible benefit to doing something in a different environment.

In terms of containerization it becomes a question of what role Erlang/Elixir has to play in terms of controlling distribution as your container management system is largely calling the shots. The BEAM was designed before containers arrived on the scene and doesn’t necessarily benefit from the extra layer of indirection that containers impose. Erlang and the BEAM have a bit of a different view of what constitutes reliability and high availability - while processes come and go if designed properly, the “system” should rarely need to be down (i.e. cycled or re-cycled) even in the face of single node failures (hardware or software).

I would expect that a system designed around OTP/BEAM would consume much fewer resources compared to an on-demand container-based management system that is more targeted toward the elastic consumption of readily available commodity server resources.

https://medium.com/@pentacent/getting-started-with-elixir-docker-982e2a16213c

https://blog.ispirata.com/clustering-elixir-erlang-applications-in-kubernetes-part-1-the-theory-ca658acbf101

https://medium.com/polyscribe/a-complete-guide-to-deploying-elixir-phoenix-applications-on-kubernetes-part-1-setting-up-d88b35b64dcd

https://medium.com/polyscribe/a-complete-guide-to-deploying-elixir-phoenix-applications-on-kubernetes-part-2-docker-and-81e934c3fceb

https://medium.com/polyscribe/a-complete-guide-to-deploying-elixir-phoenix-applications-on-kubernetes-part-3-deploying-to-bd5b1fcbef87

https://medium.com/polyscribe/a-complete-guide-to-deploying-elixir-phoenix-applications-on-kubernetes-part-4-secret-f851d575bdd1

If I recall correctly Dawn of the Microlith was more about avoidance of the overhead of micro services by sticking to systems designed around the BEAM. In a sense, instead of building a microservice around a bounded context you would build an OTP application (or a set of them) instead.

blatyo

blatyo

Conduit Core Team

As long as you’re using open standards for communication between services. It generally doesn’t matter what language you choose. Erlang and Elixir speak most of those open protocols like HTTP, AMQP, etc. I’d say, you’d be hard pressed to find a language that couldn’t fit.

corlaez

corlaez

The polyglot use case would be a viable way to introduce elixir to a bigger audience.

I have a java http server that calls Python, c# grpc workers to build a response. I thought about using elixir/Phoenix as a the communication layer dropping the need of grpc. However I am still confused about how to go about this I am unsure if the Approach should be inside beam or using a more agnostic solution PubSub with Redis backend. Ideally I would like queue the workload and consume it as a limited amount of workers finish their take (to avoid chocking the server)

PubSub with Redis sounds like a better agnostic and stablished solution to me but if you can make a case for a was to do it inside beam I will listen. Ideally the extra glue code should be short and wel maintained (and support as much Langs as possible)

I would love to see an example where we create polyglot workers that sleep and then return a string to the caller. Please refer to me if one exists otherwise I would love a little advise on what would be the right way to go about this.

I know I am almost reducing Phoenix to a generic pub sub at this point but I think that would be a great way to introduce traditional companies that are in microlith hell. First you glue your services with beam and then you start coding more in elixir.

— All posts loaded —

Where Next?

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement