When should we choose micro service over web API and why
6 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Satya KarkiRank #78 · 24.6K reputationPosted Mar 21, 2021, 8:25 AM EDT
✓ Accepted answer+2
Hi Kiran,
Microservices is an architectural style for developing a application in the form of small services which contains it's own process. As it is segregated into small services, it is lightweight. Nowadays microservices are popular in
develoment because it is easier and faster to develop and work in seperate parts of an application.
On the other hand, APIs are door ways to communicate internal and external developer to get data or access application's functionality.
Both have their own use cases.
You can get detailed idea on Microservices from below link:
Mario ScheerenRank #1,371 · 1.2K reputationPosted Mar 19, 2021, 2:33 PM EDT
+2
A .Net-Web-API is a service having an http / https endpoint where its methods can be reached ( Get / Put / Post / Delete) primarily used as a backend for WebApplications ( like an Angular Frontend)
Microservices are Single-Responsibility-Programs usually hosted in an Cloud / Cluster environment like Docker / Kubernetes.
So this means a .Net-Web-API (having the responsibility to serve a WebGUI) is,(or can be seen as) a Microservice.
In reality , Microservice and api are not substitute of each other rather they come together.
for example suppose in your company there are 500 employees , all working in a huge project then for convenient they will definitely follow microservice architecture means dividing the project into smaller independent service.
but , it is impossibe that one service will not need to connect to the another , so they will communicate via API.
geetha geethaRank #7,130 · 248 reputationPosted Nov 2, 2021, 10:25 AM EDT
+1
Microservice Architecture:
It is an architectural style for web applications,
where the functionality is divided up across small web services.It derives from the
distributed computing architecture that connects many small services,
rather than having one large service. The microservice can then be
delivered through an application programming interface.
Microservices are an example of Service-Oriented Architecture, or SOA.
Web API architecture:
APIs are the frameworks through which developers can interact with a web application.API's is twofold for most enterprises, since APIs are
often the medium of communication between microservices, but also
because they can also be used to expose an application’s data and
functionality to third parties, leading the way for powerful
integrations.
Satya KarkiRank #78 · 24.6K reputationPosted Mar 21, 2021, 8:25 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Mar 19, 2021, 2:14 PM EDT
Microservices are an architectural style for web applications, where the functionality is divided up across small web services.
whereas
APIs are the frameworks through which developers can interact with a web application.
Mario ScheerenRank #1,371 · 1.2K reputationPosted Mar 19, 2021, 2:33 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 19, 2021, 11:00 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Mar 21, 2021, 12:29 PM EDT
geetha geethaRank #7,130 · 248 reputationPosted Nov 2, 2021, 10:25 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts