sodapopcan

sodapopcan

I’m looking for some feedback/validation on a deployment setup. It’s a few months out still, just asking early.

My main app is a mini monolith. It’s a relatively small e-commerce web app with an admin area and some other features all contained within the same Application (not an umbrella). Everything is LiveView so there is no web API involved (thanks LiveView, ya da best <3). Apart from that, there is a separate tiny Application that handles image processing. It’s developed as a separate app for two reasons: a) The Security considerations that come with running libvips as BEAM NIFs, and b) I want to be able to run a copy of it locally as we do a bunch of image experiments that don’t need to run in the cloud.

My original thought was to have a little web server for the image processor and communicate with it that way. Then I remembered: “Oh right, BEAM. I can just run the two apps on separate nodes and connect them, right?”. After doing some reading and some light experiments, it seems that I would want to use libcluster to have the two apps running on different nodes find each other. I can then communicate between the two with plain ol’ message passing. Does this make sense? Am I on the right track?

Sorry if this is all coming off as incredibly obvious—I have absolutely no experience with distributed Elixir and while it seems right based on reading and trying stuff out, I just wanted to say it “out loud” to someone since I’m working solo here. My brain is still very much stuck in the ways of Rails when it comes to deployments.

I’m not looking for any how-to answers or anything, I just feedback as to if I’m on the right track and if there is anything I’m not considering and and maybe some links to some resources to RTF :slight_smile: I do know where the official docs are which is what I’ve been reading.

Thanks!

Showing Posts 1 to 4

JEG2

JEG2

Author of Designing Elixir Systems with OTP

I’m sure you know this, but libcluster isn’t required to connect nodes.

sodapopcan

sodapopcan OP

Hi James!

I do indeed know that but wasn’t sure whether it was better to make them auto-discoverable or not, even at small scale. Of course, I’m trying to go for the absolute simplest setup. I’ll likely be only running the two or three nodes, so my initial assumption was to give them explicit names and pass messages via {NodeName, host} tuples, which is what I’ve done while experimenting. I take it that should suffice? I assume I can just use something like monit for bringing the image node up on the off-chance it actually crashes.

Thanks!

schneebyte

schneebyte

I would recommend the excellent :pg module.

I’ve been using it a lot lately with an umbrella app that runs on one node locally and gets deployed to multiple nodes in a cluster.
I just have my processes/services join a :pg group. Then use :pg.get_members to get a list of pid’s. Don’t have to worry about node names.
If a process goes down it automatically gets removed from the group.

Now for security considerations, as far as i know if an exploit gains access to one app it could just access the whole BEAM VM including all other apps and all connected nodes.

sodapopcan

sodapopcan OP

Awesome, thanks for the reply and suggestion! I’ll take a look as that sounds pretty simple for my usecase.

As for security considerations, I just meant those related to using Vix. It’s possible for massive images to crash the whole BEAM (as opposed to just a process). I’ll be doing my best to guard against that but I feel much safe running on it on its own node as I’d rather not have the whole app taken down, even temporarily.

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
mnkhod
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
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
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews