|
|
|
|
|
by mrkeen
4 days ago
|
|
> Inside a monolith it's easy to answer questions like "Which dependencies are we shipping?"; or "Is this piece of code still used?" Static analysis can often tell you. Once the code is spread across dozens of independent services, those answers become much harder to obtain. I draw the opposite conclusion here. In monoliths, someone else might want the code to stay in the codebase. I don't want to ask everyone about it. Everyone's responsibility is no-one's responsibility, and the code stays as is. In a microservice, I publish an interface, and I'm free to tear up all the carpet behind it as long as it keeps doing its job as advertised. Knowing whether public routes are still in use is still a problem, so you need a minimum level of metrics or logging before you can retire an endpoint. |
|
type ThingDoer interface { DoTheThingIDontCareHow() (result, error) }
func NewAmazingThingIMade(theThingINeedButIDontCareHowItDoesIt ThingDoer) { // You receive the superduper thing and dont care about it in any other way }
func (a *Amazing) DoSomeThing() (result, error) { return a.DoTheThingIDontCareHow() }
Nothing about "monoliths" prevents or hampers this development style. Once someone decides to do the Thing in another fashion, they are free to do so and you wouldn't have to change a thing.
All problems you experience are organizational, not technical. It's psychology we should be studying, not computer science.
Edit: In fact you introduced a network boundary which can fundamentally only complicate matters, not make them simpler.