Data isolation for Modular Monoliths - DB Schemas, EF Core

  Рет қаралды 9,037

Milan Jovanović

Milan Jovanović

Күн бұрын

Пікірлер: 35
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@sweeperq
@sweeperq 7 ай бұрын
Why go through the trouble of making the schema a constant for the migration, only to hard-code it in all the queries?
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Meh, just wanted to make things explicit for the raw SQL example. All it takes is move the constant one level below, and reuse it.
@ramytawfik9168
@ramytawfik9168 15 күн бұрын
Milan Please I do not understand the last part of this video , how will you define 2 users one for each schema, one that will have access to the user schema and then another that will have access to the training schema ?
@MilanJovanovicTech
@MilanJovanovicTech 15 күн бұрын
Check this: www.milanjovanovic.tech/blog/internal-vs-public-apis-in-modular-monoliths#protecting-your-modules-data
@kekwonur
@kekwonur Ай бұрын
Hi Milan, instead of using different schemas, is there a way to make one schema dynamic and change the schema dynamically while the application is running?
@MilanJovanovicTech
@MilanJovanovicTech Ай бұрын
You'd have to construct your queries with a dynamic schema
@alexdefaro
@alexdefaro 6 ай бұрын
Hi Milan... Great video... Would you use the same approach if you have different databases for each module?
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Different SQL database? Using schemas could still make sense.
@ahmedameen2
@ahmedameen2 4 ай бұрын
In a real scenario where for example, Orders table contains fields like CreatedBy which is a logical relation to Users.ID would you allow to join between the two different schemas? If not, how will you handle if you need to display orders created by user name?
@MilanJovanovicTech
@MilanJovanovicTech 4 ай бұрын
It's fine having a UserId column, and in fact needed. How else would we know who made the order? Simply fetch the related data at runtime and return it to the client.
@ahmedameen2
@ahmedameen2 4 ай бұрын
@@MilanJovanovicTech how about storing user name in Orders table and maintain consistency with domain events?
@danielbahe
@danielbahe 3 ай бұрын
@@ahmedameen2 Domain events are ok, but you are adding complexity, is it worth in your specific case or could be overengineering?
@StjepanPuljko
@StjepanPuljko 7 ай бұрын
I don't know if I'm missing something, but you are using Hangfire for further processing outbox messages? If that is so, Hangfire should already have it's own schema or database, so why don't you just write common integrations service to process outbox messages, since if you are using Hangfire (which is external service) it can't be domain event.
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Hangfire/Quartz/Hosted service, it's an implementation detail mostly
@Nikegamecentral
@Nikegamecentral 7 ай бұрын
Hello Milan! Thank you very much for your videos! Are you familiar with the actor model of programming? For example, about an application written using Akka? Can you release a video about this? It would be very interesting
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
I think Akka would be interesting, yes :)
@mesutdemirci7933
@mesutdemirci7933 7 ай бұрын
Great video ..thanks a lot
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
You are welcome!
@nicholasgueli305
@nicholasgueli305 7 ай бұрын
great video. wouldn't it be better to have one module that handles all the outbox messages? if I have N modules I have N background jobs if performance might decrease.
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
That would introduce coupling, though. Depends on what you want. Also, having one outbox processor would decrease the overall throughput.
@SajjadKhanTech
@SajjadKhanTech 6 ай бұрын
If we have seperate databases per Module then incase while querying we gonna needs to fetch data from a table which is inside anotherr database ??
@MilanJovanovicTech
@MilanJovanovicTech 6 ай бұрын
Try not to mix queries from different modules
@SajjadKhanTech
@SajjadKhanTech 6 ай бұрын
@@MilanJovanovicTech Ok Let take one example here milan I have modules like Patient Demographics Appointments Reports In such case, I can make above modules as SubModules under Module Reception . By this, I can have all related tables under one Module. Is that correct ?
@nagibatorbatcka86
@nagibatorbatcka86 7 ай бұрын
Great video. How about creating video about prometheus or loki ? Can be in combination with Grafana for better data visualization.
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Going to cover OTel + Aspire first
@artemissterio
@artemissterio 7 ай бұрын
Great video 👍 But I still wonder - is there any other option for outbox messages table instead of code duplication?
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Expanding the abstraction, and passing in the respective schema
@artemissterio
@artemissterio 7 ай бұрын
@@MilanJovanovicTech How about using only one OutboxMessages table (in public schema, for example) with only one processor?
@dariuszlenartowicz
@dariuszlenartowicz 7 ай бұрын
@@artemissterio it's ok too - depends on how modules are busy :)
@LCMinato
@LCMinato 7 ай бұрын
Hi Milan, thanks a lot as always for your videos, love them ! I'm interested by your course about the MMA, and I was wondering if you'd consider uploading it on platforms like Udemy ? thanks for helping
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
It won't be coming to Udemy
@Kasiux
@Kasiux 7 ай бұрын
Arent modular monoliths just monoliths but with good system design?
@MilanJovanovicTech
@MilanJovanovicTech 7 ай бұрын
Kind of: www.milanjovanovic.tech/blog/what-is-a-modular-monolith
Are You Accidentally Crippling Your EF Core Queries?
17:18
Milan Jovanović
Рет қаралды 31 М.
Exceptions Are Extremely Expensive… Do This Instead
17:15
Milan Jovanović
Рет қаралды 49 М.
«Жат бауыр» телехикаясы І 26-бөлім
52:18
Qazaqstan TV / Қазақстан Ұлттық Арнасы
Рет қаралды 434 М.
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
Monolith vs Microservices vs Serverless
23:05
Code With Ryan
Рет қаралды 80 М.
Completely Get Rid of Exceptions Using This Technique
19:24
Milan Jovanović
Рет қаралды 27 М.
The Way of the Modular Monolith, Victor Rentea
49:41
Codecamp Romania
Рет қаралды 6 М.
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 1,2 МЛН
EF Core Multitenancy For Your SaaS Applications
14:41
Milan Jovanović
Рет қаралды 28 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 903 М.
Stop using std::vector wrong
23:14
The Cherno
Рет қаралды 160 М.
Getting Started with Modular Monoliths in .NET
12:37
Milan Jovanović
Рет қаралды 27 М.