Enlear Academy

We provide high quality content on web development and cloud technologies for developers.

Follow publication

Can We Reuse Code Between Microservices?

Ashan Fernando
Enlear Academy
Published in
3 min readJan 18, 2018

--

Some of you might wonder why sharing code in a traditional way is a problem for Microservices. It will again end up in dependency chaos, making the set of Microservices a Monolith in the long run.

Sharing Code

The approach I would recommend is to build your code as reusable components that fundamentally facilitate reusing code. Bit components do just that. Otherwise, you must depend on an external repository or registry to maintain the shared code (e.g., Utils) and use a specific version within a Microservice.

Reusable Code Units as Components

Using a Package Manager

Using Source Control

{
"name": "microservice-a",
"version": "1.0.0",
"dependencies": {
"serverless-dynamodb- local":"git+https://github.com/99xt/serverless-dynamodb- local#67ef2998624e10f5ef734fbcc6b70b471b057ed0"
}
}

Learn More

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Published in Enlear Academy

We provide high quality content on web development and cloud technologies for developers.

Written by Ashan Fernando

Solutions Architect and a Content Specialist. For more details find me in Linkedin https://www.linkedin.com/in/ashanfer/

Responses (6)

Write a response