Making libraries vs umbrella

Hi,

I have been working through elixir, and looking for a good way to build out a system that will lead to a disturbed system.

I looked into umbrella and also came across a post here where one user said they would rather build libraries then use umbrella.

Is a library a api that gets imported into the app? What are the differences between these two approaches.

Is it possible and or a good idea to have independent databases for each umbrella? if so, what are the down sides?

I have ordered the books on elixir and otp will take a week to come. As also read that building correctly from the start means you can change things better in the future.

Sorry for newbie question. Hopefully a valid question

1 Like

Is a library a api that gets imported into the app?

This would be referring to a mix dependency, I think. Essentially yes, this will get imported into all apps.

What are the differences between these two approaches.

Here is a good resource describing internal deps, external deps, and umbrella apps. That site is a great resource in general.

Is it possible and or a good idea to have independent databases for each umbrella? if so, what are the down sides?

Yes this is configurable. The same challenges with using multiple databases between two applications still exist. You’ll need to understand distributed transactions at the application level if writing into both databases within the same transaction is needed. ‘Good idea’ depends on what you are trying to accomplish :slight_smile: