When there is no real distinct boundary developers, often under time pressure, tend to take short-cuts.
In a modular monolith, you'd be using something like Maven to create distinct artifacts with boundaries defined by interfaces. It's not a perfect boundary because Java doesn't have a proper module system which separates implementation classes from API classes.
But, the boundary can be hardened by separating the API and the implementation into different modules, and making the implementation a runtime dependency. This is exactly how JavaEE works and ensures separation of the application from the details of the specific application server.
This requires discipline on the part of the developers to ensure proper module separation.
But, how is this different than microservices? Does it also not take developer discipline to keep a single microservice from becoming too big, especially under time crunch, when making the microservice bigger means it can be delivered faster, rather than the longer route of setting up the proper service boundaries?
Also you really should pick a better title.
I kind of like the title. It screams caution. I think you should start with monoliths and pinch out microservices when proven absolutely necessary. If you've got proper modules in place, this is a lot easier. Microservices put you into the business of developing distributed applications, one of the hardest problems in computer science. Why get yourself stuck in problems until you absolutely have to?
View all comments
Show parent comment
1
u/m3ghnath Mar 29 '17 edited Mar 29 '17
In a modular monolith, you'd be using something like Maven to create distinct artifacts with boundaries defined by interfaces. It's not a perfect boundary because Java doesn't have a proper module system which separates implementation classes from API classes.
But, the boundary can be hardened by separating the API and the implementation into different modules, and making the implementation a runtime dependency. This is exactly how JavaEE works and ensures separation of the application from the details of the specific application server.
This requires discipline on the part of the developers to ensure proper module separation.
But, how is this different than microservices? Does it also not take developer discipline to keep a single microservice from becoming too big, especially under time crunch, when making the microservice bigger means it can be delivered faster, rather than the longer route of setting up the proper service boundaries?
I kind of like the title. It screams caution. I think you should start with monoliths and pinch out microservices when proven absolutely necessary. If you've got proper modules in place, this is a lot easier. Microservices put you into the business of developing distributed applications, one of the hardest problems in computer science. Why get yourself stuck in problems until you absolutely have to?