ntd23
In the current project wich I’m working, is an umbrella project that is been maintened by around ~4/5 years. This project it was thought in that each umbrella app will have own Repo, ie, your own database (this is not so true, some apps do not have a Repo). But now we have about 30 apps and growing. The first things that already broken are the tests, testing entire umbrella app at once almost aways overflows the database connections. Moreover we have data dependencies between apps, sometimes we have to intersect two tables and it is a pain to get the data, the project has a bunch of queues but is not a event driven architecture this queues is more to do background jobs smoth.
I have some points:
- This separeation of database (each app with own
Repo) in a umbrella project can be done correctly, if yes how? - How to deal with splited data in a umbrella project like this in case that have’nt a strong event architecture and old structured data already in database.
- In case to move the spreaded
Repos to one app that will be the database “guardian”, how to deal with this one point of failure that will became the database? - And at last, spread
Repoalong all the apps is a good pratices to keep the bounded context like microservices?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
dimitarvp
Strong opinions ahead.
Ecto.Repoand make wrapping modules that handle all data access (including pulling data from more than one database, at least until you merge everything into one). That should be your very first step.async: truefrom test files. Both can work.Ecto.Queryby themselves and will not directly use theEcto.Repo. They’ll do something likeOurApp.Storage.Order.find_pending(limit: 50), for example. And only theOurApp.Storagenamespace will useEctofunctions. Nobody else. The other apps should not even have:ectoin theirmix.exsfile.Ecto.Schemaresults returned by Ecto functions to other structs. This is 50/50; architecturally it can save you some headache but I’ve very rarely seen this level of paranoia materialize in actual savings of programmer nerves and time. Use your own judgement here.Perhaps this is too general but that’s what I can offer right now. If you have any other questions, shoot.
ntd23
About (3) having the only one “guardian of data”, we have perspectives to deal with a large amount data flow to read and write data and reports, some this data flow perspectives already is a reality. A doubt that I have is, this app do not will become a “single point of failure”? And how deal with that?
Thanks, your opinion will be much valuable for me
dimitarvp
It absolutely will and that’s a good thing. You’ll have one place to look at in case of such problems. Spreading data among several databases only makes it harder to fix a problem.
You will not remove all problems right away. But you’ll have an easier time fighting them off.
ntd23
One thing about this, in case of large app with multiple domains, and some hundreds of models (schemas in this case), not large in scale like google but large sufficient to make a good messy, is not worth split in 2 o 3 data guardians different?
dimitarvp
Sure it can be rational or even preferable but it always Depends™.
If you have e.g. three completely different apps that only occasionally need to work together then separating their databases is the right thing to do.
But if you find yourself regularly having to do cross-database work then the design is not good.
jeremyjh
The typical way to solve this problem is with module structures. Having multiple OTP apps with the exact same dependencies that are always deployed together doesn’t provide any real benefit over just having a hierarchy composed of modules in folders.
dimitarvp
…and using the excellent
boundarieslibrary!