Difference between a Module & Microservice

S34N :

This abstract gave the difference between a Microservice and an API as:

A microservice exposes it's interface, what it can do, by means of an API. The API is the list of all endpoints that a microservice respond when it receives a command/query. The microservice contains the API and other internal+hidden things that it uses to respond to client's requests.

I've worked with Modules & Microservices in Java, but is there a better way to distinctively describe the differences between a Module & a Microservice?

Based on my experience several Modules were imported as part of a Microservice project. Is a Microservice a module of some kind with additional capabilities of exposing RESTful Endpoints? What distinctively differentiates a Module from a Microservice or vice-a-versa?

Is there more we can discuss about the topic in question to clarify the potential confusion?

I have added some visual aid for further clarity:

An example of a microservice that utilises various modules (Source: Author)

Please refute if you may, and also provide reliable references in relation to your experience with microservices and modules.

techagrammer :

Microservices provides an API (REST or No Rest).

Microservice code could be written in a way that some bigger project could use it as a module.

When we choose it to be a microservice rather than module:

  1. We decouple it from the system which is using it
  2. This microservice can scale independently ie , use specific DB for its purpose
  3. Use whatever development language (suited best for its purpose) - if using it as module then this has to be written in the language in which majority of your code bases and modules are written
  4. Takes care of its data patch

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=94883&siteId=1