mjsisley

mjsisley

Phoenix/Ecto Umbrella Project App Separation?

I am experimenting with an umbrella project that uses Phoenix to provide sockets and an API. I have separate apps for authentication, chat, and posts. This topic is similar to Should we Separate Ecto From Phoenix in Umbrella App?.

I am wondering if the following approach is a sane one (and for alternative recommendations if not).

  • A db app that manages all migrations and is connected to an underlying database.
  • The remaining apps and services each have their own Ecto repo that define schemas (including changesets). These will reference other App repos for foreign key relationships. Data validation and error handling would then be dealt with on a per app basis. The goal would be to hopefully limit the coupling of the apps to the schema definitions.

As a secondary question:

Initially, I attempted to create separate databases for each app. The preclusion of using foreign keys across databases makes this prohibitive. I briefly experimented with Postgres Foreign Data Wrappers, but it seems these are meant more for migration from older databases or short term use. Additionally, it seems too far from the norm for me to be comfortable pursuing at the moment and I am not sure how integration with Ecto (setting up foreign keys) would be. If anyone has any experience doing something similar, I would be curious.

First Post!

Qqwy

Qqwy

TypeCheck Core Team

I think that your question might be very similar to Shoud we separate Ecto from Phoenix in an Umbrella Application? that was asked a few days ago :slight_smile: .

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
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
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
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
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
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New

Other popular topics Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
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
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement