Data isolation for Modular Monoliths - DB Schemas, EF Core

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

Milan Jovanović

Milan Jovanović

Күн бұрын

Пікірлер: 35
@MilanJovanovicTech
@MilanJovanovicTech 9 ай бұрын
Want to master Clean Architecture? Go here: bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: bit.ly/3SXlzSt
@sweeperq
@sweeperq 9 ай бұрын
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 9 ай бұрын
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 Ай бұрын
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 Ай бұрын
Check this: www.milanjovanovic.tech/blog/internal-vs-public-apis-in-modular-monoliths#protecting-your-modules-data
@kekwonur
@kekwonur 2 ай бұрын
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 2 ай бұрын
You'd have to construct your queries with a dynamic schema
@alexdefaro
@alexdefaro 8 ай бұрын
Hi Milan... Great video... Would you use the same approach if you have different databases for each module?
@MilanJovanovicTech
@MilanJovanovicTech 8 ай бұрын
Different SQL database? Using schemas could still make sense.
@ahmedameen2
@ahmedameen2 6 ай бұрын
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 6 ай бұрын
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 6 ай бұрын
@@MilanJovanovicTech how about storing user name in Orders table and maintain consistency with domain events?
@danielbahe
@danielbahe 5 ай бұрын
@@ahmedameen2 Domain events are ok, but you are adding complexity, is it worth in your specific case or could be overengineering?
@Nikegamecentral
@Nikegamecentral 9 ай бұрын
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 9 ай бұрын
I think Akka would be interesting, yes :)
@SajjadKhanTech
@SajjadKhanTech 8 ай бұрын
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 8 ай бұрын
Try not to mix queries from different modules
@SajjadKhanTech
@SajjadKhanTech 8 ай бұрын
@@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 ?
@StjepanPuljko
@StjepanPuljko 9 ай бұрын
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 9 ай бұрын
Hangfire/Quartz/Hosted service, it's an implementation detail mostly
@nagibatorbatcka86
@nagibatorbatcka86 9 ай бұрын
Great video. How about creating video about prometheus or loki ? Can be in combination with Grafana for better data visualization.
@MilanJovanovicTech
@MilanJovanovicTech 9 ай бұрын
Going to cover OTel + Aspire first
@nicholasgueli305
@nicholasgueli305 9 ай бұрын
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 9 ай бұрын
That would introduce coupling, though. Depends on what you want. Also, having one outbox processor would decrease the overall throughput.
@artemissterio
@artemissterio 9 ай бұрын
Great video 👍 But I still wonder - is there any other option for outbox messages table instead of code duplication?
@MilanJovanovicTech
@MilanJovanovicTech 9 ай бұрын
Expanding the abstraction, and passing in the respective schema
@artemissterio
@artemissterio 9 ай бұрын
@@MilanJovanovicTech How about using only one OutboxMessages table (in public schema, for example) with only one processor?
@dariuszlenartowicz
@dariuszlenartowicz 9 ай бұрын
@@artemissterio it's ok too - depends on how modules are busy :)
@mesutdemirci7933
@mesutdemirci7933 9 ай бұрын
Great video ..thanks a lot
@MilanJovanovicTech
@MilanJovanovicTech 9 ай бұрын
You are welcome!
@LCMinato
@LCMinato 9 ай бұрын
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 9 ай бұрын
It won't be coming to Udemy
@Kasiux
@Kasiux 9 ай бұрын
Arent modular monoliths just monoliths but with good system design?
@MilanJovanovicTech
@MilanJovanovicTech 9 ай бұрын
Kind of: www.milanjovanovic.tech/blog/what-is-a-modular-monolith
Modular Monolith Architecture: The Missing Guide to Public APIs
13:45
Milan Jovanović
Рет қаралды 9 М.
Are You Accidentally Crippling Your EF Core Queries?
17:18
Milan Jovanović
Рет қаралды 32 М.
Blind Boy Saved by Kind Girl ❤️
00:49
Alan Chikin Chow
Рет қаралды 50 МЛН
Миллионер | 6 - серия
28:05
Million Show
Рет қаралды 1,6 МЛН
EF Core Migrations Deep Dive, Applying Migration, SQL Scripts
16:41
Milan Jovanović
Рет қаралды 19 М.
Monolith vs Microservices vs Serverless
23:05
Code With Ryan
Рет қаралды 80 М.
Getting Started with Modular Monoliths in .NET
12:37
Milan Jovanović
Рет қаралды 29 М.
EF Core Multitenancy For Your SaaS Applications
14:41
Milan Jovanović
Рет қаралды 30 М.
C can do this too and it's faster than Python
2:09:48
Tsoding Daily
Рет қаралды 27 М.
Microservices vs Monolithic Architecture
4:08
Drawing Boxes
Рет қаралды 20 М.
7 Design Patterns EVERY Developer Should Know
23:09
ForrestKnight
Рет қаралды 344 М.
What Is the Fastest Way To Do a Bulk Insert? Let’s Find Out
15:04
Milan Jovanović
Рет қаралды 14 М.
New (AND BETTER!) Way of Doing Data Seeding in EF Core | Entity Framework Core 9
10:45
Programming with Felipe Gavilan
Рет қаралды 978
Blind Boy Saved by Kind Girl ❤️
00:49
Alan Chikin Chow
Рет қаралды 50 МЛН