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

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.

主站蜘蛛池模板: 敦化市| 平和县| 财经| 富阳市| 新龙县| 安西县| 建阳市| 萨迦县| 锦州市| 琼中| 洞头县| 宝兴县| 大埔县| 蒙阴县| 合水县| 鄂伦春自治旗| 宜兰县| 正镶白旗| 嵩明县| 乌拉特后旗| 博罗县| 南澳县| 达州市| 拜城县| 平利县| 万山特区| 雷山县| 田林县| 阳山县| 安仁县| 阳江市| 库车县| 嘉黎县| 上栗县| 体育| 阿勒泰市| 麻江县| 建宁县| 个旧市| 青岛市| 泸溪县|