O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The problem and solution 

Sharing code between microservices is always tricky. We need to make sure that a common dependency does not break our microservices freedom. The major goals that we want to achieve while sharing code are:

  • Share common code among our microservices, while making sure that our code is Don't Repeat Yourself (DRY)—it is a coding principle with the main aim to reduce any repetition of code
  • Avoid tight coupling through any common shared library, as it eliminates the freedom of microservices
  • Enable simple changes in order to sync the code we can share between our microservices

Microservices are something that introduce code duplications. Creating an npm package with a new code base for any such business use case is highly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required