ZastrixArundell

ZastrixArundell

I think the title says it all, but let me write a bit of an explanation.

Say I have an app A which does some work and it hosted on one machine. App B is a phoenix application which is the user dashboard, etc. and is ran on a totally different server. And I want app B to access some data which is stored in app A’s GenServer. Should I use clustering here (if possible, I think it is) or create an element in Redis which is connected to the GenServer.

I’ve no experience with clustering so I don’t know if it’s good for me to use a GenServer to share data accross or use Redis. (Also if it’s possible to cluster 2 different applications)

Showing Posts 1 to 6

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

This feels like an XY problem to me. What kind of information does each application have, and where does each application store that information for its own purposes today?

dimitarvp

dimitarvp

As @benwilson512 says, you are describing to us the problems with one potential solution of your original problem – without telling us what that original problem is.

What are you looking to solve exactly? Redis is an amazing piece of software but global state in general should be avoided as much as possible (easy to say from an academic point of view of course; but it’s a good principle to remember).

ZastrixArundell

ZastrixArundell OP

Okay. In that case I’m going to be giving information of what I actually want to create:

The worker/app A is a discord music bot. It will listen to message events off from Discords’ API and, with the correct input from the user, store specified links in a playlist. Currently the playlist is saved via a GenServer.

I will be making a Phoenix application which will give the user the ability to show the playlist in a nice web UI.

I don’t need any long-lasting persistence, i.e. that the playlist needs to be permanently stored.

Edit:

I think it should be noted that I plan to cluster the worker app.

pablodavila

pablodavila

Couldn’t this just be a monolith? What are you trying to achieve by clustering?

ZastrixArundell

ZastrixArundell OP

  1. I would like to distribute the workload so that not everything is ran from a single node. Audio can and will stutter if the app were to simultaneously stream, let’s say, 2k audio streams.

  2. I’ve never actually clustered any kind of app and I think it would be nice thing to learn.

pablodavila

pablodavila

I’ll preface this by saying that I don’t a ton of experience and I’m going off what I’ve seen on the forum and elsewhere. If I were you I’d just put it all in a single node and collect some metrics on that; the streaming workload might be heavy but the web workload should have a minimal impact on that. Remember that you can also easily scale vertically and it’s way easier than scaling horizontally. This would also let you organize all your modules, functions and the structure of your app in general; afterwards you can split it in order to experiment with clusters.

Keep in mind that I, too, haven’t clustered any apps but it seems to me like Redis would be a better option in this case so you only focus on sharing a decoupled datastore and have a bit more fun while splitting the app.

— 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
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
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
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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

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
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
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
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
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews