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

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.
主站蜘蛛池模板: 南丹县| 融水| 塔河县| 水城县| 淮阳县| 来安县| 望奎县| 周至县| 连城县| 南开区| 台东市| 惠州市| 怀柔区| 安阳县| 岳普湖县| 山东省| 盈江县| 罗甸县| 万载县| 谷城县| 高州市| 温宿县| 五河县| 平远县| 忻城县| 垫江县| 渝北区| 元朗区| 吴桥县| 化德县| 镶黄旗| 峡江县| 肃北| 聂拉木县| 西藏| 江川县| 江门市| 寿宁县| 涿州市| 阿克苏市| 彝良县|