Reputation: 8341
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:
Please refute if you may, and also provide reliable references in relation to your experience with microservices and modules.
Upvotes: 11
Views: 11907
Reputation: 2201
Module and Micro-service are totally different terminology used in software industry. I can explain with example from eCommerce industry.
Checkout is a module which has features like shopping cart, order review, add to bag etc. This is more generic terminology.
Micro-services are more technical and they are services independent of each other. For example, we can create 'add to bag' as Microservice. This will just add an item to shopping bag. Only the bag id and product to be added is required (most importantly). This service will not know other features like shipping method, payment method etc.
Upvotes: 0
Reputation: 9446
The difference between a module and a microservice is one of packaging. Modules are programming level constructs which package and encapsulate a piece of software for reuse by other software via inclusion in a deployment (designed for in-process execution). A microservice is a deployment of a piece of software for use by other software, separated by a wire protocol.
Upvotes: 8
Reputation: 1306
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:
Upvotes: 8