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

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.
主站蜘蛛池模板: 讷河市| 通城县| 长垣县| 思南县| 西峡县| 天祝| 湖南省| 西贡区| 鸡西市| 闽侯县| 正阳县| 长寿区| 两当县| 开鲁县| 岳西县| 青铜峡市| 高安市| 孟州市| 永定县| 杭锦旗| 同仁县| 共和县| 冕宁县| 开阳县| 庆云县| 彭泽县| 湖口县| 凤山市| 抚顺县| 莱州市| 高平市| 从化市| 涡阳县| 商都县| 巫山县| 淮南市| 桃园县| 营口市| 成都市| 宣化县| 佛山市|