- distributed systems problems - think consistency and ACID
- increased refactoring complexity - you now have to change the api three times instead of 1 to deploy the change with 0 downtime
- requirements for more generic CI/CD pipelines - you will develop many microservices, it's important to do it fast
it's not "just" a network rpc, even technically
Yes this causes overhead; every microservice will have a public API of sorts that will need to be documented and communicated, and any other service consuming it will need to eventually be updated to keep up with changes. If this overhead is not something your organization can afford, you should not be doing a microservices architecture.
Except is is. Microservice doesn't mean distributed setup. For the first problem, yes service running in multiple pods causes issues, but even monolith could face the same issue. Statefulset based microservices not only exists, but is a pretty common setup. Also I would even call multiple container on the same pod as microservice, which basically solves all of the problem.
There are many ways to solve second problem. Some folks create different API version. I prefer different deployment.
Last is a problem for monolith. I know of big companies where compile time is in order of an hour for monolith, even for small change.
- In case of errors, do we get a full backtrace of function calls across service boundaries?
- Is the function call as cheap as passing an argument? What if we're passing 1KB? 1MB? 1GB?
- Can we use a debugger to step in and out of those functions?
- Can we spin up a simple test runner to integration test a few levels of function calls together? Preferably something like Jest that has a watch mode so we can quickly run dozens of tests?
- Can all database modifications run in a single transaction so that we know that either all of them happened or none at all?
Unless you don't discard the error, then yes
> - Is the function call as cheap as passing an argument? What if we're passing 1KB? 1MB? 1GB?
No it is not. In general microservice costs are bit higher.
> Can we use a debugger to step in and out of those functions?
You could trace across services but passing the context. Also attaching debugger is possible afaik.
> Can we spin up a simple test runner to integration test a few levels of function calls together?
I use docker compose and it can be done
> - Can all database modifications run in a single transaction so that we know that either all of them happened or none at all?
Yes. I don't see how this is different than function call.
If you need atomicity _across services_ it's very different, hence why everyone resorts to eventual consistency and all the associated extra complexity. If there's a decent way to have true transactions that span multiple services, I've certainly never seen it.
No. microservice vs monolith is not the deciding factor of the developer speed or bugs. It wouldn't even be top 5 factor for good developers. Difference between microservices and monolith technically is just network rpc rather than function call. In itself, it doesn't make much of a difference. If a developer finds themselves stuck because of microservice architecture, they are probably very bad developer in first place