Shared libraries vs code duplication in microservices
Takeshi Silva
·505 views
we're running into a classic microservices dilemma: shared libraries vs code duplication. we have a lot of common code for things like logging, authentication middleware, error handling, and core data models that are duplicated across our 20+ services. i'm debating the best way to manage this. shared npm packages feel like the right approach for common utility code, but they can create dependency hell with frequent updates. git submodules are an option but they come with their own set of complexities. simply copying and pasting code, while frowned upon, has a certain simplicity. none of these solutions feel great. how do others handle shared code in a microservices ecosystem without introducing tightly coupled dependencies or massive duplication?
12 comments