是否有一个特定的标准可以遵循,因此可以将某些东西称为“微服务架构”?

发布于 2025-01-12 23:43:37 字数 198 浏览 1 评论 0原文

过去我使用的是我认为的“微服务”。我们有一个服务发现,应用程序通过 REST 同步调用相互通信,我认为这称为请求/响应。


现在我们正在开发一个应用程序,它被简单地分解为多个小应用程序,这些应用程序通过使用 Kafka 发布/订阅来协同工作,可以说它们之间没有直接通信,也没有服务发现。

可以肯定地说这些也是“微服务”吗?或者我应该如何称呼它们?

In the past I worked with what I believe were "microservices". We had a service discovery and the applications communicated with each other through REST sync calls, which I believe is called request / response.


Now we are working on an application that is simply broken down into multiple small applications which work together through publish / subscribe using Kafka, there's no direct communication between them nor a service discovery, per say.

Is it safe to say that these are "Microservices" too or what should I call them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

貪欢 2025-01-19 23:43:37

正如一位评论者指出的那样——答案总是固执己见(而 stackoverflow 通常不是基于意见的问题的最佳场所),但我并不害怕给出我的答案以试图提供帮助。

我的观点与马丁·福勒和其他人在过去十年中教给我们的内容以及亚马逊维尔纳·沃格尔斯的开创性工作的见解相一致。他们的定义是,微服务不是一个定义明确的单一标准,而是一种可以包含分布式计算中一系列不同方法的架构风格。它们的共同点是在许多不同维度提供可扩展性的目标,但主要是系统复杂性、组织生产力、吞吐量和弹性——同时价格实惠。为了实现这一目标,设计应围绕以下内容:

  1. 根据业务目标划分服务边界(一种领域驱动设计)。
  2. 规模/服务范围受到限制(著名的两个比萨饼团队规模想法)。
  3. 组织职责和维护方面的明确分离。这包括每个服务的独立团队和发布/维护周期。
  4. 在所有层上拥抱自动化(云虚拟化、devops、CICD、基础设施即代码等如何成为流行的工具)。
  5. 设计重点关注故障恢复操作,例如避免级联故障、定义的故障状态、回退等。

这些目标的结果也是采用分布式系统架构和水平可扩展性设计(无状态、计算和存储分离等)。 )。

因此,如果您觉得您的设计符合这些原则,那么我认为您已经成功地应用了微服务架构风格。

如果您想了解有关这一思想流派的更多信息,我建议您这篇文章

As one commenter pointed out- An answer will always be opinionated (and stackoverflow is generally not the best place for opinion based questions), but I am not afraid to give mine in an attempt to help.

My view goes along the lines of what Martin Fowler and others have taught us in last decade, as well as the insight from the pioneering work of Werner Vogels at Amazon. Their definitions are that microservices are not a well defined single standard, but an architectural style that can encompass a range of different approaches in distributed computing. What they have in common are the goals of providing scalability in many different dimensions, but mostly system complexity, organizational productivity, throughput and resilience - All while being affordable. To achieve that the designs should be centered around:

  1. Service boundaries cut according to business goals (a type of Domain Driven Design).
  2. Sizing / Scope of services to be limited (the famous two-pizza team size idea).
  3. Clear separation in terms of organizational responsibilities and maintenance. This includes independent teams and release-/ maintenance cycles for each service.
  4. Embrace of automation on all layers (how cloud virtualization, devops, CICD, infrastructure as code, etc. became popular tools).
  5. Design focus on failure-resilient operation, e.g. avoid cascading failures, defined failure states, fallbacks, etc.

A consequence of those goals is also the embrace of distributed system architectures and design for horizontal scalability (statelessness, separation of compute and storage, etc.).

So if you feel your designs are along those lines then in my opinion you would have applied the microservices architectural style successfully.

If you want to learn more about this school of thought I recommend this read.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文