News for hackers. Stuff that matters.
Re:Why Segment Went Back to a Monolith by pjc50 on Wednesday April 29, 2020 @07:01AM (#23017767)
This is really a time-of-binding argument; the difference between a "library" and a "service" is that one is in-process and accessed over function calls, and the other is out-process and accessed over RPC.

If you change code that other services are using, you can break those other services. No way round that.

Re:Why Segment Went Back to a Monolith by zzbzq on Wednesday April 29, 2020 @02:14PM (#23022343)
There are circumstances where they are equivalent, but they're very different overall. Namely, if you use a service, you update it once and see the new behavior everywhere. If you use a shared library, you have to update and redeploy every service. Libraries are strictly inferior in that scenario. This sounded, to me, like it was Segment's problem. They were updating shared libraries all over the place all the time.

I generally avoid creating shared libraries, they're a trap. They have a very narrow band of usefulness squeezed in between the more palatable solutions of creating new services or just copy & pasting code and allowing it to diverge for each different use-case.

Re:Why Segment Went Back to a Monolith by Autowired on Wednesday April 29, 2020 @09:06AM (#23018618)
While that is true, a microservices architecture can (and in my opinion should) rely on messaging and account for message schema evolution. Dependencies between services should be way less coupling than dependencies between an application and a library.
Re:Why Segment Went Back to a Monolith by caust1c on Wednesday April 29, 2020 @10:07AM (#23019380)
Schema evolution is just as big of a dependency hell as managing direct library dependencies. With a monolithic architecture, a lot of those concerns are contained within the context of a single repo, and can be tested much more easily than with many repos.
Re:Why Segment Went Back to a Monolith by marcosdumay on Wednesday April 29, 2020 @10:46AM (#23019885)
A library API can rely on versioning and account for schema evolution too. Even different versions can coexist if you decide that's important from the beginning (what is the same requirement as with services).

The only real difference is that services have a slow serialized network interface that fails 4 or 5 orders of magnitude more often than libraries, but can migrate over memory domains.