简体   繁体   中英

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? In the order microservice that takes in the REST call to create an order, or a separate service dedicated to just that state machine?

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. hth.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM