Hacker News new | ask | show | jobs
by catnaroek 3582 days ago
Microservices are a great idea in principle. In practice, they require you to spend way too much effort (IMO) on:

(0) Serializing and deserializing objects. (At least if you're not using something like Erlang.)

(1) Validating things that would be considered internal invariants under a more monolithic design, simply because they lie on a service boundary.

Not to mention microservices constrain your API to what your transport (often HTTP) can readily express (which is often not much). If you're used to working with expressive languages, the expressiveness drop can be very annoying.

1 comments

I've never run across a microservice architecture that involved passing objects across service boundaries. Data records, yes, but if those are expensive or painful to serialize or deserialize, I'd say that's the first problem to solve.
If your data structures have sophisticated invariants, serializing and deserializing them will be painful no matter what, because every invariant becomes one more thing to check after deserializing. And, even if your data structures don't have any invariants, don't you think it would be nice not to have to manually serialize anything? At least it would be nice if the language did this for you automatically.