- Spring 5.0 Microservices(Second Edition)
- Rajesh R V
- 358字
- 2021-07-02 19:44:50
Characteristics of service in a microservice
Since microservices are more or less like a flavor of SOA, many of the service characteristics defined in the SOA are applicable to microservices as well.
The following are some of the characteristics of services that are applicable to microservices as well:
- Service contract: Similar to SOA, microservices are described through well-defined service contracts. In the microservices world, JSON and REST are universally accepted for service communication. In case of JSON/REST, there are many techniques used to define service contracts. JSON Schema, WADL, Swagger, and RAML are a few examples.
- Loose coupling: Microservices are independent and loosely coupled. In most cases, microservices accept an event as input and respond with another event. Messaging, HTTP, and REST are commonly used for interaction between microservices. Message-based endpoints provide higher levels of decoupling.
- Service abstraction: In microservices, service abstraction is not just abstraction of service realization, but also provides complete abstraction of all libraries and environment details, as discussed earlier.
- Service reuse: Microservices are course grained reusable business services. These are accessed by mobile devices and desktop channels, other microservices, or even other systems.
- Statelessness: Well-designed microservices are a stateless, shared nothing with no shared state, or conversational state maintained by the services. In case there is a requirement to maintain state, they will be maintained in a database, perhaps in-memory.
- Services are discoverable: Microservices are discoverable. In a typical microservices environment, microservices self-advertise their existence and make themselves available for discovery. When services die, they automatically take themselves out from the microservices ecosystem.
- Service interoperability: Services are interoperable as they use standard protocols and message exchange standards. Messaging, HTTP, and more are used as the transport mechanism. REST/JSON is the most popular method to develop interoperable services in the microservices world. In cases where further optimization is required on communications, then other protocols such as Protocol Buffers, Thrift, Avro, or Zero MQ could be used. However, use of these protocols may limit the overall interoperability of the services.
- Service Composeability: Microservices are composeable. Service composeability is achieved either through service orchestration or service choreography.
More details on SOA principles can be found at http://serviceorientation.com/serviceorientation/index.
推薦閱讀
- DevOps for Networking
- 單片機(jī)C語(yǔ)言程序設(shè)計(jì)實(shí)訓(xùn)100例:基于STC8051+Proteus仿真與實(shí)戰(zhàn)
- Magento 2 Theme Design(Second Edition)
- Learning Laravel 4 Application Development
- Kali Linux Wireless Penetration Testing Beginner's Guide(Third Edition)
- C#程序設(shè)計(jì)
- Visual FoxPro程序設(shè)計(jì)
- Learning Raspbian
- Node.js:來(lái)一打 C++ 擴(kuò)展
- 編程菜鳥(niǎo)學(xué)Python數(shù)據(jù)分析
- C/C++程序員面試指南
- Python Data Structures and Algorithms
- 代替VBA!用Python輕松實(shí)現(xiàn)Excel編程
- Orleans:構(gòu)建高性能分布式Actor服務(wù)
- AI自動(dòng)化測(cè)試:技術(shù)原理、平臺(tái)搭建與工程實(shí)踐