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

Overview of microservices

The term microservice arose from a workshop in 2011, when different teams described an architecture style that they used. In 2012, Adrien Cockcroft from Netflix actually described microservice as a fine-grained SOA who pioneered this fine-grained SOA at web scale.

For example, if we have sensors on an Internet of Things (IoT) device, if there's a change of temperature, we would emit an event as a possible warning further downstream. This is what's called event-stream processing or complex-event processing. Essentially, everything is driven by events throughout the whole architecture.

The other type of design used in microservices is called domain-driven design (DDD). This is essentially where there is a common language between the domain experts and the developers. The other important component in DDD is the bounded context, which is where there is a strict model of consistency that relies in its bounds for each service. For example, if it's a service dealing with customer invoicing, that service will be the central point and only place where customer invoicing can be processed, written to, or updated. The benefits are that there won't be any confusion around the responsibilities of data access with systems outside of the bounded context.

You could think of microservice as centered around a REST endpoint or application programming interface using JSON standards. A lot of the logic could be built into the service. This is what is called a dumb pipeline but a smart endpoint, and you can see why in the diagram. We have a service that deals with customer support, as follows:

For example, the endpoint would update customer support details, add a new ticket, or get customer support details with a specific identifier. We have a local customer support data store, so all the information around customer support is stored in that data store and you can see that the microservice emits customer-support events. These are sent out on a publish-subscribe mechanism or using other publishing-event frameworks, such as Command Query Responsibility Segregation (CQRS). You can see that this fits within the bounded context. There's a single responsibility around this bounded context. So, this microservice controls all information around customer support.

主站蜘蛛池模板: 嘉定区| 烟台市| 保定市| 长武县| 壶关县| 黄骅市| 五华县| 社旗县| 琼结县| 故城县| 丰宁| 北碚区| 唐河县| 沙湾县| 乡宁县| 普陀区| 厦门市| 双桥区| 余姚市| 东宁县| 沽源县| 永城市| 灵武市| 常熟市| 苍梧县| 游戏| 青阳县| 大名县| 宁海县| 台湾省| 章丘市| 大城县| 邵东县| 奉贤区| 温宿县| 佳木斯市| 永德县| 兰溪市| 黔西| 夏邑县| 和平县|