官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 颍上县| 织金县| 昭平县| 克什克腾旗| 油尖旺区| 泰顺县| 通城县| 资源县| 米泉市| 静宁县| 宕昌县| 吉木乃县| 房产| 健康| 和硕县| 富民县| 广宁县| 运城市| 湘西| 商水县| 肇东市| 墨竹工卡县| 双江| 巩义市| 和林格尔县| 德钦县| 宁国市| 贵溪市| 固阳县| 昆明市| 吉木乃县| 新蔡县| 凌海市| 洱源县| 金平| 五原县| 泰宁县| 永清县| 郓城县| 丹巴县| 洛扎县|