What is the difference between Web Service and Micro service?
What is a web service?
A web service is a service offered by a remote device to another device. The communication happens via the Web, hence the name Web. In a Web service, HTTP protocol is used for device-to-device communication. It is used as the transport protocol for transferring content as XML, JSON, Protocol Buffers, etc.
Web services are implemented using SOAP / REST-based. Please find the below picture for better understanding:
What is a Microservice?
Microservice is that the complex service is decomposed into small, light-weight, independent services. These services are small and independent, decoupled, and fitted for doing a small task. These services should be individually deployable, scalable, monitored, etc. Microservices are granular, small, decoupled web services.
Differences:
Well, web service and microservice are not totally unrelated terms. It is possible that web service is a microservice and vice versa. The difference lies in how we develop, deploy, provision, manage, monitor, etc. A lot depends on how we want to develop, deploy, provision, manage, scale, etc. the services.
Microservice Architecture
Microservice Architecture usually varies from a monolithic application or service bundle. A monolithic application/service means a big centralized package deployed on a single server instance. For example, package all the services in a single .ear file and deployed on a single server.
Microservice architecture is a small deployable instance on multiple distributed environments. For example, service functionality is broken down into individually small .ear files and deployed on multiple server instances, cloud environment etc.