lanycrost

lanycrost

Umbrella Project for micro-services

Hi Everyone!

I’m thinking about implementing micro-service architecture in our application. I’ve studied a lot of resources.

At the beginning I thought I’d implement it on the basis of processes and nodes, it would be more accurate to write the code of each micro service in a separate file and implement all their communications through messaging. To tell the truth, I had problems and I came across Umbrella Project, but this way solves our problems, but not as I expected.

I think about git sub-modules, but yours suggestion’s is very important.

There is no source code independence, which I really don’t like.

What do you think about this. What resources can you suggest me, what architecture, if it’s not secret, let’s give an example of code, or architecture.

Thanks.

Regards, Khachatur.

Most Liked

mononym

mononym

I feel like there is a fundamental misunderstanding about how to think about systems within the Erlang/Elixir paradigm at play here, and it’s affecting the core design and thinking about how to structure your application(s) to resolve your problem.

A microservice is a program that is designed to have a small area of responsibility, and thus a small surface area when it comes to its API. It can be launched on the same or different hardware stacks as other microservices, but that is a deployment detail that can mostly be ignored.

A process, be it a GenServer or whatever, is a unit of concurrency within the Erlang/Elixir ecosystem. Schedulers allow processes to also be run in parallel, but even that is a result of the concurrent aspect of processes.

Trying to map these two concepts together, with a process equaling a microservice, is going to lead to problems as they are not the same. A microservice could easily be made up of thousands of running processes, or just one…well two if you count the application supervisor.

Similarly, attempting to do clever tricks with blocking rpc calls, or manually controlling the launch of Elixir applications on different connected nodes–while possible–is just increasing the possible configuration and debugging pain points of a running production system. I also just see it as a lot of added complexity that isn’t needed if you just design your solution differently.

If you aren’t going to make a true stand alone microservice (that communicates in a language agnostic protocol) and want to use the slick Elixir communications tools and interconnected nodes…why hang onto that concept at all and not just dive straight into solving the problem the Elixir/Erlang distributed way from the beginning?

keathley

keathley

This is definitely possible using only distributed erlang: Distributed Applications — Erlang System Documentation v27.1.2

axelson

axelson

Scenic Core Team

Why do you prefer source code independence? There’s many benefits of keeping the source code to multiple parts of the entire application/company in the same code-base. Such as the ability to make updates to multiple parts of the system “atomically” (i.e. in one git commit). IIRC Google and Facebook actually just use one huge repository that has the code for all of the projects in the entire company.

LostKobrakai

LostKobrakai

Umbrella projects are a folder structure to develop related otp applications in a single fashion, mostly to resolve the issues of independent projects like version mismatches. If you’re after source code independence why not simply have multiple mix projects?

LostKobrakai

LostKobrakai

Sure, but that should be rather a matter of creating the correct kind of communication interface and deploying stuff onto your infrastructure in a way to let them talk to each other. Umbrella on the other hand is just a fancy word for “one folder for multiple apps”. At runtime there’s no difference between apps created as umbrella and apps created independently.

Also keep in mind, that by default erlang nodes connect in clusters automatically, where each node is connected to each other node in the cluster. Depending on the number of physical nodes you expect to be running on this might not be the best architecture.

Where Next?

Popular in Questions 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
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_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
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
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
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
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement