- 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.
推薦閱讀
- Python程序設計教程(第2版)
- Instant Typeahead.js
- Python算法從菜鳥到達人
- Android移動開發案例教程:基于Android Studio開發環境
- Learning Material Design
- C語言程序設計習題與實驗指導
- 大學計算機應用基礎(Windows 7+Office 2010)(IC3)
- Laravel Design Patterns and Best Practices
- 計算機系統解密:從理解計算機到編寫高效代碼
- C++服務器開發精髓
- 虛擬現實:引領未來的人機交互革命
- jMonkeyEngine 3.0 Beginner’s Guide
- C++從零開始學(視頻教學版)(第2版)
- SAP HANA Starter
- Advanced C++