3 ms·
Usually the only thing that should be shared is base process bootstrap related code. So for example I've used a shared lib in a microservices environment which
by NathanKP 10y ago
Usually the only thing that should be shared is base process bootstrap related code. So for example I've used a shared lib in a microservices environment which had common boilerplate code for starting a web server that connected to a database, and initializing a router.
The other microservices all included this shared library, and it benefited devs by providing them with an easy way to create a new microservice quickly without having to recreate a bunch of boilerplate. It also provided an easy way to centrally manage a few things like the version of express (the node.js web server we chose) and a few other things. By updating that central lib the rest of the microservices would all get upgraded automatically the next time we rebuilt them.