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

Isolating services by business logic

Once persistence-based services are isolated, the next step is to evaluate existing components for microservices with respect to business logic. Apart from dropping the Registration Component in favor of separate services for consumer and provider, a new service called lookup can be created to consolidate all the search operations into one service and allow users to search across application entities, as shown in the following diagram. Since databases of consumers, providers, services, and orders cannot be shared with lookup services, it can keep a denormalized (https://en.wikipedia.org/wiki/Denormalization) view of these databases containing only the fields that need to be searched.

Geolocation-based queries will also be limited to lookup services, so there is no need to maintain a separate geolocation service; instead, the Lookup Service itself can query for the geolocation.

Since geolocations rarely change, the Lookup Service can cache them and maintain a database of well-known and already queried geolocations as well for better performance.

The Alerting Component can be isolated as a separate service as it will be required by multiple services, including OrderService Consumer, and Service Provider, to send alerts to the users. Alerts may be sent via SMS or email, and the Alerting Service can use external services to send the alerts. Since alerts must not be overwhelming for users, the Alerting Service can group by user all the alerts that are requested in a short period of time and send them as a single notification message.

Do not attempt to aggressively start disintegrating your components into microservices. Focus on the business capabilities and not on features and use cases. For example, instead of creating a separate service for sending emails and sending SMS, it is recommended to create a single Alerting Service with both capabilities.
主站蜘蛛池模板: 英德市| 崇礼县| 德惠市| 资溪县| 正定县| 深州市| 孟村| 柳州市| 蓬溪县| 惠来县| 五家渠市| 原平市| 元朗区| 古蔺县| 江津市| 宁津县| 青阳县| 体育| 富宁县| 偃师市| 沿河| 雅江县| 新巴尔虎左旗| 右玉县| 哈密市| 湖口县| 陆良县| 专栏| 莱西市| 大厂| 孙吴县| 临高县| 怀柔区| 常州市| 睢宁县| 襄樊市| 秭归县| 神农架林区| 吉木萨尔县| 蒲城县| 高阳县|