beltrewilton

beltrewilton

Seeking thoughts on the design of my umbrella project: Multinode WhatsApp Gateway and Bot App

Hey fellow devs,

This is my first post in this awesome community, and I’m excited to share my project with you all. As a newbie, I’d love to get your feedback on my design.

Here’s the context: I have an umbrella project with two apps. The first app is a gateway that receives a high volume of messages from Meta’s WhatsApp Cloud API. These messages are destined for different business account numbers (in Meta’s jargon). To simplify, imagine receiving messages like {"1800555", "message 1 from whatsapp consumer"}, {"18007777", "message 2 from another whatsapp consumer"}, and so on.

The second app is a bot that processes these messages. Now, here’s how my architecture works: the gateway (a Plug endpoint) is a node called gateway_node@127.0.0.1. When a message arrives, it reads from Mnesia, which has a map of business accounts to destination nodes. The destination node is a copy of the bot app (app 2), which can be something like customer_services_node@127.0.0.1 or another_company@127.0.0.1.

The advantage of this setup is that I can add nodes (business accounts) on demand without affecting the others.

So, what do you think? Is this approach too newbie-ish? Any recommendations?

Thanks in advance!

Most Liked

BartOtten

BartOtten

Sorry, I was already half sleeping and missed the ‘Dynamic’ part of ‘DynamicSupervisor’ :pensive:

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement