asinghbrar

asinghbrar

Any tips or advice for monorepository tooling?

Hi everyone,

We’re in the process of moving our organization toward a monorepo and I’d love to hear from folks who’ve done this with Elixir in the mix.

Right now our primary codebase is an Elixir monolith, but we also run essential services in Java, Go, and Python, and our frontend is in TypeScript. As we continue to scale, parts of the Elixir system will be split out into separate services, and some of that functionality will likely be reimplemented in Java.

We’re evaluating build/test tooling for the monorepo and are currently looking at Bazel. The challenge is that Bazel’s Elixir ecosystem still feels pretty early, so we’re trying to figure out whether to invest there or consider other approaches.

If you’re running Elixir in a polyglot monorepo (especially alongside JVM services), I’d really appreciate any lessons learned:

  • What build / test / packaging tooling are you using?

  • How are you handling dependency isolation and release management?

  • Any gotchas with cross-language CI or incremental builds?

Happy to share more context if helpful, and open to DMs if you’ve been down this path and wouldn’t mind a quick chat.

Most Liked

Arsenalist

Arsenalist

Hey, I see this happening in my app in the future and was doing some research on some tooling like Nx etc, but I’m contemplating just managing this stuff using mise and it’s Monorepo support which is experimental:

Benefits like detecting affected files etc may not come out of the box with this approach, but it seems simpler to get started with.

phcurado

phcurado

I have used elixir and other languages in a single monorepo. We choose to separate the tooling for elixir projects to the other languages for the same reason you mentioned: The generic tools that handles monorepos doesn’t seem mature enough for elixir.

We used the elixir workspace and it was good for my use case. This project have mix tasks that can identify automatically elixir projects and dependencies, build only changed projects and print the project dependency graph for better visualization of your projects.
Then on our other tools to manage other languages inside the monorepo, we would just ignore elixir projects.

We were using trunk based development, merge to main would release the application. If a dependency was changed, it would build and test app projects that are using the dependency (elixir workspace can identify/track this). We were not versioning the dependencies, since we didn’t want to handle different versions of a dependency inside the same monorepo. This is similar to the Facebook monorepo approach, no versioning to avoid inconsistencies.

For us it worked quite well, I would say better than expected even. It also would depend on the engineers, company development culture and project’s ownership.
One thing we could have done is to have the elixir codebase in a separated monorepo, since we were not reusing anything from the other languages and packages there. I guess this would depend more on your use case, but overall I was happy with the setup.
Atomic changes are great because in a single merge I could deploy multiple projects but you need a good tooling, automated tests, etc on your projects since a single commit can also break multiple projects. In general needs strategy for rollbacks, deployment (blue/green, canary, feature flags, etc) so you are confident whenever you merge/deploy your code.

Where Next?

Popular in Questions Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
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
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
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 30877 112
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
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
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
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New

We're in Beta

About us Mission Statement