简体   繁体   中英

What is the difference between microservices and webservices?

The closest I got to finding the actual difference is this article .

But I didn't understand what would make me choose one over the other and if microservices can also use a REST API and communicate via http.

I mainly didn't understand what a microservice is and if it can come instead of a webservice, other than the purpose of

breaking large software applications into loosely coupled modules

A microservice is a software architecture, which can be implemented with webservices.

A webservice is just a technology (one of many) for providing services over "web" or HTTP.

I got simple answer here that says : Microservices is a new software architecture. It is based on web services. But it can be any service implemented as an independent feature that has its own database and can be deployed independently.

Microservices is an architecture wherein all the components of the system are put into individual components, which can be built, deployed, and scaled individually.

The main point is: a web service is (as the name announces) something that you would expect to "deal" with HTTP - in other words it does something in the context of the world wide web .

Whereas a microservice is not subject to the WWW context. At its core a microservice is supposed to provide one specific service - but there is no restriction to the http protocol for example.

Often a microservice implements a restful "web service" - but it doesn't have to be that way!

Beyond that, microservices are often meant as counter model to a huge monolithic application that serves many different kind of requests.

Microservices are the extension of web services.

  • Web services are typically vertical in nature(Provider-Consumer communication) whereas microservices are horizontal in nature
  • Microservices are seen as architecture due to the following.
  • microservices have belonged to one specific application.
  • microservices are addressing specific concern so that can be said as lightweight.
  • Changes are isolated in nature because the change in one microservice doesn't affect other (Ex. Changes done in login microservice does not affect the payment microservice)
  • Scaling individual microservices are easy.
  • Microservice usually has its own database.

Microservices : -

Microservice is a software architecture that can be used alongside web services. This method involves the splitting of large software applications into decoupled modules where microservices run unique processes and communicate through APIs. Its development can be through the use of either messaging, event-driven APIs, or using non-HTTP backed RPC mechanisms.

Microservices architecture saves the day when large applications fail or are down. If a particular service fails in communication, the overall application cannot be affected by the failure of a single module. The combination of microservices in Java, C#, Python, and mobile software development languages is possible. It can be independently deployed in service models for a business domain. 在此处输入图片说明

Web Services :-

A web service is just one of several technologies that can provide services over “web” or HTTP. As a specific type of service-oriented architecture (SOA), web services represent a web application's functionality.

It defines a mechanisms interaction between an API and the main code by using standard HTTP protocol and universal formats of data representation such as XML, JSON, and so on. This allows software applications developed by different technologies to communicate with each other.

Web services are not involved with frontend development. They are not connected to any development languages or user device software platforms. The combination of different web services into a single one is also possible if written in different languages and for separate operating systems, just like in microservices.

Microservice is a subset of web services . Also used to name Architectures like "Architecture based on microservices"

Microservice is an artifact , not an architecture. Several world class companies know that

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb-shared.html

在此处输入图像描述

Before the microservice artifact , we had the classic web service or rest api. Even before this we had the Soap web services with XML.

So, as a summary when someone talk about microservice , he means a subset of web service with some characteristics that differentiate it from classic web services or rest api .

One main characteristic is a unique database or Database per Service

Here another characteristics from the goods like AWS. Some of them apply to rest apis or soap services. I will mark with bold some very specific for microservices.

https://aws.amazon.com/microservices/

  • Agility
  • Flexible Scaling
  • Easy Deployment
  • Technological Freedom
  • Reusable Code
  • Resilience

https://microservices.io/

  • Highly maintainable and testable
  • Loosely coupled
  • Independently deployable
  • Organized around business capabilities
  • Owned by a small team

https://www.baeldung.com/cs/microservices-db-design

  • Database per Service
  • CQRS

https://learn.microsoft.com/en-us/azure/architecture/microservices/design/data-considerations

在此处输入图像描述

Microservice is a piece of autonomous application that performs for a larger application architecture.

Web service is an approach to make the application available to other applications by web ui.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM