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

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.

主站蜘蛛池模板: 两当县| 芮城县| 洞口县| 佳木斯市| 鄂伦春自治旗| 泉州市| 武功县| 宁阳县| 上杭县| 巨鹿县| 宜春市| 错那县| 泽州县| 资溪县| 年辖:市辖区| 昭觉县| 泰来县| 资兴市| 木里| 天门市| 织金县| 新平| 克山县| 临江市| 濮阳市| 民勤县| 新竹市| 神木县| 楚雄市| 吴堡县| 平顶山市| 遵义市| 中超| 灯塔市| 沁源县| 保德县| 从江县| 南平市| 正蓝旗| 南宫市| 同心县|