Hacker News new | ask | show | jobs
by bhouston 1891 days ago
These libraries already exist whether you write them or you use someone else's. In our case most of our micro services are node.js based so Koa is in every microservice and we use middleware for authentication -- and thus if the authentication system evolves (moving to JWT or a microservice gateway) we have to evolve that middleware everywhere.

Same with our consistent logging system.

Libraries are better than unique code everywhere for the same task - allows you to fix a bug once and to do consistency checking.

1 comments

The problem isn't "some code which different services use is in a library".

The problem is an not-ideal "the code which is in libraries shared by different services is tightly-coupled to particular services". e.g. changing the shared library might break some service which depends on it.

Obviously, you don't want code like that. But it's easy to write code which is slightly coupled; and then when you're in a hurry, to increase the coupling.