[英]Should i put my statemachine code in its own microservice?
Lets say i have an order process spanning multiple microservices controlled by a masstransit saga state machine, where should I host it?假设我有一个跨越由公共交通传奇 state 机器控制的多个微服务的订单流程,我应该在哪里托管它? In the order microservice that takes in the REST call to create an order, or a separate service dedicated to just that state machine?
在接受 REST 调用以创建订单的订单微服务中,还是专门用于该 state 机器的单独服务?
Both are acceptable and used in practice.两者都是可接受的并在实践中使用。 There can be some optimization/savings in the colocation architecture but generally a separate/devoted service for the state machine/orchestrator gains the inherit advantages of ms architecture (decoupling, deployment, scaling, etc.) and in particular is safer as far as future extensibility.
在托管架构中可以进行一些优化/节省,但通常为 state 机器/协调器提供单独/专用服务获得 ms 架构的继承优势(解耦、部署、扩展等),特别是就未来而言更安全可扩展性。 hth.
hth。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.