简体   繁体   English

我应该把我的状态机代码放在它自己的微服务中吗?

[英]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.

相关问题 在基于事件的系统中,日志记录应该是自己的微服务吗? - Should Logging Be Its Own Microservice in an Event-Based System? 我所有的微服务都有自己的数据库,我应该创建公共微服务来处理连接吗? - All my microservices have their own db's, should I create common microservice to handle connections? 我应该如何设计Spring Microservice? - How should I design my Spring Microservice? 如何访问我的微服务不拥有的数据? - How do I access data that my microservice does not own? 每个微服务器应该管理自己的用户权限和用户角色吗? - Should each microservice manage its own user-permissions and user-roles? 如果使用相同的数据库类型,微服务是否应该拥有自己的数据库服务器“实例”? - Should a microservice have its own database server "instance" if using the same database type? 我应该在哪里存储我的微服务的外部客户端 DTO? - Where should i store the external client DTOs of my microservice? 我有两个微服务,应该具有独立的嵌入式tomcat还是一个普通的tomcat - I have two microservice, should it have its independent embedded tomcat or one common tomcat 部署一个自带数据库的微服务:如何保证复制性和可靠性? - Deploying a microservice with its own database: how to guarantee replication and reliability? 为什么每个微服务都有自己的数据库? - Why does each microservice get its own database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM