Modular Monolith - How To Create Your Modules

  Переглядів 8,200

Milan Jovanović

Milan Jovanović

День тому

☄️ Master the Modular Monolith Architecture: bit.ly/3SXlzSt
📌 Accelerate your Clean Architecture skills: bit.ly/3PupkOJ
🚀 Support me on Patreon to access the source code: / milanjovanovic
A modular monolith is an architectural pattern that structures the application into independent modules or components with well-defined boundaries. The modules are split based on logical boundaries, grouping together related functionalities. This approach significantly improves the cohesion of the system. In this video, I'll explain how to create modules in your application. We'll start with a monolith application using Clean Architecture and extract two distinct modules.
Check out my courses: bit.ly/3PupkOJ
What Is a Modular Monolith?
www.milanjovanovic.tech/blog/...
Monolith to Microservices: How a Modular Monolith Helps
www.milanjovanovic.tech/blog/...
Monolith to Microservices: How a Modular Monolith Helps:
www.milanjovanovic.tech/blog/...
Join my weekly .NET newsletter:
www.milanjovanovic.tech
Read my Blog here:
www.milanjovanovic.tech/blog
Chapters
0:00 How to define Modules
2:04 Defining Modules - guidelines
5:21 Extracting Modules in a monolith

КОМЕНТАРІ: 43
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
💡You can learn more about Modular Monolith Architecture here: bit.ly/3SXlzSt
@dracovk
@dracovk 15 днів тому
Excellent video Milan! I'm looking forward to future episodes of this series
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
More coming :)
@kurumi690
@kurumi690 12 днів тому
next video should be "creating beautiful micro services app with Aspire NET" 😊
@MilanJovanovicTech
@MilanJovanovicTech 12 днів тому
Challenge accepted
@dandoescode
@dandoescode 13 днів тому
Great video Milan. Keen to see the rest of this series!
@MilanJovanovicTech
@MilanJovanovicTech 12 днів тому
Thanks, it's coming together coming slowly
@buni1510
@buni1510 14 днів тому
Awesome content, thanks for all the knowledge!
@MilanJovanovicTech
@MilanJovanovicTech 13 днів тому
Most welcome!
@leonardoalvarez5759
@leonardoalvarez5759 10 днів тому
Excellent video, Milan! This is more clear for me!
@MilanJovanovicTech
@MilanJovanovicTech 9 днів тому
The next video should help even more
@barefeg
@barefeg 14 днів тому
This is fine for a theoretical experiment. But in practice the split will be decided by the topology of the teams which is a reflection of the business
@MilanJovanovicTech
@MilanJovanovicTech 13 днів тому
Of course, this is a contrived sample
@sauravbhatta5303
@sauravbhatta5303 15 днів тому
Hopefully ur modular monolith course will be great.
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
I'm excited. It'll end up being 12-15 hours of top-notch content. 😁
@jeremylarose5100
@jeremylarose5100 15 днів тому
If it’s anything like the other course, I can’t wait!
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
@@jeremylarose5100 My opinion is this one is far better. I've learned a ton from some mistakes made on my first course.
@daveanderson8348
@daveanderson8348 12 днів тому
@@MilanJovanovicTech If you put it like that, you're going to make it even more expensive than your other expensive course. I hope you don't set the bar high, because then there is a good chance that many people will look elsewhere!
@MilanJovanovicTech
@MilanJovanovicTech 12 днів тому
@@daveanderson8348 It'll be pretty similar to the other one, with a lot more content. But then again, how many other creators regularly update their existing courses or introduce new content? I don't know of many.
@slobodanmikaric2180
@slobodanmikaric2180 15 днів тому
Nice and simple, one thing catches my eye, your Training Application module is dependent on User.Domain? Modules should share DTOs and interfaces using contracts. I guess this is a side effect of moving from monolit to modular monolit and in the next video you will deal with it. Nice work 😊
@MilanJovanovicTech
@MilanJovanovicTech 14 днів тому
Exactly, I'll deal with it in a future video doing exactly what you suggested. Users module will expos a public API that the Training module can call.
@recycledsoldier
@recycledsoldier 15 днів тому
What are your thoughts about putting endpoints into the modules as well and making the API a pure presentation/implemenation layer? That way you're not bound to the API project. We've done something similar in a recent project we released where we had to deploy to the cloud as well as an executable running on a legacy machine on prem.
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
I've also done that, works great
@ripperjack7642
@ripperjack7642 15 днів тому
Do Modular Monoliths have a way of communication other than using abstract Interfaces, thank you for this informative video
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
Yes. I'll talk about it in another video. But you can use messaging to communicate between modules.
@Reverence12389
@Reverence12389 12 днів тому
How would you suggest fitting reporting into a modular monolith architecture? Reports will likely pull data from multiple modules, so maybe all reports belong in their own module, but then that report module would communicate with several other modules. You could also put the reports within the modules, but then they would have to potentially communicate to other modules. What do you think?
@MilanJovanovicTech
@MilanJovanovicTech 12 днів тому
The most elegant, and also most complex, approach would be publishing events and having the reporting module react to these events and update the required data. We can also implement sync calls to other modules to gather the needed data, on demand.
@Reverence12389
@Reverence12389 12 днів тому
@MilanJovanovicTech when you say sync calls, what do you mean? I imagine maybe something about the data from the modules that the report needs get copied and transformed into a report specific data model (ie: "sync") the data, or are you referring to something else? I'd be very interested in a video on this because I believe reporting is a requirement for a lot of projects that would justify a modular monolith architecture.
@sinthonseng8981
@sinthonseng8981 8 днів тому
Have you ever used the Managed Extensibility Framework (MEF) with a modular monolith before?
@MilanJovanovicTech
@MilanJovanovicTech 8 днів тому
No, I haven't
@Reverence12389
@Reverence12389 12 днів тому
Wouldn't having the training module reference the user module not be a best practice and break the actual modularity? What would you do in this case...extract IUserRepository and User domain into the shared kernel, leave it how you did it, or something else?
@MilanJovanovicTech
@MilanJovanovicTech 12 днів тому
Wait for the next video (this week), but what we want to do is have Training reference the public API of the Users module. This can be as simple as exposing an interface, that will be implemented by the Users module.
@user-du3uv6jc5x
@user-du3uv6jc5x 15 днів тому
why don`t you post the code in the video to the github?) just a simple example :)
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
I'll work on a different project for GitHub, planning to release something over the summer to cover the popular architectures
@aaronbcj
@aaronbcj 15 днів тому
shouldn't we move modules to separate solutions? even if keeping them in same solution, how about deploying them separately and reference them using nuget instead of project reference so later on it can be migrated easily to MS
@recycledsoldier
@recycledsoldier 15 днів тому
I've worked on a project like that, and it requires A LOT of discipline from the team and generally a central architect. The reason being is that coordinating nuget updates becomes its own task. It makes the project more resilient to bad changes but comes with a lot of extra management and technical debt. It also requires a lot of coordination in regard to lower-level libraries among all projects. For instance, you have two modules, Products and Orders, they may rely on some lower-level common libraries like Security, Common, Caching, etc. that your team also manages. If you update one of those, you now have to ensure that you propagate those to all of the high-level libraries or run the risk of collision in the main monolith project. It's fine for small teams and small projects, but as the team and project complexity grow, the technical debt to manage those types of references increases. I think all larger projects should have a "keeper of the keys"/Architect as it were but not all teams get that luxury.
@MilanJovanovicTech
@MilanJovanovicTech 15 днів тому
Where's the monolith part then?
@aaronbcj
@aaronbcj 12 днів тому
I agree. Usually monoliths are not converted to MS at one go, instead follow strangler pattern to extract one module at time so both "modular monoliths" and new MS can co-exist
@stasnocap
@stasnocap 13 днів тому
Hi Milan! What keyboard are you using?
@MilanJovanovicTech
@MilanJovanovicTech 12 днів тому
I believe Logitech g413 carbon
@user-xm7sh3vw8o
@user-xm7sh3vw8o 14 днів тому
Activities suddenly appeared
@MilanJovanovicTech
@MilanJovanovicTech 13 днів тому
Copy-paste
Implementing Modular Architecture With Sync Communication
12:20
Milan Jovanović
Переглядів 5 тис.
Modular Monoliths: How To Build One & Lessons Learned
43:37
Milan Jovanović
Переглядів 36 тис.
Что будет с кроссовком?
00:35
Аришнев
Переглядів 2,2 млн
船长被天使剪成光头了?#天使 #小丑 #超人不会飞
00:28
超人不会飞
Переглядів 20 млн
ДРУГА РЕПЕТИЦІЯ alyona alyona та Jerry Heil на сцені Євробачення-2024
00:34
Євробачення Україна | Eurovision Ukraine official
Переглядів 155 тис.
Authentication made easy with ASP.NET Core Identity in .NET 8
10:39
Milan Jovanović
Переглядів 10 тис.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Переглядів 140 тис.
5 Rules For DTOs
17:56
Ardalis
Переглядів 32 тис.
Its Time to go Back to the Monoliths. Use Modular Monolith, save costs
16:08
98% Cloud Cost Saved By Writing Our Own Database
21:45
ThePrimeTime
Переглядів 206 тис.
The Beginner's Guide to Clean Architecture
13:19
Milan Jovanović
Переглядів 11 тис.
Keep your project structure simple!
15:08
CodeOpinion
Переглядів 12 тис.
I learned to code from scratch in 1 year. Here's how.
41:55
Thomas Frank
Переглядів 297 тис.
Articulate Your Thoughts Clearly: 3 PRECISE Steps!
19:33
Kara Ronin
Переглядів 863 тис.
Компьютерная мышь за 50 рублей
0:28
dizzi
Переглядів 1,9 млн
Первые продажи Ryzen на Ozon и первый возврат! 😱
13:17
Герасимов Live
Переглядів 30 тис.
План хакера 🤯 #shorts #фильмы
0:59
BruuHub
Переглядів 999 тис.
I wish I knew this When Istarted Programming #school #software  #codingtips
0:34
Claude Ams - Programming Guru 💻
Переглядів 11 млн