4 ms·
I wrestle with this one all the time. A shared library creates a weak dependency between the systems that use the library. Making changes to that library may af
by optimuspaul 10y ago
I wrestle with this one all the time. A shared library creates a weak dependency between the systems that use the library. Making changes to that library may affect those other systems in unpredictable ways. In my opinion if you leave business and domain logic out of those libraries and have a well defined and tested service contract then it is reasonably safe to create shared libraries. I have found that maintaining backwards compatibility and using feature flags in these libraries goes a long way at making them relatively painless for the microservices that use them to deal with change. We also generally only use shared libraries for codifying best practices and conventions.
But really, it's a constant struggle. Micro-service teams are semi-autonomous and are going to recreate functionality at will. That's a communication problem mostly though.
- lazulicurio 10y agoI'm currently struggling with dealing with shared libraries at work. I think the challenge is that the whole concept of dev-ops is fairly new[1], and from my experience Java, .Net, Python, etc. weren't designed for easy management of versioned dependencies. You have tools like Maven, Nuget, and Pip that pop up because it's a real problem, but they're add-ons to the ecosystem rather than built-in at a foundational level. And more to the point, if you want to set up your own package server[2], it can be a huge effort to integrate it into your build process[3]. [1] Disclaimer: I've only been programming for ~10 years, and professionally for ~3 years [2] Personally, I'm currently using Sonatype Nexus [3] I'm currently grappling with trying to automate building a multi-targeted assembly .Net assembly, and the co-dependency between VS, msbuild, and Nuget gives me agita
- diminoten 10y agoI can speak best to pip, but versioned dependencies are a non-problem in Python because of it. Who cares if pip isn't baked into the standard library?
- lazulicurio 10y agoVersioned dependencies absolutely still are a problem, even with pip. You still need something like virtualenv to isolate dependencies for different projects. And virtualenv is a compete hack (granted, one that works; but still a hack)
- diminoten 10y agoWhat? Virtualenv is not a hack, and "problem" doesn't mean what you think it means if you think pip is a "problem". You're barking up a tree that was cut down a few years ago.
- dec0dedab0de 10y agopip ships with python now