简体   繁体   English

微服务中是否仍存在与Java进程之间的通信?

[英]Is communication between to Java processes still within Microservices?

Actually I'm about to realise some microservices architecture. 实际上,我即将实现一些微服务架构。 Having three different processes running on one Windowns machine I'm about to let them communicate with each other. 在一台Windowns机器上运行三个不同的进程,我要让它们彼此通信。

Is this in the paradigma of Microservices? 这是微服务的天堂吗? Or am I'm pushing this too far? 还是我推得太远了?

Context : A system which lets a frontend webapp execute tools/scripts which lie on a backend machine on a server. 上下文 :一种系统,可使前端Web应用程序执行位于服务器后端计算机上的工具/脚本。

Components : 组成部分

  • REST Interface (with which the webapp frontend does communicate) REST接口 (webapp前端与之通信)
  • ToolBoxExecutor (with which the REST Controller is communicating) ToolBoxExecutor (与REST Controller通信)
  • ToolSyncer (which is being "triggered" by the ToolBoxExectutor to refresh all Git Repositories for the tools) ToolSyncer (由ToolBoxExectutor“触发”以刷新该工具的所有Git存储库)

Those three components do not have a big load of logic - but I still want them NOT to act as Services of the REST Controller - just for the sake of "microservices". 这三个组件没有很大的逻辑负载-但我仍然希望它们不充当REST控制器的服务-仅出于“微服务”的考虑。 I want them all to be three independent java applications. 我希望它们全部成为三个独立的Java应用程序。

Am I on the right track? 我在正确的轨道上吗?

High-level 高水平

Am I on the right track? 我在正确的轨道上吗?

No. By focusing on an emerging, as-yet loosely defined architectural style as your end objective, you are completely missing the point. 不会。通过专注于一种新兴的,尚未定义的建筑风格作为最终目标,您就完全失去了重点。 It is well worth considering whether the design and architectural properties considered characteristic of a microservice architecture will be a good fit for your project, but you're turning that backwards. 值得考虑的是,考虑微服务体系结构特征的设计和体系结构属性是否将非常适合您的项目,但是您将其倒退了。 It is a red flag to me that you claim to be making design decisions "just for the sake of 'microservices'". 对我来说,您声称自己只是为了“微服务”而做出设计决策是一个危险的信号。

Analysis with respect to microservices 关于微服务的分析

As for whether you are in fact building something in microservices style (for whatever that's worth to you), let's look at microservices characteristics as described at martinfowler.com : 至于您实际上是否正在构建微服务风格的东西(无论您认为什么值得),让我们看一下martinfowler.com上描述的微服务特征:

Componentization via Services 通过服务进行组件化

As far as I can tell from what you've presented, you are indeed doing this, but all I really have to go on is that you have pieces running in several different, cooperating processes. 据您介绍的内容,我确实可以做到这一点,但我真正要做的就是让您的组件在几个不同的协作过程中运行。 That's not all there is to being a component, nor to operating as a service. 作为一个组件或作为服务进行操作并不仅仅是全部。 Each component should have a well-defined job and a well-defined interface, independent of implementation characteristics to the greatest extent possible. 每个组件应具有定义明确的作业和定义明确的界面,并在最大程度上独立于实现特性。 Components should rely only on each others' defined interfaces to interoperate. 组件应仅依赖于彼此定义的接口进行互操作。

Organized around Business Capabilities 围绕业务能力进行组织

What you've presented appears to run directly contrary to this characteristic, being organized around technology layers instead of business capabilities. 您呈现的内容似乎与此特性直接相反,它围绕技术层而不是业务功能进行组织。

Products not Projects 产品不是项目

This is more a lifecycle management consideration than an architectural one. 这比体系结构更是生命周期管理考虑因素。 It's unclear whether you're operating in this way, but the way you couch your question makes me inclined to guess not. 目前尚不清楚您是否以这种方式进行操作,但是您提出问题的方式使我倾向于不去猜测。

Smart endpoints and dumb pipes 智能端点和哑管道

Whether your design has this characteristic is unclear, but it seems likely, given the nature of the components as you are defining them. 您的设计是否具有此特性尚不清楚,但考虑到定义组件时的性质,这似乎很可能。

To the extent that it might be more appropriate to consider the whole thing as one microservice (see "Organized around Business Capabilities" above), the fact that it has a REST interface is a good sign. 在某种程度上,将整个事物视为一个微服务可能更合适(请参见上面的“围绕业务功能组织”),它具有REST接口这一事实是一个好兆头。

Decentralized Governance 分散治理

This is another characteristic that seems a bit larger-scale than your efforts alone. 这是另一个特点,似乎比仅您的努力要大得多。 To the extent that you seem to have mostly free rein to design and build your product, it seems like you are indeed benefiting from decentralized governance. 在某种程度上,您似乎可以自由控制设计和构建产品,似乎您确实从分散的治理中受益。 Inasmuch as you seem to be a one-man team, however, that doesn't really apply internally within the scope of the development effort you are undertaking. 但是,由于您似乎是一个单人团队,因此这在您从事的开发工作范围内并没有真正适用于内部。

Decentralized Data Management 分散数据管理

It's unclear whether your plans have this characteristic, or even to what extent it applies to you. 尚不清楚您的计划是否具有此特征,甚至在何种程度上适用于您。

Infrastructure Automation 基础设施自动化

It's again unclear how well this characterizes your intentions, and to what extent it is even within your area of concern. 仍然不清楚这在多大程度上体现了您的意图,甚至在您所关注的范围之内。

Design for failure 失败设计

You've said nothing relevant to this characteristic. 您没有说过与此特性相关的信息。

Evolutionary Design 进化设计

It's unclear to what extent your proposed architecture exhibits this characteristic. 目前尚不清楚您提议的体系结构在多大程度上表现出此特征。 I'm inclined to guess not very much, though. 不过,我倾向于猜测不多。

Overall 总体

What you're describing does not seem to be on the scale to which the term "microservices architecture" applies, as Martin Fowler describes it. 正如Martin Fowler所描述的那样,您所描述的似乎与术语“微服务架构”所适用的范围不大。 There are certainly aspects of this paradigm that you could apply at your scale; 当然,您可以大规模应用此范例的某些方面。 some of these you do seem to apply, others you seem not to apply, and others I cannot evaluate with respect to your architecture overview. 您似乎确实应用了其中的某些内容,您似乎并不应用了其中的某些内容,而另一些我却无法就您的体系结构概述进行评估。

I don't think you're well served by trying to bring all these characteristics to your scale, and certainly the extent to which you do so is not a good metric for the quality of your design. 我认为尝试将所有这些特征都应用到您的规模中并不能很好地为您服务,当然,这样做的程度并不是衡量设计质量的好标准。 It may be that you want to design your product to work within a larger microservices context, but that puts few constraints on you; 可能是您希望设计产品以在更大的微服务环境中使用,但这对您几乎没有限制。 indeed, the freedom that offers you is one of the main advantages of the microservices approach. 实际上,为您提供的自由是微服务方法的主要优势之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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