In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what's the difference between micro-services and API". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Microservice is a small, single service provided by a company. It comes from a distributed computing architecture that connects many small services rather than a large one. Microservices can be delivered through the application programming interface (API).
API is a method of communication between the requester and the host, which can usually be accessed through the IP address. API can convey many types of information to users, such as:
Data to be shared
Features to be provided
In short, talking about microservices must do more with the architecture of the software, while API has to do with how to expose microservices to consumers.
How does microservice work?
Micro-service is an extension of the company's idea of a large single service. A microservice is a single function. If Microsoft Word is split into microservices, there may be a service provided as blank paper, a service as a spell checker, and a service as a formatting tool.
Kubernetes allows computer software to make adjustments. Kubernetes has its own advantages, and it also promotes software design from a single service as a whole to a collection of many small services that work together. These processes are precisely because Kubernetes is designed to do:
Effectively coordinate the use of a single container on the server
Improve system reliability and scalability
Reduce related management and resource costs
Examples of microservices
Microservices are very simple. Simplicity is the main goal. You can think of them as roles in the company. A microservice plays a very special role and does only one job. DZone brings together excellent diagrams of the various micro services provided by Uber, which communicate with each other and perform different tasks through API. Uber builds different services for each task:
Passenger management
Passenger web interface
Invoice management
Driver management
Driver Web UI
Payment management
Travel management
Notification matter
Microservices can also be illustrated by architecture diagrams, where one microservice is a single node that communicates with another service through API. As more services are added to the system, the architecture can grow. It is conceivable that the micro-service architecture diagram of a large company may be as large as a small city. The following are hypothetical Amazon and Netflix graphics:
Micro services depend on APIAPI
Is a communication tool that enables one service to interact with another. API itself cannot do anything unless it is connected to something. When the API is connected to services and microservices, it becomes useful, such as:
Function as a Service function service
Machine Learning as a Service machine learning
Software as a Service software service
API is the way you can distribute microservices to users. Instead of downloading the software, API distributes your service. API is necessary for the microservices architecture to function properly because API is the communication tool between its services. Without API, there would be a lot of disconnected microservices. Technically, microservices will be built as a whole again.
How does API work?
API is very generic. You can:
Create an API on any containerized service
Use many different languages Java, Python, Go, etc.
Deploy API on any cloud provider
API can improve the availability and openness of services. By simplifying distribution, you can provide smaller services. After all, you don't have to build all the services of the entire application to prove feasibility.
Many API are RESTful and exposed through endpoints such as HTTP. This means that accessing information from API is as easy as verifying URL. The GET, POST, PUT, DELETE commands, together with URL, can work as expected to get data or provide data to API. Although REST API is the most common in modern Web applications, other options include:
RPC
GraphQL
As a product, API endpoints are usually provided with a development portal that tells developers how to use it and assigns API keys to developers. If the goal of the microservice is to provide data on registered vehicles, the development portal will explain:
The role of services
The structure of the data (i.e., the data pattern)
Requirements for developers to use API
Most good microservices have some type of API. If you want to use microservices, you will create an API.
This is the end of the content of "what's the difference between Micro Services and API". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.