Live data from Hacker News

Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

lucassifoni.info

21–27 of 27 posts

Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

#21
post #17

Author here, thanks for sharing ! Happy to answer any questions. I think the article outlines it, but I'm at very low scale, with custom development for every client. I mostly build mini-figmas, collaborative or not, that automate specific document pipelines on top of my software, backed by elixir+liveview (or elixir+vue+channels).

Why Vue over the other JS frameworks?

Personal habit, honestly. If I had to re-start I'd probably pick React today, but the Vue switch to a composition API make me like it enough when I was thinking of switching.

What I'm truly rooting for is a non-limited Elm.

Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

#22
post #4

I thought elixir devs have cooled on the whole hot reload update or is this different?

We run a large distributed cluster (currently 4 DCs spanning the US) and use hot code reload for live patches when needed and rolling deployments for our standard releases.

To add to this topic, people who do not know about erlang's hot code loading should watch this talk : https://www.youtube.com/watch?v=pQ0CvjAJXz4

A multi-DC running cluster where parts are progressively swapped at runtime. No database, only OTP.

Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

#23
post #13
post #3

Elixir is the best general purpose programming language for distributed systems.

What makes you say that? Honestly asking. I know a team using it to replace ancient massive mainframe based systems with modern distributed systems and the gist is that the language is fine, but mostly ideal for use cases that leverage the ErlangVM or BEAM stack. The downside they run into is the ecosystem isnt there, at least a couple guys wish they had just used Kotlin/Java for library interoperability with so much…

To put it simply, the BEAM lets you swallow all of your dependent services into a consistent API, no matter network distance or machine dependability. In Python it feels like my main thread, DB, job queue, and OS are all speaking different languages. With Elixir I don't spend much time at all getting different services to work together, at least an order of magnitude less.

Elixir is not perfect, but for me working alone dependency hell was the bottleneck with Python. Now the bottleneck is adding features, which is right where it should be.

Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

#24
post #13
post #3

Elixir is the best general purpose programming language for distributed systems.

What makes you say that? Honestly asking. I know a team using it to replace ancient massive mainframe based systems with modern distributed systems and the gist is that the language is fine, but mostly ideal for use cases that leverage the ErlangVM or BEAM stack. The downside they run into is the ecosystem isnt there, at least a couple guys wish they had just used Kotlin/Java for library interoperability with so much…

I think in many cases the ecosystem issues are overblown. For the common 90% of use cases there are battle tested libraries out there.

For the less common ones, we tend to just roll our own which in most cases isn't that bad if you have reference implementations.

I think the most under-appreciated aspect of Elixir is how it helps reduce complexity. And there isn't a silver bullet here, but the tooling, immutability, pattern matching, process-based concurrency model, etc are all design decisions that, IMHO lead to simpler, more robust code.

(Caveat: of course, like any language, you can make a mess of things.)

I'm curious what libraries they wish existed.

Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

#25
post #4

I thought elixir devs have cooled on the whole hot reload update or is this different?

Hot code reloading for development (recompile-on-save) has issues, but production hot code loading for zero-downtime deployments is still a core BEAM strength and what this article focuses on.

To be fair, I think most apps don't need zero-downtime deployments in the telcom sense.

Most host have blue-green deploy options which reduce downtime and there are fewer corner cases to deal with.

I find local recompile very useful for prototyping in development mode. So much so that I have a keyboard shortcut to trigger a recompile. (I don't like recompile on save.)

Re: Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

#27
post #18

Earlier quoted context omitted.

I think that's a good point. Our largest pain point with Elixir is definitely the size of the community and the associated dearth of niche libraries. The technology behind it, though, is solid enough that once those libraries exist, things really take off. My team wrote several open source medical libraries for Elixir and we've seen it really expand into the healthcare market.

I'd like to have a look at those, have a github link?

Yes! Thanks for the interest, hope they're helpful!

for HL7: https://hexdocs.pm/elixir_hl7/main.html

for MLLP: https://hexdocs.pm/mllp/readme.html

Post reply on HN