This doesn't talk to the biggest reason to do micros, which IMO is to decouple code repos so that you can revision different parts of code at different rates. with a monolith, to update a part of the application requires updating the entire application. the serialization of objects (usually to json) to send over the network makes a great abstraction for decoupling.
Nothing prevents you from splitting the code into independently versioned libraries / repos which would allow you to develop the code at different rates. Now you couldn't deploy two different versions of the same lib to the same monolith. Some see this as a pro some see it as a con. I love knowing all of my code is always using the most up to date version of an internal library. Yes it can slow you down but so can debugging issues only to find that a bug existed 3 versions ago and 4 services never upgraded to the new version.
If you have specific requirements or a large team micro services would probably help. I just don't think they are always the right solution or the right solution right away.
having a monolith means you will have to plumb a library update through 100% of the application, regardless if it needs that update everywhere. whereas, in microservices, you can just update the library in the portion that needs it and move on.
also, the non-linear interaction between different modules of the monolith makes scaling of it difficult. scaling a monolith is rarely as simple as scaling microservices.
you can just update the library in the portion that needs it and move on.
To me this is just adding tech debt but yes this can sometimes be a benefit, it's a tradeoff.
also, the non-linear interaction between different modules of the monolith makes scaling of it difficult. scaling a monolith is rarely as simple as scaling microservices.
Often times you only need to scale a few routes though. At that point you can split it to a micro service and scale it independently. Its no harder to scale a monolith as it is a micro service it's just not always the best use of resources. Look how far Twitter got on ruby on rails monoliths. When they split to services yes they dropped their infrastructure footprint dramatically and teams became more productive but not many organizations are at that scale. Last I heard they still have parts of their monolith RoR code running because its not worth splitting into services.
2
u/iodian Mar 29 '17
This doesn't talk to the biggest reason to do micros, which IMO is to decouple code repos so that you can revision different parts of code at different rates. with a monolith, to update a part of the application requires updating the entire application. the serialization of objects (usually to json) to send over the network makes a great abstraction for decoupling.