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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
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
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews