Hacker News new | ask | show | jobs
by onlyrealcuzzo 67 days ago
Aren't libraries just "services" without some transport layer / gateway?

You should only ever have a separate "service" if there's a concrete reason to. You should never have a "service" to make things simpler (it inherently does not).

Libraries on the other hand are much more subjective.

1 comments

> Aren't libraries just "services" without some transport layer / gateway?

Libraries can share memory, mutable state, etc. Services can not.

> (it inherently does not)

That's going to be debatable.

But debugging mutable state is much easier than debugging a distributed system. Even in C if some global gets mishandled I can just use: gdb, dtrace, strace or even just look at a core dump and know that whatever caused the problem will be discoverable. I have no such guarantee debugging an issue across a distributed systems service boundary.
> That's going to be debatable.

It's really not. A service adds complexity. If you have no reason to add it besides to "reduce complexity" - that is an oxymoron.

There are many concrete reasons to have one. Reducing complexity is not one.

That's like arguing you can drive farther forward if you go in reverse. No.

There are reasons to drive in reverse. To move forward is not one of them.

> It's really not. A service adds complexity. If you have no reason to add it besides to "reduce complexity" - that is an oxymoron.

No, it really is. I can just as easily say that a system is simpler when it's composite parts are isolated, or that a system is simpler if I can take one component and reason about it in isolation, etc.

Similarly, I could say that libraries add or reduce complexity by making similar appeals like "a single unit of code is simpler" or "separate, smaller units are simpler" etc.

> No, it really is. I can just as easily say that a system is simpler when it's composite parts are isolated

No, a system can not be simpler because you moved A' to B and introduced C (complexity - an added network, gateway, communication layer) for no reason besides to make the entire system simpler.

It is not simpler! You did nothing besides introduce C (complexity)!

Sounds like there's some debate to be had here...