I know of many times where a monolith feels like a giant house with lots of unknown nooks and crannies and hidden places.
Every time I open Visual Studio I feel like I’m going to find a new room or cabinet I didn’t expect. Like the time when an old ASP.NET Webforms project used the Request[“”] bag instead of using Request.Form, Request.QueryString, or Request.Cookies. In case this sounds normal to you, a malicious user can basically send one something via QueryString when you aren’t expecting it and since there’s a fall through priority, it is an attack vector.
That’s not even one line of code and yet it has implications for thousands of lines of code.
In the same vein, we are leaving from vacation today at a rental house to return to the real world and one of the techniques we use to pack up is to make everything visible. If it belongs to us, it goes in the middle of the floor. If it belongs to the rental property it gets put away. By making visible what needs to be packed or thrown away or recycled, we know how much work we have. To put it in tech terms, We’ve reduced the possible surface we need to handle to literally one space in an entire house.
it’s hard to do that in a monolith. There are so many places a change can hide that it’s impossible to find them all. Every day is literally a new surprise.
Good architectural techniques can and do help; but if you could, would you rather remove all the places change could hide, or would you treat the codebase as a house you have to sift through to find a change?
That’s one reason why Microservices are so attractive. Imagine a space small enough you could see all corners of it at once, and know what you’re looking for has to be there.
That’s a good reason all by itself to want to move to Microservices.
I think the nooks and crannies are a natural result of years of maintenance and the rotation of team members. Each class is essentially the most micro of services. Moving to a micro service feels like it’s neater just like moving to a new home is neater. You’ve just gone through all the crap and cleaned house in order to move. Over time those micro services will build their own books and crannies as features built under deadlines pile on team members move on to greener pastures. Entropy is coming for everything. No architecture can stop it.