6 ms·
If you think of microservices as a modularization tool - a way to put reusable code in one place and call it from other places - then you are missing the point.
by jameshart 6y ago
If you think of microservices as a modularization tool - a way to put reusable code in one place and call it from other places - then you are missing the point. Microservices don’t help solve DRY code problems.
Monoliths aren’t merely monolithic in terms of having a monolithic set of addressable functionality; they are also monolithic in terms of how they access resources, how they take dependencies, how they are built, tested and deployed, how they employ scarce hardware, and how they crash.
Microservices help solve problems that linkers fundamentally struggle with. Things like different parts of code wanting to use different versions of a dependency. Things like different parts of the codebase wanting to use different linking strategies.
Adding in network hops is a cost, true. But monoliths have costs too: resource contention; build and deploy times; version locking
Also, not all monolithic architectures are equal. If you’re talking about a monolithic web app with a big RDBMS behind it, that is likely going to have very different problems than a monolithic job-processing app with a big queue-based backend.
- pjmlp 6y agoMonoliths don't have to be deployed as single instance. In any case, too many rush for micro-services with the intent reason to use the network as a package boundary. Have you ever tried to debug spaghetti RPC calls across the network? I sadly have.
- jameshart 6y agoIt is possible that there are architectures other than ‘monolith’ and ‘microservices’. Component architectures are also a thing. If it doesn’t all deploy in one go, I don’t think it’s a monolith.
- pjmlp 6y agoCertainly, the microservices cargo cult has ensured that everything that isn't a microservices, is now a monolith.
- geodel 6y agoLOL. This is excellent point. At my workplace one might just get fired if they talk anything other than microsevice for any new development.
- blntechie 6y agoAn interview for me turned from going well to disaster because of a single mention I made that I was not a fan of seeing every single project with the microservice lens. That kind of rustled the interviewees who strongly believed that anything not written as microservice today is not worth building. I thought that was a pretty inoffensive and practical statement I could support with points but who knew that would derail the entire interview.
- jameshart 6y agoAnd apparently distributed RPC is ‘microservices’. I think we can all agree that straw man architectures don’t work. Everyone should employ the true Scotsman architecture.
- pjmlp 6y agoIt is how a large majority of microservices gets implemented in practice. What was originally a package, gets its own process and REST endpoint, sorry nowadays it should be gRPC, the network boilerplate gets wrapped in nice function calls, and gets used everywhere just like the original monolith code. Just like almost no one does REST as it was originality intended, most microservices end up reflecting the monolith with an additional layer of unwanted complexity.
- jameshart 6y agoOkay, but if you’re allowed to submit ‘well structured modular componentized librarified monolith’ as an example proving how monoliths aren’t all bad, I’m not going to let you insist on holding up ‘cargo cult grpc mess’ as proof that microservices are terrible. Let’s compare the best both structures have to offer, or consider the worst both enable - but not just compare caricatures.
- galangalalgol 6y agoAdding to the theme of microservices overhead, I feel like the amount of almost-boilerplate code used to get and set the contents of serialized data in the service interfaces exceeds the code used to actually do useful work even in medium sized services, much less microservices.
- btilly 6y agoWhy yes, I have. It is essentially impossible without the (sadly rare) design pattern that I gave at https://news.ycombinator.com/item?id=26016854 https://news.ycombinator.com/item?id=26016854.
- marshmellman 6y agoYou might be interested in OpenTracing/OpenTelemetry, in case you’re not aware of it: https://opentracing.io/ https://opentracing.io/
- btilly 6y agoI wasn't. If I am ever unfortunate enough to work on a microservices architecture again, I'll see if I can get it used.
- mrits 6y agomost of what you said was solved decades ago in linking