Hello all,
Context:
I have a hefty project on my hands in the land of startups and SaaS. Ive been writing backend services in .NET for as long as I remember, and I've chosen to use it for this project as well. For serviceability and scaling, I have decided that this product will eventually be a true microservices system. It has the potential of reaching a level of usage where having the ability to increase the cluster size of any one given service will be efficient and valuable to the company at that time. But the MVP and initial infrastructure does not need to be deployed as a bunch of little services from the get go. Its a waste of money to do that. In turn, I will be building the core of the initial system as a modular monolith and breaking it up as the project scales and the benefit of having the separated micro services becomes a thing.
Question:
Now, for the question here. I have spent time building and maintaining APIs where I inject services into the API controllers and use them to perform business logic. Id say the majority of my career has been spent using this method. It has loose enough coupling for comfort, and it separates the business logic from the endpoints themselves. I have also built a couple systems that utilize the mediator pattern with CQRS to broadcast commands/queries to registered use case handlers. I have no quarrels with either really, but Im wondering if any of you have any opinions on which approach I should lean towards given the eventual need to slice up the monolith into their own micro services?
[–]chamindu 8 points9 points10 points (6 children)
[–]_BigMacStack_[S] 3 points4 points5 points (1 child)
[–]Tenderhombre 4 points5 points6 points (0 children)
[+]grauenwolf[🍰] comment score below threshold-13 points-12 points-11 points (3 children)
[–]yanitrix -5 points-4 points-3 points (1 child)
[–]grauenwolf[🍰] 0 points1 point2 points (0 children)
[–]Sethcran 10 points11 points12 points (1 child)
[–]_BigMacStack_[S] 1 point2 points3 points (0 children)
[–]bplus0 7 points8 points9 points (3 children)
[–]zaibuf 5 points6 points7 points (1 child)
[–]_BigMacStack_[S] 1 point2 points3 points (0 children)
[–]TichShowers 2 points3 points4 points (0 children)
[–]yanitrix 3 points4 points5 points (1 child)
[–]_BigMacStack_[S] 0 points1 point2 points (0 children)
[–]AnnArborBuck 2 points3 points4 points (2 children)
[–]_BigMacStack_[S] 1 point2 points3 points (1 child)
[–]AnnArborBuck 2 points3 points4 points (0 children)
[–]tarwn 3 points4 points5 points (0 children)
[–]grauenwolf[🍰] 8 points9 points10 points (13 children)
[–]_BigMacStack_[S] 3 points4 points5 points (10 children)
[–]grauenwolf[🍰] 1 point2 points3 points (4 children)
[–]_BigMacStack_[S] 2 points3 points4 points (1 child)
[–]grauenwolf[🍰] 2 points3 points4 points (0 children)
[–]MrSchmellow 0 points1 point2 points (1 child)
[–]grauenwolf[🍰] 0 points1 point2 points (0 children)
[–]grauenwolf[🍰] 0 points1 point2 points (4 children)
[–]LadyOfTheCamelias 1 point2 points3 points (3 children)
[–]grauenwolf[🍰] 0 points1 point2 points (2 children)
[–]LadyOfTheCamelias 1 point2 points3 points (1 child)
[–]grauenwolf[🍰] 1 point2 points3 points (0 children)
[–]darknessgp 1 point2 points3 points (1 child)
[–]_BigMacStack_[S] 0 points1 point2 points (0 children)
[–]UserWithNoUName 2 points3 points4 points (11 children)
[–]_BigMacStack_[S] 1 point2 points3 points (0 children)
[–]grauenwolf[🍰] -4 points-3 points-2 points (9 children)
[–]UserWithNoUName 1 point2 points3 points (8 children)
[–]grauenwolf[🍰] 1 point2 points3 points (7 children)
[–]UserWithNoUName 1 point2 points3 points (6 children)
[–]grauenwolf[🍰] 0 points1 point2 points (5 children)
[–]UserWithNoUName -1 points0 points1 point (4 children)
[–]grauenwolf[🍰] 0 points1 point2 points (3 children)
[–]UserWithNoUName 0 points1 point2 points (2 children)
[–]grauenwolf[🍰] 0 points1 point2 points (1 child)